Fixes issue with StatsCollector when the conference is recreated the peerconnection in the StatsCollector isn't updated.
This commit is contained in:
parent
cef26315c3
commit
a694d0fbdf
22
app.js
22
app.js
|
@ -469,7 +469,8 @@ function localStatsUpdated(statsCollector)
|
||||||
*/
|
*/
|
||||||
function startRtpStatsCollector()
|
function startRtpStatsCollector()
|
||||||
{
|
{
|
||||||
if (config.enableRtpStats && !statsCollector)
|
stopRTPStatsCollector();
|
||||||
|
if (config.enableRtpStats)
|
||||||
{
|
{
|
||||||
statsCollector = new StatsCollector(
|
statsCollector = new StatsCollector(
|
||||||
getConferenceHandler().peerconnection, 200, statsUpdated);
|
getConferenceHandler().peerconnection, 200, statsUpdated);
|
||||||
|
@ -479,6 +480,19 @@ function startRtpStatsCollector()
|
||||||
statsCollector.start();
|
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
|
* Starts the {@link LocalStatsCollector} if the feature is enabled in config.js
|
||||||
* @param stream the stream that will be used for collecting statistics.
|
* @param stream the stream that will be used for collecting statistics.
|
||||||
|
@ -1082,11 +1096,7 @@ function disposeConference(onUnload) {
|
||||||
}
|
}
|
||||||
handler.peerconnection.close();
|
handler.peerconnection.close();
|
||||||
}
|
}
|
||||||
if (statsCollector)
|
stopRTPStatsCollector();
|
||||||
{
|
|
||||||
statsCollector.stop();
|
|
||||||
statsCollector = null;
|
|
||||||
}
|
|
||||||
if(!onUnload) {
|
if(!onUnload) {
|
||||||
startLocalRtpStatsCollector(connection.jingle.localAudio);
|
startLocalRtpStatsCollector(connection.jingle.localAudio);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue