Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix an error when testing a result from a method that returns a promise
bbaldino7d99c54ec8af
diff --git a/conference.js b/conference.jsindex 8b46a51d95..20e5d10beb 100644--- a/conference.js+++ b/conference.js@@ -1977,35 +1977,42 @@ export default {* @private*/_initDeviceList() {- if (JitsiMeetJS.mediaDevices.isDeviceListAvailable() &&- JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {- JitsiMeetJS.mediaDevices.enumerateDevices(devices => {- // Ugly way to synchronize real device IDs with local- // storage and settings menu. This is a workaround until- // getConstraints() method will be implemented in browsers.- if (localAudio) {- APP.settings.setMicDeviceId(- localAudio.getDeviceId(), false);- }+ JitsiMeetJS.mediaDevices.isDeviceListAvailable()+ .then(isDeviceListAvailable => {+ if (isDeviceListAvailable+ && JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {+ JitsiMeetJS.mediaDevices.enumerateDevices(devices => {+ // Ugly way to synchronize real device IDs with local+ // storage and settings menu. This is a workaround until+ // getConstraints() method will be implemented+ // in browsers.+ if (localAudio) {+ APP.settings.setMicDeviceId(+ localAudio.getDeviceId(), false);+ }- if (localVideo) {- APP.settings.setCameraDeviceId(- localVideo.getDeviceId(), false);- }+ if (localVideo) {+ APP.settings.setCameraDeviceId(+ localVideo.getDeviceId(), false);+ }- mediaDeviceHelper.setCurrentMediaDevices(devices);- APP.UI.onAvailableDevicesChanged(devices);- APP.store.dispatch(updateDeviceList(devices));- this.updateVideoIconEnabled();- });+ mediaDeviceHelper.setCurrentMediaDevices(devices);+ APP.UI.onAvailableDevicesChanged(devices);+ APP.store.dispatch(updateDeviceList(devices));+ this.updateVideoIconEnabled();+ });- this.deviceChangeListener = (devices) =>- window.setTimeout(- () => this._onDeviceListChanged(devices), 0);- JitsiMeetJS.mediaDevices.addEventListener(- JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,- this.deviceChangeListener);- }+ this.deviceChangeListener = (devices) =>+ window.setTimeout(+ () => this._onDeviceListChanged(devices), 0);+ JitsiMeetJS.mediaDevices.addEventListener(+ JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,+ this.deviceChangeListener);+ }+ })+ .catch((error) => {+ logger.warn(`Error getting device list: ${error}`);+ });},/*** Event listener for JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED to