RTCVideoSourceStats: frames property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Theframes property of theRTCVideoSourceStats dictionary indicates the total number of frames originating from this video source over its lifetime.
In this article
Value
A number indicating the total number of frames originating from this source.
Examples
This example shows how you might iterate the stats object returned fromRTCRtpSender.getStats() to get the video source stats, and then extract theframes.
js
// where sender is an RTCRtpSenderconst stats = await sender.getStats();let videoSourceStats = null;stats.forEach((report) => { if (report.type === "media-source" && report.kind==="video") { videoSourceStats = report; break; }});const frames = videoSourceStats?.frames;Specifications
| Specification |
|---|
| Identifiers for WebRTC's Statistics API> # dom-rtcvideosourcestats-frames> |