Browse Source

Fixes unplugging unused device mutes local audio and video.

master
damencho 8 years ago
parent
commit
beffdb1e9b
1 changed files with 2 additions and 11 deletions
  1. 2
    11
      conference.js

+ 2
- 11
conference.js View File

2408
         const promises = [];
2408
         const promises = [];
2409
         const audioWasMuted = this.isLocalAudioMuted();
2409
         const audioWasMuted = this.isLocalAudioMuted();
2410
         const videoWasMuted = this.isLocalVideoMuted();
2410
         const videoWasMuted = this.isLocalVideoMuted();
2411
-        const availableAudioInputDevices
2412
-            = mediaDeviceHelper.getDevicesFromListByKind(devices, 'audioinput');
2413
-        const availableVideoInputDevices
2414
-            = mediaDeviceHelper.getDevicesFromListByKind(devices, 'videoinput');
2415
 
2411
 
2416
         if (typeof newDevices.audiooutput !== 'undefined') {
2412
         if (typeof newDevices.audiooutput !== 'undefined') {
2417
             // Just ignore any errors in catch block.
2413
             // Just ignore any errors in catch block.
2430
                 .then(() => {
2426
                 .then(() => {
2431
                     // If audio was muted before, or we unplugged current device
2427
                     // If audio was muted before, or we unplugged current device
2432
                     // and selected new one, then mute new audio track.
2428
                     // and selected new one, then mute new audio track.
2433
-                    if (audioWasMuted
2434
-                        || currentDevices.audioinput.length
2435
-                        > availableAudioInputDevices.length) {
2429
+                    if (audioWasMuted) {
2436
                         sendAnalyticsEvent('deviceListChanged.audio.muted');
2430
                         sendAnalyticsEvent('deviceListChanged.audio.muted');
2437
                         logger.log('Audio mute: device list changed');
2431
                         logger.log('Audio mute: device list changed');
2438
                         muteLocalAudio(true);
2432
                         muteLocalAudio(true);
2440
 
2434
 
2441
                     // If video was muted before, or we unplugged current device
2435
                     // If video was muted before, or we unplugged current device
2442
                     // and selected new one, then mute new video track.
2436
                     // and selected new one, then mute new video track.
2443
-                    if (!this.isSharingScreen
2444
-                        && (videoWasMuted
2445
-                            || currentDevices.videoinput.length
2446
-                                > availableVideoInputDevices.length)) {
2437
+                    if (!this.isSharingScreen && videoWasMuted) {
2447
                         sendAnalyticsEvent('deviceListChanged.video.muted');
2438
                         sendAnalyticsEvent('deviceListChanged.video.muted');
2448
                         logger.log('Video mute: device list changed');
2439
                         logger.log('Video mute: device list changed');
2449
                         muteLocalVideo(true);
2440
                         muteLocalVideo(true);

Loading…
Cancel
Save