Selaa lähdekoodia

feat(browser-support): Add support for WKWebview based browsers.

Apple added getUserMedia support for WkWebview based browsers like chrome and Firefox on iOS 14.3. These browsers behave as Safari does on iOS. Therefore, extend the Safari checks to these webkit based browsers as well.
dev1
Jaya Allamsetty 4 vuotta sitten
vanhempi
commit
e60f09b189

+ 2
- 2
JitsiConference.js Näytä tiedosto

439
 
439
 
440
     // Disable VAD processing on Safari since it causes audio input to
440
     // Disable VAD processing on Safari since it causes audio input to
441
     // fail on some of the mobile devices.
441
     // fail on some of the mobile devices.
442
-    if (config.enableTalkWhileMuted && !browser.isSafari()) {
442
+    if (config.enableTalkWhileMuted && !browser.isWebKitBased()) {
443
 
443
 
444
         // If VAD processor factory method is provided uses VAD based detection, otherwise fallback to audio level
444
         // If VAD processor factory method is provided uses VAD based detection, otherwise fallback to audio level
445
         // based detection.
445
         // based detection.
463
 
463
 
464
     // Disable noisy mic detection on safari since it causes the audio input to
464
     // Disable noisy mic detection on safari since it causes the audio input to
465
     // fail on Safari on iPadOS.
465
     // fail on Safari on iPadOS.
466
-    if (config.enableNoisyMicDetection && !browser.isSafari()) {
466
+    if (config.enableNoisyMicDetection && !browser.isWebKitBased()) {
467
         if (config.createVADProcessor) {
467
         if (config.createVADProcessor) {
468
             if (!this._audioAnalyser) {
468
             if (!this._audioAnalyser) {
469
                 this._audioAnalyser = new VADAudioAnalyser(this, config.createVADProcessor);
469
                 this._audioAnalyser = new VADAudioAnalyser(this, config.createVADProcessor);

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

175
     // @see https://github.com/jitsi/lib-jitsi-meet/pull/136
175
     // @see https://github.com/jitsi/lib-jitsi-meet/pull/136
176
     const isNewStyleConstraintsSupported
176
     const isNewStyleConstraintsSupported
177
         = browser.isFirefox()
177
         = browser.isFirefox()
178
-            || browser.isSafari()
178
+            || browser.isWebKitBased()
179
             || browser.isReactNative();
179
             || browser.isReactNative();
180
 
180
 
181
     if (um.indexOf('video') >= 0) {
181
     if (um.indexOf('video') >= 0) {
383
         // https://bugs.webkit.org/show_bug.cgi?id=210932
383
         // https://bugs.webkit.org/show_bug.cgi?id=210932
384
         // Camera doesn't start on older macOS versions if min/max constraints are specified.
384
         // Camera doesn't start on older macOS versions if min/max constraints are specified.
385
         // TODO: remove this hack when the bug fix is available on Mojave, Sierra and High Sierra.
385
         // TODO: remove this hack when the bug fix is available on Mojave, Sierra and High Sierra.
386
-        if (browser.isSafari()) {
386
+        if (browser.isWebKitBased()) {
387
             if (constraints.video.height && constraints.video.height.ideal) {
387
             if (constraints.video.height && constraints.video.height.ideal) {
388
                 constraints.video.height = { ideal: clonedeep(constraints.video.height.ideal) };
388
                 constraints.video.height = { ideal: clonedeep(constraints.video.height.ideal) };
389
             } else {
389
             } else {
412
         }
412
         }
413
 
413
 
414
         // Use the standard audio constraints on non-chromium browsers.
414
         // Use the standard audio constraints on non-chromium browsers.
415
-        if (browser.isFirefox() || browser.isSafari()) {
415
+        if (browser.isFirefox() || browser.isWebKitBased()) {
416
             constraints.audio = {
416
             constraints.audio = {
417
                 deviceId: options.micDeviceId,
417
                 deviceId: options.micDeviceId,
418
                 autoGainControl: !disableAGC && !disableAP,
418
                 autoGainControl: !disableAGC && !disableAP,

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

448
      * @returns {void}
448
      * @returns {void}
449
      */
449
      */
450
     updateEncodingsResolution(parameters) {
450
     updateEncodingsResolution(parameters) {
451
-        if (!(browser.isSafari() && parameters.encodings && Array.isArray(parameters.encodings))) {
451
+        if (!(browser.isWebKitBased() && parameters.encodings && Array.isArray(parameters.encodings))) {
452
             return;
452
             return;
453
         }
453
         }
454
         const allEqualEncodings
454
         const allEqualEncodings

+ 2
- 2
modules/RTC/TraceablePeerConnection.js Näytä tiedosto

879
     // Delete the existing track and create the new one because of a known bug on Safari.
879
     // Delete the existing track and create the new one because of a known bug on Safari.
880
     // RTCPeerConnection.ontrack fires when a new remote track is added but MediaStream.onremovetrack doesn't so
880
     // RTCPeerConnection.ontrack fires when a new remote track is added but MediaStream.onremovetrack doesn't so
881
     // it needs to be removed whenever a new track is received for the same endpoint id.
881
     // it needs to be removed whenever a new track is received for the same endpoint id.
882
-    if (existingTrack && browser.isSafari()) {
882
+    if (existingTrack && browser.isWebKitBased()) {
883
         this._remoteTrackRemoved(existingTrack.getOriginalStream(), existingTrack.getTrack());
883
         this._remoteTrackRemoved(existingTrack.getOriginalStream(), existingTrack.getTrack());
884
     }
884
     }
885
 
885
 
2761
     // TODO (brian): After moving all browsers to adapter, check if adapter is
2761
     // TODO (brian): After moving all browsers to adapter, check if adapter is
2762
     // accounting for different getStats apis, making the browser-checking-if
2762
     // accounting for different getStats apis, making the browser-checking-if
2763
     // unnecessary.
2763
     // unnecessary.
2764
-    if (browser.isSafari() || browser.isFirefox() || browser.isReactNative()) {
2764
+    if (browser.isWebKitBased() || browser.isFirefox() || browser.isReactNative()) {
2765
         // uses the new Promise based getStats
2765
         // uses the new Promise based getStats
2766
         this.peerconnection.getStats()
2766
         this.peerconnection.getStats()
2767
             .then(callback)
2767
             .then(callback)

+ 8
- 8
modules/browser/BrowserCapabilities.js Näytä tiedosto

33
      * strategy or <tt>false</tt> otherwise.
33
      * strategy or <tt>false</tt> otherwise.
34
      */
34
      */
35
     doesVideoMuteByStreamRemove() {
35
     doesVideoMuteByStreamRemove() {
36
-        return this.isChromiumBased() || this.isSafari();
36
+        return this.isChromiumBased() || this.isWebKitBased();
37
     }
37
     }
38
 
38
 
39
     /**
39
     /**
100
         return (this.isChromiumBased() && this._getChromiumBasedVersion() >= MIN_REQUIRED_CHROME_VERSION)
100
         return (this.isChromiumBased() && this._getChromiumBasedVersion() >= MIN_REQUIRED_CHROME_VERSION)
101
             || this.isFirefox()
101
             || this.isFirefox()
102
             || this.isReactNative()
102
             || this.isReactNative()
103
-            || (this.isSafari() && !this.isVersionLessThan('12.1'));
103
+            || this.isWebKitBased();
104
     }
104
     }
105
 
105
 
106
     /**
106
     /**
120
      * otherwise.
120
      * otherwise.
121
      */
121
      */
122
     supportsVideoMuteOnConnInterrupted() {
122
     supportsVideoMuteOnConnInterrupted() {
123
-        return this.isChromiumBased() || this.isReactNative() || this.isSafari();
123
+        return this.isChromiumBased() || this.isReactNative() || this.isWebKitBased();
124
     }
124
     }
125
 
125
 
126
     /**
126
     /**
131
     supportsBandwidthStatistics() {
131
     supportsBandwidthStatistics() {
132
         // FIXME bandwidth stats are currently not implemented for FF on our
132
         // FIXME bandwidth stats are currently not implemented for FF on our
133
         // side, but not sure if not possible ?
133
         // side, but not sure if not possible ?
134
-        return !this.isFirefox() && !this.isSafari();
134
+        return !this.isFirefox() && !this.isWebKitBased();
135
     }
135
     }
136
 
136
 
137
     /**
137
     /**
146
 
146
 
147
             // this is not working on Safari because of the following bug
147
             // this is not working on Safari because of the following bug
148
             // https://bugs.webkit.org/show_bug.cgi?id=215567
148
             // https://bugs.webkit.org/show_bug.cgi?id=215567
149
-            && !this.isSafari();
149
+            && !this.isWebKitBased();
150
     }
150
     }
151
 
151
 
152
     /**
152
     /**
164
      * candidates through the legacy getStats() API.
164
      * candidates through the legacy getStats() API.
165
      */
165
      */
166
     supportsLocalCandidateRttStatistics() {
166
     supportsLocalCandidateRttStatistics() {
167
-        return this.isChromiumBased() || this.isReactNative() || this.isSafari();
167
+        return this.isChromiumBased() || this.isReactNative() || this.isWebKitBased();
168
     }
168
     }
169
 
169
 
170
     /**
170
     /**
217
      * @returns {boolean}
217
      * @returns {boolean}
218
      */
218
      */
219
     usesSdpMungingForSimulcast() {
219
     usesSdpMungingForSimulcast() {
220
-        return this.isChromiumBased() || this.isReactNative() || this.isSafari();
220
+        return this.isChromiumBased() || this.isReactNative() || this.isWebKitBased();
221
     }
221
     }
222
 
222
 
223
     /**
223
     /**
242
      * @returns {boolean}
242
      * @returns {boolean}
243
      */
243
      */
244
     usesNewGumFlow() {
244
     usesNewGumFlow() {
245
-        if (this.isChromiumBased() || this.isFirefox() || this.isSafari()) {
245
+        if (this.isChromiumBased() || this.isFirefox() || this.isWebKitBased()) {
246
             return true;
246
             return true;
247
         }
247
         }
248
 
248
 

+ 1
- 1
modules/statistics/RTPStatsCollector.js Näytä tiedosto

232
      * @type {boolean}
232
      * @type {boolean}
233
      */
233
      */
234
     this._usesPromiseGetStats
234
     this._usesPromiseGetStats
235
-        = browser.isSafari() || browser.isFirefox() || browser.isReactNative();
235
+        = browser.isWebKitBased() || browser.isFirefox() || browser.isReactNative();
236
 
236
 
237
     /**
237
     /**
238
      * The function which is to be used to retrieve the value associated in a
238
      * The function which is to be used to retrieve the value associated in a

Loading…
Peruuta
Tallenna