VideoEncoder: dequeue event

Limited availability

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

Want more browser support for this feature? Tell us why.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Dedicated Web Workers.

The dequeue event of the VideoEncoder interface fires to signal a decrease in VideoEncoder.encodeQueueSize.

This eliminates the need for developers to use a setTimeout() poll to determine when the queue has decreased, and more work should be queued up.

Syntax

Use the event name in addEventListener():

js
addEventListener("dequeue", (event) => { })

Alternatively, assign to the event handler property of the interface:

js
ondequeue = (event) => { }

Example

js
videoEncoder.addEventListener("dequeue", (event) => {
  // Queue up more encoding work
});

Specifications

Specification
WebCodecs
# dom-videodecoder-ondequeue

Browser compatibility