VideoEncoder: dequeue event

Limited availability

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

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.

Sự kiện dequeue của giao diện VideoEncoder kích hoạt để báo hiệu sự giảm xuống của VideoEncoder.encodeQueueSize.

Điều này loại bỏ nhu cầu các nhà phát triển sử dụng vòng lặp setTimeout() để xác định khi nào hàng đợi đã giảm xuống và nên đưa thêm công việc vào hàng đợi.

Cú pháp

Sử dụng tên sự kiện trong các phương thức như addEventListener(), hoặc đặt một thuộc tính xử lý sự kiện.

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

ondequeue = (event) => { }

Ví dụ

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

Thông số kỹ thuật

Specification
WebCodecs
# dom-videodecoder-ondequeue

Tương thích trình duyệt