HTML Audio/Video DOM abortEvents

HTML Audio/Video DOM Reference Manual

Example

A popup message appears when video loading is terminated:

var vid = document.getElementById("myVideo");
vid.onabort = function() {
alert("The video has stopped loading");
};



Definition and Usage

The abort event is triggered when audio/video loading is terminated.

This event is triggered when the download of multimedia data is terminated, not when an error occurs.

Tip:Events that affect multimedia data loading include:


Browser Support

The numbers in the table indicate the version number of the first browser that supports this event.

Events
abort Yes 9.0 Yes Yes Yes

Note:Internet Explorer 11 on Windows 7 does not support the abort event.


Syntax

In HTML:

<element onabort="myScript">

In JavaScript:

object.onabort=function(){myScript};

In JavaScript, using the addEventListener() method:

object.addEventListener("abort", myScript);

Note:Internet Explorer 8 and earlier IE versions are not supportedaddEventListener()method.


Technical Details
Supported HTML tags: <audio> and <video>
Supported JavaScript objects: Audio, Video


HTML Audio/Video DOM Reference Manualother extensions