AudioDecoder: 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 AudioDecoder kích hoạt để báo hiệu AudioDecoder.decodeQueueSize đã giảm.
Điều này loại bỏ nhu cầu để nhà phát triển dùng thăm dò bằng setTimeout() nhằm xác định khi nào hàng đợi đã giảm 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 thuộc tính trình xử lý sự kiện.
js
addEventListener("dequeue", (event) => { })
ondequeue = (event) => { }
Ví dụ
js
audioDecoder.addEventListener("dequeue", (event) => {
// Đưa thêm công việc giải mã vào hàng đợi
});
Thông số kỹ thuật
| Specification |
|---|
| WebCodecs> # eventdef-audiodecoder-dequeue> |