Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fixes changing device unmutes you in a conference.

damenchoade5290013e5
diff --git a/conference.js b/conference.js
index 0d5855bca9..d451509405 100644
--- a/conference.js
+++ b/conference.js
@@ -2176,6 +2176,8 @@ export default {
APP.UI.addListener(
UIEvents.VIDEO_DEVICE_CHANGED,
cameraDeviceId => {
+ const videoWasMuted = this.isLocalVideoMuted();
+
sendAnalyticsEvent('settings.changeDevice.video');
createLocalTracksF({
devices: [ 'video' ],
@@ -2183,7 +2185,9 @@ export default {
micDeviceId: null
})
.then(([ stream ]) => {
- if (this.isAudioOnly()) {
+ // if we are in audio only mode or video was muted before
+ // changing device, then mute
+ if (this.isAudioOnly() || videoWasMuted) {
return stream.mute()
.then(() => stream);
}
@@ -2204,6 +2208,8 @@ export default {
APP.UI.addListener(
UIEvents.AUDIO_DEVICE_CHANGED,
micDeviceId => {
+ const audioWasMuted = this.isLocalAudioMuted();
+
sendAnalyticsEvent(
'settings.changeDevice.audioIn');
createLocalTracksF({
@@ -2212,6 +2218,16 @@ export default {
micDeviceId
})
.then(([ stream ]) => {
+ // if audio was muted before changing the device, mute
+ // with the new device
+ if (audioWasMuted) {
+ return stream.mute()
+ .then(() => stream);
+ }
+
+ return stream;
+ })
+ .then(stream => {
this.useAudioStream(stream);
logger.log('switched local audio device');
APP.settings.setMicDeviceId(micDeviceId, true);
diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.js
index 42a959885d..04848cbc3b 100644
--- a/react/features/base/tracks/actions.js
+++ b/react/features/base/tracks/actions.js
@@ -165,7 +165,7 @@ export function replaceLocalTrack(oldTrack, newTrack, conference) {
logger.log(`Replace ${newTrack.getType()} track - ${
isMuted ? 'muted' : 'unmuted'}`);
- return dispatch(setMuted());
+ return dispatch(setMuted(isMuted));
}
})
.then(() => {