Home  >  Article  >  Web Front-end  >  html5 returns the error attribute of a MediaError object

html5 returns the error attribute of a MediaError object

黄舟
黄舟Original
2017-11-08 14:04:014847browse

Example

Get the error of VideoStatus:

myVid=document.getElementById("video1");
alert(myVid.error.code);

Definition and usage

error PropertiesReturn a MediaError object.

The code attribute of the MediaError object contains the error status of audio/video.

Browser support

Only Internet Explorer 9 supports the error attribute.

Syntax

audio|video.error.code

Return value

Type Description
Numeric value

The code attribute of the MediaError object returns a numeric value, which represents the error status of the audio/video:

  • 1 = MEDIA_ERR_ABORTED - Retrieval process Aborted by user

  • 2 = MEDIA_ERR_NETWORK - An error occurred while downloading

  • 3 = MEDIA_ERR_DECODE - An error occurred while decoding

  • 4 = MEDIA_ERR_SRC_NOT_SUPPORTED - Audio/Video not supported


##

The above is the detailed content of html5 returns the error attribute of a MediaError object. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn