RTCVideoSourceStats: frames-Eigenschaft

Die frames-Eigenschaft des RTCVideoSourceStats-Wörterbuchs gibt die Gesamtzahl der Frames an, die von dieser Videoquelle während ihrer Lebensdauer stammen.

Wert

Eine Zahl, die die Gesamtanzahl der von dieser Quelle stammenden Frames angibt.

Beispiele

Dieses Beispiel zeigt, wie Sie das von RTCRtpSender.getStats() zurückgegebene Stats-Objekt durchlaufen könnten, um die Videoquellen-Statistiken zu erhalten und anschließend die frames zu extrahieren.

js
// where sender is an RTCRtpSender
const 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;

Spezifikationen

Specification
Identifiers for WebRTC's Statistics API
# dom-rtcvideosourcestats-frames

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
frames in 'media-source' stats for video

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support