YouTip LogoYouTip

Prop Video Error

HTML DOM Video error Property

HTML DOM Video error Property

Video Object Reference

Example

Get the error state of the video:

var x = document.getElementById("myVideo").error.code;

Try it Yourself Β»


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

Internet Explorer Firefox Opera Google Chrome Safari

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.

Video Object Reference

← Prop Video LoopProp Video Error β†’