fix an error when testing a result from a method that returns a promise
This commit is contained in:
parent
37328b3995
commit
7d99c54ec8
|
@ -1977,12 +1977,15 @@ export default {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_initDeviceList() {
|
_initDeviceList() {
|
||||||
if (JitsiMeetJS.mediaDevices.isDeviceListAvailable() &&
|
JitsiMeetJS.mediaDevices.isDeviceListAvailable()
|
||||||
JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
|
.then(isDeviceListAvailable => {
|
||||||
|
if (isDeviceListAvailable
|
||||||
|
&& JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
|
||||||
JitsiMeetJS.mediaDevices.enumerateDevices(devices => {
|
JitsiMeetJS.mediaDevices.enumerateDevices(devices => {
|
||||||
// Ugly way to synchronize real device IDs with local
|
// Ugly way to synchronize real device IDs with local
|
||||||
// storage and settings menu. This is a workaround until
|
// storage and settings menu. This is a workaround until
|
||||||
// getConstraints() method will be implemented in browsers.
|
// getConstraints() method will be implemented
|
||||||
|
// in browsers.
|
||||||
if (localAudio) {
|
if (localAudio) {
|
||||||
APP.settings.setMicDeviceId(
|
APP.settings.setMicDeviceId(
|
||||||
localAudio.getDeviceId(), false);
|
localAudio.getDeviceId(), false);
|
||||||
|
@ -2006,6 +2009,10 @@ export default {
|
||||||
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
|
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
|
||||||
this.deviceChangeListener);
|
this.deviceChangeListener);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
logger.warn(`Error getting device list: ${error}`);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Event listener for JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED to
|
* Event listener for JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED to
|
||||||
|
|
Loading…
Reference in New Issue