HTML Audio/Video DOM error Property
HTML Audio/Video DOM Reference
Example
Get the error state of the video:
myVid=document.getElementById("video1");
alert(myVid.error.code);
Try it »
Definition and Usage
The error attribute returns a MediaError object.
The code attribute of the MediaError object contains the error status of the audio/video.
Browser support





Only Internet Explorer 9 supports the error property.
Syntax
audio|video
.error.code
Return Value
| Type | Description |
|---|---|
| Number | The code property of the MediaError object returns a numeric value representing the error state of the audio/video:
|
HTML Audio/Video DOM Reference