Sfoglia il codice sorgente

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

dev1
Saúl Ibarra Corretgé 2 anni fa
parent
commit
d9ee8f59bd

+ 7
- 2
JitsiConference.js Vedi File

@@ -1198,8 +1198,13 @@ JitsiConference.prototype._fireMuteChangeEvent = function(track) {
1198 1198
     }
1199 1199
 
1200 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 1208
         this._sendBridgeVideoTypeMessage(track);
1204 1209
     }
1205 1210
 

+ 6
- 1
modules/RTC/JitsiLocalTrack.js Vedi File

@@ -369,13 +369,18 @@ export default class JitsiLocalTrack extends JitsiTrack {
369 369
         // A function that will print info about muted status transition
370 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 377
         // In the multi-stream mode, desktop tracks are muted from jitsi-meet instead of being removed from the
373 378
         // conference. This is needed because we don't want the client to signal a source-remove to the remote peer for
374 379
         // the desktop track when screenshare is stopped. Later when screenshare is started again, the same sender will
375 380
         // be re-used without the need for signaling a new ssrc through source-add.
376 381
         if (this.isAudioTrack()
377 382
                 || (this.videoType === VideoType.DESKTOP && !FeatureFlags.isMultiStreamSendSupportEnabled())
378
-                || !browser.doesVideoMuteByStreamRemove()) {
383
+                || !doesVideoMuteByStreamRemove) {
379 384
             logMuteInfo();
380 385
 
381 386
             // If we have a stream effect that implements its own mute functionality, prioritize it before

+ 2
- 2
modules/RTC/RTC.js Vedi File

@@ -472,8 +472,8 @@ export default class RTC extends Listenable {
472 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 478
         if (supportsSdpSemantics) {
479 479
             logger.debug('WebRTC application is running in plan-b mode');

+ 1
- 1
modules/browser/BrowserCapabilities.js Vedi File

@@ -317,7 +317,7 @@ export default class BrowserCapabilities extends BrowserDetection {
317 317
     supportsUnifiedPlan() {
318 318
         // We do not want to enable unified plan on Electron clients that have Chromium version < 96 because of
319 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 Vedi File

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

Loading…
Annulla
Salva