Web/API/MediaError

From Get docs

The MediaError interface represents an error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as <audio> or <video>.

A MediaError object describes the error in general terms using a numeric code categorizing the kind of error, and a message, which provides specific diagnostics about what went wrong.

Properties

This interface doesn't inherit any properties.

MediaError.code
A number which represents the general type of error that occurred, as follows:
Name Value Description
MEDIA_ERR_ABORTED 1 The fetching of the associated resource was aborted by the user's request.
MEDIA_ERR_NETWORK 2 Some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available.
MEDIA_ERR_DECODE 3 Despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.
MEDIA_ERR_SRC_NOT_SUPPORTED 4 The associated resource or media provider object (such as a MediaStream) has been found to be unsuitable.
MediaError.message
A DOMString object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic information to help in understanding what exactly went wrong. This text and its format is not defined by the specification and will vary from one user agent to another. If no diagnostics are available, or no explanation can be provided, this value is an empty string ("").

Methods

This interface doesn't implement or inherit any methods, and has none of its own.

Specifications

Specification Status Comment
HTML Living StandardThe definition of 'MediaError' in that specification. Living Standard  

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
MediaError Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 3.5

IE

Full support 9

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

code Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 3.5

IE

Full support 9

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

message Chrome

Full support 59

Edge

Full support ≤79

Firefox

Full support 52

IE

No support No

Opera

Full support 46

Safari

?

WebView Android

Full support 59

Chrome Android

Full support 59

Firefox Android

Full support 52

Opera Android

Full support 43

Safari iOS

?

Samsung Internet Android

Full support 7.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown


See also