Events triggered by the WebRTCStats object.
Event triggered when an error is triggered by this library.
The reason of the error.
import { WebRTCStats } from '@dolbyio/webrtc-stats';const collection = new WebRTCStats({ getStatsInterval: 1000, getStats: () => { // TODO: return the statistics. },});collection.on('error', (reason: string) => { // An error has been triggered console.error(reason);}); Copy
import { WebRTCStats } from '@dolbyio/webrtc-stats';const collection = new WebRTCStats({ getStatsInterval: 1000, getStats: () => { // TODO: return the statistics. },});collection.on('error', (reason: string) => { // An error has been triggered console.error(reason);});
Event triggered when the statistics are available.
The OnStats object that contains the collected WebRTC statistics.
import { WebRTCStats, OnStats } from '@dolbyio/webrtc-stats';const collection = new WebRTCStats({ getStatsInterval: 1000, getStats: () => { // TODO: return the statistics. },});collection.on('stats', (stats: OnStats) => { // The statistics are available console.log(stats);}); Copy
import { WebRTCStats, OnStats } from '@dolbyio/webrtc-stats';const collection = new WebRTCStats({ getStatsInterval: 1000, getStats: () => { // TODO: return the statistics. },});collection.on('stats', (stats: OnStats) => { // The statistics are available console.log(stats);});
Events triggered by the WebRTCStats object.