webrtc-stats-gatherer
TypeScript icon, indicating that this package has built-in type declarations

9.0.8 • Public • Published

WebRTC Stats Gatherer

Greenkeeper badge

Build Status

Coverage Status

This module is designed to collect RTCPeerConnection stats on a regular interval and emit stats and trace data as appropriate.

Note that this project makes use of event emitting capabilities of RTCPeerConnection as opposed to a raw browser RTCPeerConnection.

API

constructor(peerConnection: RTCPeerConnection, opts: StatsGathererOpts)

interface StatsGathererOpts {
  session?: string;     // sessionId
  initiator?: string;
  conference?: string;  // conversationId
  interval?: number;    // interval, in seconds, at which stats are polled (default to 5)
  logger?: any;         // defaults to console
}

Usage

import StatsGatherer from 'webrtc-stats-gatherer';

const gatherer = new StatsGatherer(myPeerConnection);
gatherer.on('stats', (statsEvent) => doSomethingWithStats(statsEvent));

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i webrtc-stats-gatherer

    Weekly Downloads

    357

    Version

    9.0.8

    License

    MIT

    Unpacked Size

    75.6 kB

    Total Files

    12

    Last publish

    Collaborators

    • xdumaine
    • jensengar
    • purecloud