Bladeren bron

Fixes changing device unmutes you in a conference.

j8
damencho 7 jaren geleden
bovenliggende
commit
ade5290013
2 gewijzigde bestanden met toevoegingen van 18 en 2 verwijderingen
  1. 17
    1
      conference.js
  2. 1
    1
      react/features/base/tracks/actions.js

+ 17
- 1
conference.js Bestand weergeven

@@ -2176,6 +2176,8 @@ export default {
2176 2176
         APP.UI.addListener(
2177 2177
             UIEvents.VIDEO_DEVICE_CHANGED,
2178 2178
             cameraDeviceId => {
2179
+                const videoWasMuted = this.isLocalVideoMuted();
2180
+
2179 2181
                 sendAnalyticsEvent('settings.changeDevice.video');
2180 2182
                 createLocalTracksF({
2181 2183
                     devices: [ 'video' ],
@@ -2183,7 +2185,9 @@ export default {
2183 2185
                     micDeviceId: null
2184 2186
                 })
2185 2187
                 .then(([ stream ]) => {
2186
-                    if (this.isAudioOnly()) {
2188
+                    // if we are in audio only mode or video was muted before
2189
+                    // changing device, then mute
2190
+                    if (this.isAudioOnly() || videoWasMuted) {
2187 2191
                         return stream.mute()
2188 2192
                             .then(() => stream);
2189 2193
                     }
@@ -2204,6 +2208,8 @@ export default {
2204 2208
         APP.UI.addListener(
2205 2209
             UIEvents.AUDIO_DEVICE_CHANGED,
2206 2210
             micDeviceId => {
2211
+                const audioWasMuted = this.isLocalAudioMuted();
2212
+
2207 2213
                 sendAnalyticsEvent(
2208 2214
                     'settings.changeDevice.audioIn');
2209 2215
                 createLocalTracksF({
@@ -2212,6 +2218,16 @@ export default {
2212 2218
                     micDeviceId
2213 2219
                 })
2214 2220
                 .then(([ stream ]) => {
2221
+                    // if audio was muted before changing the device, mute
2222
+                    // with the new device
2223
+                    if (audioWasMuted) {
2224
+                        return stream.mute()
2225
+                            .then(() => stream);
2226
+                    }
2227
+
2228
+                    return stream;
2229
+                })
2230
+                .then(stream => {
2215 2231
                     this.useAudioStream(stream);
2216 2232
                     logger.log('switched local audio device');
2217 2233
                     APP.settings.setMicDeviceId(micDeviceId, true);

+ 1
- 1
react/features/base/tracks/actions.js Bestand weergeven

@@ -165,7 +165,7 @@ export function replaceLocalTrack(oldTrack, newTrack, conference) {
165 165
                             logger.log(`Replace ${newTrack.getType()} track - ${
166 166
                                 isMuted ? 'muted' : 'unmuted'}`);
167 167
 
168
-                            return dispatch(setMuted());
168
+                            return dispatch(setMuted(isMuted));
169 169
                         }
170 170
                     })
171 171
                     .then(() => {

Laden…
Annuleren
Opslaan