此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

EncodedVideoChunk:byteLength 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

备注: 此特性在专用 Web Worker中可用。

EncodedVideoChunk 接口的只读属性 byteLength 返回编码视频数据的字节长度。

整型。

示例

以下示例将 byteLength 打印到控制台。

js
const init = {
  type: "key",
  data: videoBuffer,
  timestamp: 23000000,
  duration: 2000000,
};
const chunk = new EncodedVideoChunk(init);

console.log(chunk.byteLength); // 352800

规范

Specification
WebCodecs
# dom-encodedvideochunk-bytelength

浏览器兼容性