diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-08-30 12:56:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 12:56:33 +0300 |
commit | 501fb5294dfee1d8a923846c7d92cf074c8486e6 (patch) | |
tree | a6d76f1215ea8050f04e2d9972b78a7353bba9ef /src | |
parent | b56a4b0631f14be425cbb2337ac1fb798ad88f72 (diff) | |
parent | 6642b2bc1d281e533e6c92b3c1e60939c40dccd1 (diff) |
Merge pull request #6152 from nextcloud/bugfix/noid/log-device-selection-falling-back-and-also-try-by-label
Add some logging to the device selection
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/webrtc/MediaDevicesManager.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/utils/webrtc/MediaDevicesManager.js b/src/utils/webrtc/MediaDevicesManager.js index e94529753..e9d6b8a13 100644 --- a/src/utils/webrtc/MediaDevicesManager.js +++ b/src/utils/webrtc/MediaDevicesManager.js @@ -226,6 +226,22 @@ MediaDevicesManager.prototype = { this._addDevice(addedDevice) }) + // Fallback in case we didn't find the previously picked device + if (this.attributes.audioInputId === undefined) { + if (BrowserStorage.getItem('audioInputId')) { + // Couldn't find device by id + console.debug('Could not find previous audio device, falling back to default/first device in the list', BrowserStorage.getItem('audioInputId'), this.attributes.devices) + } + this.attributes.audioInputId = this._fallbackAudioInputId + } + if (this.attributes.videoInputId === undefined) { + if (BrowserStorage.getItem('videoInputId')) { + // Couldn't find device by id, try the label + console.debug('Could not find previous video device, falling back to default/first device in the list', BrowserStorage.getItem('videoInputId'), this.attributes.devices) + } + this.attributes.videoInputId = this._fallbackVideoInputId + } + // Trigger change events after all the devices are processed to // prevent change events for intermediate states. if (previousAudioInputId !== this.attributes.audioInputId) { @@ -325,9 +341,6 @@ MediaDevicesManager.prototype = { if (!this._fallbackAudioInputId || addedDevice.deviceId === 'default') { this._fallbackAudioInputId = addedDevice.deviceId } - if (this.attributes.audioInputId === undefined) { - this.attributes.audioInputId = this._fallbackAudioInputId - } } else if (addedDevice.kind === 'videoinput') { if (BrowserStorage.getItem('videoInputId') === addedDevice.deviceId) { this.attributes.videoInputId = addedDevice.deviceId @@ -335,9 +348,6 @@ MediaDevicesManager.prototype = { if (!this._fallbackVideoInputId || addedDevice.deviceId === 'default') { this._fallbackVideoInputId = addedDevice.deviceId } - if (this.attributes.videoInputId === undefined) { - this.attributes.videoInputId = this._fallbackVideoInputId - } } this.attributes.devices.push(addedDevice) |