W3cubDocs

/Web APIs

MediaError

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.

Instance properties

This interface doesn't inherit any properties.

MediaError.code

A number which represents the general type of error that occurred.

MediaError.message

A human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't 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 ("").

Instance methods

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
MediaError 3 12 43.5–4 9 ≤12.1 3.1 ≤37 18 4 ≤12.1 2 1.0
code 3 12 3.5 9 ≤12.1 3.1 ≤37 18 4 ≤12.1 2 1.0
message 59 79 52 No 46 15 59 59 52 43 15 7.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaError