HTML DOM Video error Property
Example
Get the error state of the video:
var x = document.getElementById("myVideo").error.code;
Definition and Usage
The error property returns a MediaError object.
The code property of the MediaError object contains the error state of the audio/video.
Note: This property is read-only.
Browser Support
The error property is supported only in Internet Explorer.
Note: Internet Explorer 8 and earlier versions do not support this element.
Syntax
videoObject.error.code
Return Value
| Type | Description |
|---|---|
| Number | The code property of the MediaError object returns a number value that represents the error state of the audio/video: * 1 = MEDIA_ERR_ABORTED - The fetching of the media resource was aborted by the user agent at the user's request. * 2 = MEDIA_ERR_NETWORK - A network error occurred while fetching the media resource. * 3 = MEDIA_ERR_DECODE - An error occurred while decoding the media resource. * 4 = MEDIA_ERR_SRC_NOT_SUPPORTED - The media resource is not supported. |
YouTip