VideoDecoder.VideoDecoder()
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
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();
Parameters
init-
A dictionary object containing two callbacks.
output-
A callback which takes a
VideoFrameobject as its only argument. error-
A callback which takes an
Errorobject as its only argument.
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
| Specification |
|---|
| WebCodecs # dom-videodecoder-videodecoder |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
VideoDecoder |
94 |
94 |
No |
No |
No |
No |
94 |
94 |
No |
No |
No |
No |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/VideoDecoder