WebCodecs APIwindow_and_dedicated
The VideoDecoder() constructor creates a new VideoDecoder object with the provided init.output callback assigned as the output callback, the provided init.error callback as the error callback, and the VideoDecoder.state set to "unconfigured".
Syntax
new VideoDecoder(options)
Parameters
options- : An object containing two callbacks.
output- : A callback which takes a VideoFrame object as its only argument.
error- : A callback which takes an Error object as its only argument.
- : An object containing two callbacks.
Examples
In the following example a VideoDecoder is created with the two required callback functions, one to deal with the decoded frame and the other to handle errors.
const videoDecoder = new VideoDecoder({
output: processVideo,
error: onEncoderError,
});
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
