Name
MediaError — an <audio> or <video> error
Synopsis
When an error occurs on an <audio> or <video> tag, an error event is
triggered and the error property
is set to a MediaError object. The code property specifies what kind of error
occurred. The following constants define the values of that
property.
Constants
unsigned shortMEDIA_ERR_ABORTED= 1The user asked the browser to stop loading the media.
unsigned shortMEDIA_ERR_NETWORK= 2The media is of the right type, but a network error prevented it from being loaded.
unsigned shortMEDIA_ERR_DECODE= 3The media is of the right type, but an encoding error prevented it from being decoded and played.
unsigned shortMEDIA_ERR_SRC_NOT_SUPPORTED= 4The media specified by the
srcattribute is not a type that the browser can play.
Properties
readonly unsigned shortcodeThis property describes the type of media error that occurred. Its value will be one of the constants above.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access