Listen for device changes and update device list.
parent
0cd1909af0
commit
7dc4d62c5b
|
|
@ -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}`;
|
||||
|
|
|
|||
Loading…
Reference in New Issue