HTMLMediaElement.onerror

The onerror property of the HTMLMediaElement interface is the EventHandler for processing error events.

The error event fires when some form of error occurs while attempting to load or perform the media.

Syntax

HTMLMediaElement.onerror = EventListener;

Value

A function which serves as the event handler for the error event. When an error occurs, the specified function will be called. If null, no error handler is in effect.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'onerror' in that specification.
Living Standard

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onerrorChrome Full support YesEdge Full support 12Firefox Full support 3.5IE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support

See also