Options to configure the WebRTC statistics collection.

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

const collection = new WebRTCStats({
getStatsInterval: 1000,
getStats: () => {
// TODO: return the statistics.
},
includeRawStats: true,
});
interface WebRTCStatsOptions {
    getStats: (() => Promise<RTCStatsReport>);
    getStatsInterval?: number;
    includeRawStats?: boolean;
}

Properties

getStats: (() => Promise<RTCStatsReport>)

Function that will be called to retrieve the WebRTC statistics.

Type declaration

getStatsInterval?: number

Interval, in milliseconds, at which to collect the WebRTC statistics. Default is 1,000 ms (1 second).

includeRawStats?: boolean

Include the raw statistics in the stats event. Default is false.