sinch-rtc
Version:
RTC JavaScript/Web SDK
31 lines • 877 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebRTCStats = void 0;
class WebRTCStats {
constructor() {
this.statsReport = new Map();
this.connectionInfos = [];
}
convertStatsReportToJSON() {
const statsReport = {};
this.statsReport.forEach((statsEntry, key) => {
statsReport[key] = statsEntry;
});
return JSON.stringify(statsReport);
}
getStats() {
const statsReport = {};
this.statsReport.forEach((statsEntry, key) => {
statsReport[key] = statsEntry;
});
return statsReport;
}
getStatsAsJson() {
if (this.statsReport.size === 0) {
return null;
}
return this.convertStatsReportToJSON();
}
}
exports.WebRTCStats = WebRTCStats;
//# sourceMappingURL=WebRTCStats.js.map