Listen for device changes and update device list.
This commit is contained in:
@@ -136,6 +136,8 @@ export default class RoomClient
|
||||
this._screenSharingProducer = null;
|
||||
|
||||
this._startKeyListener();
|
||||
|
||||
this._startDevicesListener();
|
||||
}
|
||||
|
||||
close()
|
||||
@@ -211,6 +213,19 @@ export default class RoomClient
|
||||
});
|
||||
}
|
||||
|
||||
_startDevicesListener()
|
||||
{
|
||||
navigator.mediaDevices.addEventListener('devicechange', async () =>
|
||||
{
|
||||
logger.debug('_startDevicesListener() | navigator.mediaDevices.ondevicechange');
|
||||
|
||||
await this._updateAudioDevices();
|
||||
await this._updateWebcams();
|
||||
|
||||
this.notify('Your devices changed, configure your devices in the settings dialog.');
|
||||
});
|
||||
}
|
||||
|
||||
login()
|
||||
{
|
||||
const url = `/login?roomId=${this._room.roomId}&peerName=${this._peerName}`;
|
||||
|
||||
Reference in New Issue
Block a user