Merge branch 'RC1-1.0' of https://github.com/havfo/multiparty-meeting into RC1-1.0

master
Stefan Otto 2018-11-14 12:03:07 +01:00
commit 5339903a50
1 changed files with 29 additions and 0 deletions

View File

@ -115,6 +115,8 @@ export default class RoomClient
this._screenSharingProducer = null;
this._startKeyListener();
this._join({ displayName, device });
}
@ -137,6 +139,33 @@ export default class RoomClient
this._dispatch(stateActions.setRoomState('closed'));
}
_startKeyListener()
{
// Add keypress event listner on document
document.addEventListener('keypress', (event) =>
{
const key = String.fromCharCode(event.keyCode);
const source = event.target;
const exclude = [ 'input', 'textarea' ];
if (exclude.indexOf(source.tagName.toLowerCase()) === -1)
{
logger.debug('keyPress() [key:"%s"]', key);
switch (key)
{
case 'a': // Activate advanced mode
{
this._dispatch(stateActions.toggleAdvancedMode());
this.notify('Toggled advanced mode.');
}
}
}
});
}
login()
{
const url = `/login?roomId=${this._room.roomId}&peerName=${this._peerName}`;