Thuộc tính lỗi âm thanh
Thí dụ
Nhận trạng thái lỗi của âm thanh:
var x = document.getElementById("myAudio").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.
Lưu ý: Thuộc tính này là chỉ đọc.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
error | Not supported | 9.0 | Not supported | Not supported | Not supported |
Cú pháp
audioObject.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:
|
❮ Đối tượng âm thanh