Quellcode durchsuchen

feat(browser-support) use Unified Plan on React Native

release-8443
Saúl Ibarra Corretgé vor 3 Jahren
Ursprung
Commit
d9ee8f59bd

+ 7
- 2
JitsiConference.js Datei anzeigen

1198
     }
1198
     }
1199
 
1199
 
1200
     // Send the video type message to the bridge if the track is not removed/added to the pc as part of
1200
     // Send the video type message to the bridge if the track is not removed/added to the pc as part of
1201
-    // the mute/unmute operation. This currently happens only on Firefox.
1202
-    if (track.isVideoTrack() && !browser.doesVideoMuteByStreamRemove()) {
1201
+    // the mute/unmute operation.
1202
+    // In React Native we mute the camera by setting track.enabled but that doesn't
1203
+    // work for screen-share tracks, so do the remove-as-mute for those.
1204
+    const doesVideoMuteByStreamRemove
1205
+        = browser.isReactNative() ? track.videoType === VideoType.DESKTOP : browser.doesVideoMuteByStreamRemove();
1206
+
1207
+    if (track.isVideoTrack() && !doesVideoMuteByStreamRemove) {
1203
         this._sendBridgeVideoTypeMessage(track);
1208
         this._sendBridgeVideoTypeMessage(track);
1204
     }
1209
     }
1205
 
1210
 

+ 6
- 1
modules/RTC/JitsiLocalTrack.js Datei anzeigen

369
         // A function that will print info about muted status transition
369
         // A function that will print info about muted status transition
370
         const logMuteInfo = () => logger.info(`Mute ${this}: ${muted}`);
370
         const logMuteInfo = () => logger.info(`Mute ${this}: ${muted}`);
371
 
371
 
372
+        // In React Native we mute the camera by setting track.enabled but that doesn't
373
+        // work for screen-share tracks, so do the remove-as-mute for those.
374
+        const doesVideoMuteByStreamRemove
375
+            = browser.isReactNative() ? this.videoType === VideoType.DESKTOP : browser.doesVideoMuteByStreamRemove();
376
+
372
         // In the multi-stream mode, desktop tracks are muted from jitsi-meet instead of being removed from the
377
         // In the multi-stream mode, desktop tracks are muted from jitsi-meet instead of being removed from the
373
         // conference. This is needed because we don't want the client to signal a source-remove to the remote peer for
378
         // conference. This is needed because we don't want the client to signal a source-remove to the remote peer for
374
         // the desktop track when screenshare is stopped. Later when screenshare is started again, the same sender will
379
         // the desktop track when screenshare is stopped. Later when screenshare is started again, the same sender will
375
         // be re-used without the need for signaling a new ssrc through source-add.
380
         // be re-used without the need for signaling a new ssrc through source-add.
376
         if (this.isAudioTrack()
381
         if (this.isAudioTrack()
377
                 || (this.videoType === VideoType.DESKTOP && !FeatureFlags.isMultiStreamSendSupportEnabled())
382
                 || (this.videoType === VideoType.DESKTOP && !FeatureFlags.isMultiStreamSendSupportEnabled())
378
-                || !browser.doesVideoMuteByStreamRemove()) {
383
+                || !doesVideoMuteByStreamRemove) {
379
             logMuteInfo();
384
             logMuteInfo();
380
 
385
 
381
             // If we have a stream effect that implements its own mute functionality, prioritize it before
386
             // If we have a stream effect that implements its own mute functionality, prioritize it before

+ 2
- 2
modules/RTC/RTC.js Datei anzeigen

472
             pcConfig.encodedInsertableStreams = true;
472
             pcConfig.encodedInsertableStreams = true;
473
         }
473
         }
474
 
474
 
475
-        const supportsSdpSemantics = browser.isReactNative()
476
-            || (browser.isChromiumBased() && !options.usesUnifiedPlan);
475
+        // TODO: remove this.
476
+        const supportsSdpSemantics = browser.isChromiumBased() && !options.usesUnifiedPlan;
477
 
477
 
478
         if (supportsSdpSemantics) {
478
         if (supportsSdpSemantics) {
479
             logger.debug('WebRTC application is running in plan-b mode');
479
             logger.debug('WebRTC application is running in plan-b mode');

+ 1
- 1
modules/browser/BrowserCapabilities.js Datei anzeigen

317
     supportsUnifiedPlan() {
317
     supportsUnifiedPlan() {
318
         // We do not want to enable unified plan on Electron clients that have Chromium version < 96 because of
318
         // We do not want to enable unified plan on Electron clients that have Chromium version < 96 because of
319
         // performance and screensharing issues.
319
         // performance and screensharing issues.
320
-        return !(this.isReactNative() || (this.isElectron() && (this._getChromiumBasedVersion() < 96)));
320
+        return !(this.isElectron() && (this._getChromiumBasedVersion() < 96));
321
     }
321
     }
322
 
322
 
323
     /**
323
     /**

+ 3
- 3
modules/xmpp/JingleSessionPC.js Datei anzeigen

426
         pcOptions.audioQuality = options.audioQuality;
426
         pcOptions.audioQuality = options.audioQuality;
427
         pcOptions.usesUnifiedPlan = this.usesUnifiedPlan
427
         pcOptions.usesUnifiedPlan = this.usesUnifiedPlan
428
             = browser.supportsUnifiedPlan()
428
             = browser.supportsUnifiedPlan()
429
-                && (browser.isFirefox()
430
-                    || browser.isWebKitBased()
429
+                && (!browser.isChromiumBased()
431
                     || (browser.isChromiumBased()
430
                     || (browser.isChromiumBased()
432
 
431
 
433
                         // Provide a way to control the behavior for jvb and p2p connections independently.
432
                         // Provide a way to control the behavior for jvb and p2p connections independently.
598
                 if (!this.wasConnected
597
                 if (!this.wasConnected
599
                     && (this.wasstable
598
                     && (this.wasstable
600
                         || isStable
599
                         || isStable
601
-                        || (this.usesUnifiedPlan && this.isInitiator && browser.isChromiumBased()))) {
600
+                        || (this.usesUnifiedPlan && this.isInitiator
601
+                            && (browser.isChromiumBased() || browser.isReactNative())))) {
602
 
602
 
603
                     Statistics.sendAnalytics(
603
                     Statistics.sendAnalytics(
604
                         ICE_DURATION,
604
                         ICE_DURATION,

Laden…
Abbrechen
Speichern