// where sender is an RTCRtpSender
const stats = await sender.getStats();
let videoSourceStats = null;
for (const report of stats.values()) {
if (report.type === "media-source" && report.kind === "video") {
videoSourceStats = report;
break;
}
}
// videoSourceStats will be null if the report did not include video source stats
const frames = videoSourceStats?.frames;
const fps = videoSourceStats?.framesPerSecond;
const width = videoSourceStats?.width;
const height = videoSourceStats?.height;RTCVideoSourceStats / notebook
RTCVideoSourceStats
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.