Browse Source

fix(RTCUtils) Return false for device change checks on mobile Safari.

tags/v0.0.2
Jaya Allamsetty 3 years ago
parent
commit
ad1f06d768
2 changed files with 14 additions and 6 deletions
  1. 2
    3
      JitsiMediaDevices.js
  2. 12
    3
      modules/RTC/RTCUtils.js

+ 2
- 3
JitsiMediaDevices.js View File

257
     }
257
     }
258
 
258
 
259
     /**
259
     /**
260
-     * Returns true if it is possible to be simultaneously capturing audio
261
-     * from more than one device.
260
+     * Returns true if it is possible to be simultaneously capturing audio from more than one device.
262
      *
261
      *
263
      * @returns {boolean}
262
      * @returns {boolean}
264
      */
263
      */
265
     isMultipleAudioInputSupported() {
264
     isMultipleAudioInputSupported() {
266
-        return !browser.isFirefox();
265
+        return !(browser.isFirefox() || browser.isIosBrowser());
267
     }
266
     }
268
 
267
 
269
     /**
268
     /**

+ 12
- 3
modules/RTC/RTCUtils.js View File

764
      * @returns {boolean} true if available, false otherwise.
764
      * @returns {boolean} true if available, false otherwise.
765
      */
765
      */
766
     isDeviceChangeAvailable(deviceType) {
766
     isDeviceChangeAvailable(deviceType) {
767
-        return deviceType === 'output' || deviceType === 'audiooutput'
768
-            ? isAudioOutputDeviceChangeAvailable
769
-            : true;
767
+        if (deviceType === 'output' || deviceType === 'audiooutput') {
768
+            return isAudioOutputDeviceChangeAvailable;
769
+        }
770
+
771
+        // Calling getUserMedia again (for preview) kills the track returned by the first getUserMedia call because of
772
+        // https://bugs.webkit.org/show_bug.cgi?id=179363. Therefore, do not show microphone/camera options on mobile
773
+        // Safari.
774
+        if ((deviceType === 'audioinput' || deviceType === 'input') && browser.isIosBrowser()) {
775
+            return false;
776
+        }
777
+
778
+        return true;
770
     }
779
     }
771
 
780
 
772
     /**
781
     /**

Loading…
Cancel
Save