Pārlūkot izejas kodu

fix(JingleSessionPC): Add a workaround for chrome issue.

The 'signalingstatechange' event for 'stable' is fired after the 'iceconnectionstatechange' event for 'completed' is fired on chrome in Unified plan. This prevents the client from switching the media connection to the p2p connection once the ice connection for p2p gets established.
dev1
Jaya Allamsetty 4 gadus atpakaļ
vecāks
revīzija
6f81b69745
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13
    1
      modules/xmpp/JingleSessionPC.js

+ 13
- 1
modules/xmpp/JingleSessionPC.js Parādīt failu

@@ -449,6 +449,7 @@ export default class JingleSessionPC extends JingleSession {
449 449
          */
450 450
         this.peerconnection.oniceconnectionstatechange = () => {
451 451
             const now = window.performance.now();
452
+            let isStable = false;
452 453
 
453 454
             if (!this.isP2P) {
454 455
                 this.room.connectionTimes[
@@ -479,6 +480,7 @@ export default class JingleSessionPC extends JingleSession {
479 480
                 // Informs interested parties that the connection has been restored. This includes the case when
480 481
                 // media connection to the bridge has been restored after an ICE failure by using session-terminate.
481 482
                 if (this.peerconnection.signalingState === 'stable') {
483
+                    isStable = true;
482 484
                     const usesTerminateForRestart = !this.options.enableIceRestart
483 485
                         && this.room.supportsRestartByTerminate();
484 486
 
@@ -488,7 +490,17 @@ export default class JingleSessionPC extends JingleSession {
488 490
                     }
489 491
                 }
490 492
 
491
-                if (!this.wasConnected && this.wasstable) {
493
+                // Add a workaround for an issue on chrome in Unified plan when the local endpoint is the offerer.
494
+                // The 'signalingstatechange' event for 'stable' is handled after the 'iceconnectionstatechange' event
495
+                // for 'completed' is handled by the client. This prevents the client from firing a
496
+                // CONNECTION_ESTABLISHED event for the p2p session. As a result, the offerer continues to stay on the
497
+                // jvb connection while the remote peer switches to the p2p connection breaking the media flow between
498
+                // the endpoints.
499
+                // TODO - file a chromium bug and add the information here.
500
+                if (!this.wasConnected
501
+                    && (this.wasstable
502
+                        || isStable
503
+                        || (this.usesUnifiedPlan && this.isInitiator && browser.isChromiumBased()))) {
492 504
 
493 505
                     Statistics.sendAnalytics(
494 506
                         ICE_DURATION,

Notiek ielāde…
Atcelt
Saglabāt