RTCVideoSourceStats: height-Eigenschaft

Die height-Eigenschaft des RTCVideoSourceStats Wörterbuchs gibt die Höhe, in Pixeln, des letzten Frames an, der von dieser Quelle stammt.

Diese Eigenschaft wird im Statistikobjekt erst nach der Erzeugung des ersten Frames definiert.

Wert

Eine positive Zahl, die die Höhe in Pixeln angibt.

Beispiele

Dieses Beispiel zeigt, wie Sie durch das Statistikobjekt, das von RTCRtpSender.getStats() zurückgegeben wird, iterieren können, um die Videoquellenstatistiken zu erhalten und dann die height 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;
  }
});

// Note, test is conditional in case the stats object
// does not include video source stats
const height = videoSourceStats?.height;

Spezifikationen

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

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
height 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