Live Media Statistics

For debugging purposes, you can get the live statistics of each stream (local or remote) you are playing at any endpoint. The following information for each stream is displayed using an overlay over the respective player:

For Local Streams:

  • Transmission Bandwidth
  • Video Resolution

For Subscribed Streams:

  • Receiving Bandwidth

  • Video Resolution

  • Available Bandwidth for Remote User

  • Packet Loss

  • Method: enableStats (isEnabled)

  • Parameters:

    • isEnabled: Boolean. Set it to true to enable streaming statistics.
      Set it to false to disable statistics.
  • Event Listeners:

    • onAcknowledgeStats : Notification to the user when the streaming stats are enabled successfully.
    • onReceivedStats : Notification to the user When all streaming stats are received.
    • onPlayerStats : Notification to the user When player's stream stats is received.

Sample Code

// To enable stats
window.EnxRtc.enableStats(true);
// Add Event Listener: Stream Stats is enabled/disabled
window.EnxRtc.addEventListner("onAcknowledgeStats", function(data) {
console.log(JSON.stringify(data.data));
});
// Add Event Listener: All Stream Stats received
window.EnxRtc.addEventListner("onReceivedStats",function (data) {
console.log(JSON.stringify(data.data));
});
// Add Event Listener: Player Stream Stats received
window.EnxRtc.addEventListner("onPlayerStats",function (data)
{
console.log(JSON.stringify(data.data));
});