Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

hristoterezova694d0fbdfa1
diff --git a/app.js b/app.js
index 360a8f91c3..93ec610358 100644
--- a/app.js
+++ b/app.js
@@ -469,7 +469,8 @@ function localStatsUpdated(statsCollector)
*/
function startRtpStatsCollector()
{
- if (config.enableRtpStats && !statsCollector)
+ stopRTPStatsCollector();
+ if (config.enableRtpStats)
{
statsCollector = new StatsCollector(
getConferenceHandler().peerconnection, 200, statsUpdated);
@@ -479,6 +480,19 @@ function startRtpStatsCollector()
statsCollector.start();
}
}
+
+/**
+ * Stops the {@link StatsCollector}.
+ */
+function stopRTPStatsCollector()
+{
+ if (statsCollector)
+ {
+ statsCollector.stop();
+ statsCollector = null;
+ }
+}
+
/**
* Starts the {@link LocalStatsCollector} if the feature is enabled in config.js
* @param stream the stream that will be used for collecting statistics.
@@ -1082,11 +1096,7 @@ function disposeConference(onUnload) {
}
handler.peerconnection.close();
}
- if (statsCollector)
- {
- statsCollector.stop();
- statsCollector = null;
- }
+ stopRTPStatsCollector();
if(!onUnload) {
startLocalRtpStatsCollector(connection.jingle.localAudio);
}