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 GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.