Bladeren bron

Fixes issue with StatsCollector when the conference is recreated the peerconnection in the StatsCollector isn't updated.

j8
hristoterezov 11 jaren geleden
bovenliggende
commit
a694d0fbdf
1 gewijzigde bestanden met toevoegingen van 16 en 6 verwijderingen
  1. 16
    6
      app.js

+ 16
- 6
app.js Bestand weergeven

@@ -469,7 +469,8 @@ function localStatsUpdated(statsCollector)
469 469
  */
470 470
 function startRtpStatsCollector()
471 471
 {
472
-    if (config.enableRtpStats && !statsCollector)
472
+    stopRTPStatsCollector();
473
+    if (config.enableRtpStats)
473 474
     {
474 475
         statsCollector = new StatsCollector(
475 476
             getConferenceHandler().peerconnection, 200, statsUpdated);
@@ -479,6 +480,19 @@ function startRtpStatsCollector()
479 480
         statsCollector.start();
480 481
     }
481 482
 }
483
+
484
+/**
485
+ * Stops the {@link StatsCollector}.
486
+ */
487
+function stopRTPStatsCollector()
488
+{
489
+    if (statsCollector)
490
+    {
491
+        statsCollector.stop();
492
+        statsCollector = null;
493
+    }
494
+}
495
+
482 496
 /**
483 497
  * Starts the {@link LocalStatsCollector} if the feature is enabled in config.js
484 498
  * @param stream the stream that will be used for collecting statistics.
@@ -1082,11 +1096,7 @@ function disposeConference(onUnload) {
1082 1096
         }
1083 1097
         handler.peerconnection.close();
1084 1098
     }
1085
-    if (statsCollector)
1086
-    {
1087
-        statsCollector.stop();
1088
-        statsCollector = null;
1089
-    }
1099
+    stopRTPStatsCollector();
1090 1100
     if(!onUnload) {
1091 1101
         startLocalRtpStatsCollector(connection.jingle.localAudio);
1092 1102
     }

Laden…
Annuleren
Opslaan