Skip to content

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

raw JSON format without intermediate steps

Philipp Hanckead370750740e
diff --git a/app.js b/app.js
index 1a811351ab..5676615e6f 100644
--- a/app.js
+++ b/app.js
@@ -513,13 +513,15 @@ function dump(elem, filename){
var session = connection.jingle.sessions[sid];
if (session.peerconnection && session.peerconnection.updateLog) {
// FIXME: should probably be a .dump call
+ /* well, if I need to modify the output format anyway...
var stats = JSON.parse(JSON.stringify(session.peerconnection.stats));
Object.keys(stats).forEach(function (name) {
stats[name].values = JSON.stringify(stats[name].values);
});
+ */
data["jingle_" + session.sid] = {
updateLog: session.peerconnection.updateLog,
- stats: stats,
+ stats: session.peerconnection.stats),
url: window.location.href}
;
}
diff --git a/libs/strophejingle.bundle.js b/libs/strophejingle.bundle.js
index 215da23a50..6cc916b418 100644
--- a/libs/strophejingle.bundle.js
+++ b/libs/strophejingle.bundle.js
@@ -64,6 +64,9 @@ function TraceablePeerConnection(ice_config, constraints) {
self.ondatachannel(event);
}
}
+ // FIXME: is it a good idea to automatically start it here?
+ this.statsinterval = null;
+
this.maxstats = 600; // limit to 600 values, i.e. 10 minutes
this.statsinterval = window.setInterval(function() {
self.peerconnection.getStats(function(stats) {
@@ -148,6 +151,10 @@ TraceablePeerConnection.prototype.setRemoteDescription = function (description,
TraceablePeerConnection.prototype.close = function () {
this.trace('stop');
+ if (this.statsinterval !== null) {
+ window.clearInterval(this.statsinterval);
+ this.statsinterval = null;
+ }
this.peerconnection.close();
};
@@ -205,7 +212,6 @@ TraceablePeerConnection.prototype.getStats = function(callback) {
this.peerconnection.getStats(callback);
};
-
// mozilla chrome compat layer -- very similar to adapter.js
function setupRTC() {
var RTC = null;