English | 中文
A getStats API of peerconnection with Standardized and Legacy Non-Standard reports, and it will normalized the output.
For more APIs, see DOCS
getStats(peerconnection)
.then((originalReports: OriginalReports) => {
const reports: AudioInputReports = new AudioInputReports(originalReports);
console.log(reports.bytesReceived);
...
})
.catch(err => {
...
});getLegacyStats(peerconnection)
.then((originalReports: OriginalReports) => {
const reports: AudioInputLegacyReports = new AudioInputLegacyReports(originalReports);
console.log(reports.bytesReceived);
...
})
.catch(err => {
...
});