Dolby.io WebRTC Statistics - v1.0.4
    Preparing search index...

    Type Alias WebRTCStatsEvents

    Events triggered by the WebRTCStats object.

    type WebRTCStatsEvents = {
        error(reason: string): void;
        stats(stats: OnStats): void;
    }
    Index

    Methods

    Methods

    • Event triggered when an error is triggered by this library.

      Parameters

      • reason: string

        The reason of the error.

      Returns void

      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.

      Parameters

      • stats: OnStats

        The OnStats object that contains the collected WebRTC statistics.

      Returns void

      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);
      });