fix(deviceChange):Dont create video track if muted

This commit is contained in:
Hristo Terezov 2020-10-22 14:48:17 -05:00
parent 9c10ac3028
commit 007183c151
1 changed files with 14 additions and 0 deletions

View File

@ -2604,6 +2604,20 @@ export default {
// https://bugs.chromium.org/p/chromium/issues/detail?id=997689
const hasDefaultMicChanged = newDevices.audioinput === 'default';
// This is the case when the local video is muted and a preferred device is connected.
if (requestedInput.video && this.isLocalVideoMuted()) {
// We want to avoid creating a new video track in order to prevent turning on the camera.
requestedInput.video = false;
APP.store.dispatch(updateSettings({ // Update the current selected camera for the device selection dialog.
cameraDeviceId: newDevices.videoinput
}));
delete newDevices.videoinput;
// Removing the current video track in order to force the unmute to select the preferred device.
this.useVideoStream(null);
}
promises.push(
mediaDeviceHelper.createLocalTracksAfterDeviceListChanged(
createLocalTracksF,