MediaError
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheMediaError interface represents an error which occurred while handling media in an HTML media element based onHTMLMediaElement, such as<audio> or<video>.
AMediaError object describes the error in general terms using a numericcode categorizing the kind of error, and amessage, which provides specific diagnostics about what went wrong.
In this article
Instance properties
This interface doesn't inherit any properties.
MediaError.codeA number which representsthe general type of error that occurred.
MediaError.messageA human-readable string which providesspecific 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 oneuser 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
| Specification |
|---|
| HTML> # error-codes> |