Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface MediaError

The MediaError interface represents an error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as

MDN Reference

interface MediaError {
    code: number;
    MEDIA_ERR_ABORTED: 1;
    MEDIA_ERR_DECODE: 3;
    MEDIA_ERR_NETWORK: 2;
    MEDIA_ERR_SRC_NOT_SUPPORTED: 4;
    message: string;
}
Index
code: number

The read-only property MediaError.code returns a numeric value which represents the kind of error that occurred on a media element. To get a text string with specific diagnostic information, see MediaError.message.

MDN Reference

MEDIA_ERR_ABORTED: 1
MEDIA_ERR_DECODE: 3
MEDIA_ERR_NETWORK: 2
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
message: string

The read-only property MediaError.message returns a human-readable string offering specific diagnostic details related to the error described by the MediaError object, or an empty string ("") if no diagnostic information can be determined or provided.

MDN Reference

Was this helpful?