VideoDecoder: sự kiện dequeue
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 VideoDecoder kích hoạt để báo hiệu sự giảm xuống của VideoDecoder.decodeQueueSize.
Điều này giúp các nhà phát triển không cần sử dụng vòng lặp setTimeout() để xác định khi nào hàng đợi đã giảm và cần 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 thuộc tính xử lý sự kiện.
js
addEventListener("dequeue", (event) => { })
ondequeue = (event) => { }
Ví dụ
js
videoDecoder.addEventListener("dequeue", (event) => {
// Queue up more encoding work
});
Thông số kỹ thuật
| Specification |
|---|
| WebCodecs> # eventdef-videodecoder-dequeue> |