WebCodecs APIwindow_and_dedicated
The reset() method of the VideoEncoder interface synchronously cancels all pending encodes and callbacks, frees all underlying resources and sets the VideoEncoder.state to "unconfigured".
After calling reset(), VideoEncoder.configure() must be called before resuming VideoEncoder.encode() calls.
[!NOTE] To avoid discarding frames queued via VideoEncoder.encode(), VideoEncoder.flush() should be called and completed before calling
reset().
Syntax
reset()
Parameters
None.
Return value
None (undefined).
Exceptions
InvalidStateErrorDOMException- : Thrown if the VideoEncoder.state is
"closed".
- : Thrown if the VideoEncoder.state is
Examples
The following example resets the VideoEncoder.
VideoEncoder.reset();
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
