getStats method
Implementation
@override
Future<List<StatsReport>> getStats([MediaStreamTrack? track]) async {
var stats;
if (track != null) {
var jsTrack = (track as MediaStreamTrackWeb).jsTrack;
stats = await jsutil.promiseToFuture<dynamic>(
jsutil.callMethod(_jsPc, 'getStats', [jsTrack]));
} else {
stats = await _jsPc.getStats();
}
var report = <StatsReport>[];
stats.forEach((key, value) {
report.add(
StatsReport(value['id'], value['type'], value['timestamp'], value));
});
return report;
}