Getting information about a stream

In this guide you will learn to collect diagnostic stats concerning active streams.

To get audio and video statistics for subscribers, add event handlers for the audioNetworkStats and videoNetworkStats event dispatched by the OTSubscriber. These provide information about the subscriber's stream, including the following:

  • The total number of audio and video packets lost.
  • The total number of audio and video packets received.
  • The total number of audio and video bytes received.
  • The current average video frame rate.

To get more detailed stream statistics, use the Subscriber.getRtcStatsReport() method of the OTSubscriber object. It returns a promise that, on success, resolves with a JSON representation of an RtcStatsReport object for the subscribed stream: