Represents the parsed WebRTC statistics collected.

interface OnStats {
    availableIncomingBitrate?: number;
    availableOutgoingBitrate?: number;
    currentRoundTripTime?: number;
    input: AudioVideoCollect<InputAudio, InputVideo>;
    output: AudioVideoCollect<OutputAudio, OutputVideo>;
    rawStats?: RTCStatsReport;
    responsesReceived?: number;
    timestamp: string;
    totalRoundTripTime?: number;
}

Properties

availableIncomingBitrate?: number

It is calculated by the underlying congestion control by combining the available bitrate for all the incoming RTP streams using this candidate pair. The bitrate measurement does not count the size of the IP or other transport layers like TCP or UDP. It is similar to the TIAS defined in [RFC3890], i.e., it is measured in bits per second and the bitrate is calculated over a 1 second window.

availableOutgoingBitrate?: number

It is calculated by the underlying congestion control by combining the available bitrate for all the outgoing RTP streams using this candidate pair. The bitrate measurement does not count the size of the IP or other transport layers like TCP or UDP. It is similar to the TIAS defined in [RFC3890], i.e., it is measured in bits per second and the bitrate is calculated over a 1 second window.

currentRoundTripTime?: number

Represents the latest round trip time measured in seconds, computed from both STUN connectivity checks [STUN-PATH-CHAR], including those that are sent for consent verification [RFC7675].

List of audio & video input statistics.

List of audio & video output statistics.

rawStats?: RTCStatsReport

Raw statistics, if includeRawStats is set to true in the collection options.

responsesReceived?: number

Represents the total number of connectivity check responses received.

timestamp: string

Gets the time at which the statistics were collected as a string value in ISO format.

totalRoundTripTime?: number

Represents the sum of all round trip time measurements in seconds since the beginning of the session, based on STUN connectivity check [STUN-PATH-CHAR] responses (responsesReceived), including those that reply to requests that are sent in order to verify consent [RFC7675]. The average round trip time can be computed from totalRoundTripTime by dividing it by responsesReceived.