Explorar el Código

fix(safari): construct track constraints from getSettings (#1104)

MediaStreamTrack getConstraints on Safari returns an empty object.
Enable device selection on Safari.
tags/v0.0.2
Jaya Allamsetty hace 5 años
padre
commit
a832b39b5a
No account linked to committer's email address
Se han modificado 2 ficheros con 9 adiciones y 1 borrados
  1. 8
    0
      modules/RTC/JitsiLocalTrack.js
  2. 1
    1
      modules/RTC/RTCUtils.js

+ 8
- 0
modules/RTC/JitsiLocalTrack.js Ver fichero

@@ -96,6 +96,14 @@ export default class JitsiLocalTrack extends JitsiTrack {
96 96
             // Cache the constraints of the track in case of any this track
97 97
             // model needs to call getUserMedia again, such as when unmuting.
98 98
             this._constraints = track.getConstraints();
99
+
100
+            // Safari returns an empty constraints object, construct the constraints using getSettings.
101
+            if (!Object.keys(this._constraints).length && videoType === VideoType.CAMERA) {
102
+                this._constraints = {
103
+                    height: track.getSettings().height,
104
+                    width: track.getSettings().width
105
+                };
106
+            }
99 107
         } else {
100 108
             // FIXME Currently, Firefox is ignoring our constraints about
101 109
             // resolutions so we do not store it, to avoid wrong reporting of

+ 1
- 1
modules/RTC/RTCUtils.js Ver fichero

@@ -1435,7 +1435,7 @@ class RTCUtils extends Listenable {
1435 1435
     isDeviceChangeAvailable(deviceType) {
1436 1436
         return deviceType === 'output' || deviceType === 'audiooutput'
1437 1437
             ? isAudioOutputDeviceChangeAvailable
1438
-            : !browser.isSafari();
1438
+            : true;
1439 1439
     }
1440 1440
 
1441 1441
     /**

Loading…
Cancelar
Guardar