Skip to content

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

Expose connection stats via external API

Hugo Lavernheb94a810ecf0d
diff --git a/modules/API/API.js b/modules/API/API.js
index c27f31f279..32f0f88e25 100755
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -1048,6 +1048,10 @@ function initCommands() {
titleText }));
break;
}
+ case 'connection-stats': {
+ callback(APP.conference.getStats());
+ break;
+ }
case 'deployment-info':
callback(APP.store.getState()['features/base/config'].deploymentInfo);
break;
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 60f7c1a6ef..7fae5e5351 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -776,6 +776,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
});
}
+ /**
+ * Returns the connection stats of the conference.
+ *
+ * @returns {Object} Connection stats (bitrate, packet loss, etc).
+ */
+ getConnectionStats() {
+ return this._transport.sendRequest({
+ name: 'connection-stats'
+ });
+ }
+
/**
* Returns whether the conference is P2P.
*