Thuộc tính lỗi DOM Audio / Video HTML
❮ Tham chiếu DOM Audio / Video HTML
Thí dụ
Nhận trạng thái lỗi của video:
var vid = document.getElementById("myVideo");
alert(vid.error.code);
Định nghĩa và Cách sử dụng
Thuộc tính lỗi trả về một đối tượng MediaError.
Đối tượng MediaError có thuộc tính mã chứa trạng thái lỗi của âm thanh / video.
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
error | Not supported | 9.0 | Not supported | Not supported | Not supported |
Cú pháp
audio|video.error.code
Giá trị trả lại
Type | Description |
---|---|
Number | The code property of the MediaError Object returns a number representing the error state of the audio/video:
|
❮ Tham chiếu DOM Audio / Video HTML