Selaa lähdekoodia

Skips setting output to element when there is no user selection.

dev1
damencho 9 vuotta sitten
vanhempi
commit
b9fe4a83dd
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6
    1
      modules/RTC/RTCUtils.js

+ 6
- 1
modules/RTC/RTCUtils.js Näytä tiedosto

32
 // Currently audio output device change is supported only in Chrome and
32
 // Currently audio output device change is supported only in Chrome and
33
 // default output always has 'default' device ID
33
 // default output always has 'default' device ID
34
 var audioOutputDeviceId = 'default'; // default device
34
 var audioOutputDeviceId = 'default'; // default device
35
+// whether user has explicitly set a device to use
36
+var audioOutputChanged = false;
35
 // Disables Acoustic Echo Cancellation
37
 // Disables Acoustic Echo Cancellation
36
 var disableAEC = false;
38
 var disableAEC = false;
37
 // Disables Noise Suppression
39
 // Disables Noise Suppression
650
         if (stream
652
         if (stream
651
                 && RTCUtils.isDeviceChangeAvailable('output')
653
                 && RTCUtils.isDeviceChangeAvailable('output')
652
                 && stream.getAudioTracks
654
                 && stream.getAudioTracks
653
-                && stream.getAudioTracks().length) {
655
+                && stream.getAudioTracks().length
656
+                // we skip setting audio output if there was no explicit change
657
+                && audioOutputChanged) {
654
             element.setSinkId(RTCUtils.getAudioOutputDevice())
658
             element.setSinkId(RTCUtils.getAudioOutputDevice())
655
                 .catch(function (ex) {
659
                 .catch(function (ex) {
656
                     var err = new JitsiTrackError(ex, null, ['audiooutput']);
660
                     var err = new JitsiTrackError(ex, null, ['audiooutput']);
1228
         return featureDetectionAudioEl.setSinkId(deviceId)
1232
         return featureDetectionAudioEl.setSinkId(deviceId)
1229
             .then(function() {
1233
             .then(function() {
1230
                 audioOutputDeviceId = deviceId;
1234
                 audioOutputDeviceId = deviceId;
1235
+                audioOutputChanged = true;
1231
 
1236
 
1232
                 logger.log('Audio output device set to ' + deviceId);
1237
                 logger.log('Audio output device set to ' + deviceId);
1233
 
1238
 

Loading…
Peruuta
Tallenna