Skip to content

Output a universal API for getStats of RTCPeerConnection discard different kind of browsers. 一个屏蔽了不同浏览器,为快速获取 RTCPeerConnection 统计数据提供了通用的 getStats 方法的库。

Notifications You must be signed in to change notification settings

poplark/peerconnection-stats

Repository files navigation

Peerconnection getStats API

pipeline status coverage report

English | 中文

A getStats API of peerconnection with Standardized and Legacy Non-Standard reports, and it will normalized the output.

Examples

For more APIs, see DOCS

getStats

getStats(peerconnection)
  .then((originalReports: OriginalReports) => {
    const reports: AudioInputReports = new AudioInputReports(originalReports);
    console.log(reports.bytesReceived);
    ...
  })
  .catch(err => {
    ...
  });

getLegacyStats

getLegacyStats(peerconnection)
  .then((originalReports: OriginalReports) => {
    const reports: AudioInputLegacyReports = new AudioInputLegacyReports(originalReports);
    console.log(reports.bytesReceived);
    ...
  })
  .catch(err => {
    ...
  });

About

Output a universal API for getStats of RTCPeerConnection discard different kind of browsers. 一个屏蔽了不同浏览器,为快速获取 RTCPeerConnection 统计数据提供了通用的 getStats 方法的库。

Resources

Stars

Watchers

Forks

Packages

No packages published