fix an error when testing a result from a method that returns a promise

This commit is contained in:
bbaldino 2017-07-14 18:45:32 +00:00
parent 37328b3995
commit 7d99c54ec8
1 changed files with 33 additions and 26 deletions

View File

@ -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