RTCVideoSourceStats: frames 屬性
RTCVideoSourceStats 字典中的 frames 屬性表示此影片源在其生命週期內產生的總幀數。
值
一個指示此源產生的總幀數的數字。
示例
此示例展示瞭如何迭代 RTCRtpSender.getStats() 返回的 stats 物件以獲取影片源統計資訊,然後提取 frames。
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;
規範
| 規範 |
|---|
| WebRTC 統計 API 的識別符號 # dom-rtcvideosourcestats-frames |
瀏覽器相容性
載入中…