Representation of the WebRTC Statistics collection object.

import { WebRTCStats } from '@dolbyio/webrtc-stats';

const collection = new WebRTCStats({
getStatsInterval: 1000,
getStats: () => {
// TODO: return the statistics.
},
includeRawStats: false,
});

// The stats event is triggered after each interval has elapsed
collection.on('stats', (event: OnStats) => {
console.log(event);
});

// Start the statistics collection
collection.start();

Hierarchy

  • EventEmitter
    • WebRTCStats

Implements

Implemented by

Constructors

Methods

Constructors

Methods

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

    Type Parameters

    Parameters

    Returns this

    A reference to the EventEmitter, so that calls can be chained.

  • Starts the WebRTC statistics collection.

    Returns void

  • Stops the WebRTC statistics collection.

    Returns void