---
title: "MediaError | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/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

or .

[MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaError)

interface MediaError {  
    [code](#code): number;  
    [MEDIA\_ERR\_ABORTED](#media_err_aborted): 1;  
    [MEDIA\_ERR\_DECODE](#media_err_decode): 3;  
    [MEDIA\_ERR\_NETWORK](#media_err_network): 2;  
    [MEDIA\_ERR\_SRC\_NOT\_SUPPORTED](#media_err_src_not_supported): 4;  
    [message](#message): string;  
}

##### Index

### Properties[](#properties)

[code](#code) [MEDIA\_ERR\_ABORTED](#media_err_aborted) [MEDIA\_ERR\_DECODE](#media_err_decode) [MEDIA\_ERR\_NETWORK](#media_err_network) [MEDIA\_ERR\_SRC\_NOT\_SUPPORTED](#media_err_src_not_supported) [message](#message)

## Properties[](#properties-1)

### `Readonly`code[](#code)

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](https://developer.mozilla.org/docs/Web/API/MediaError/code)

### `Readonly`MEDIA\_ERR\_ABORTED[](#media_err_aborted)

MEDIA\_ERR\_ABORTED: 1

### `Readonly`MEDIA\_ERR\_DECODE[](#media_err_decode)

MEDIA\_ERR\_DECODE: 3

### `Readonly`MEDIA\_ERR\_NETWORK[](#media_err_network)

MEDIA\_ERR\_NETWORK: 2

### `Readonly`MEDIA\_ERR\_SRC\_NOT\_SUPPORTED[](#media_err_src_not_supported)

MEDIA\_ERR\_SRC\_NOT\_SUPPORTED: 4

### `Readonly`message[](#message)

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](https://developer.mozilla.org/docs/Web/API/MediaError/message)
