English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

Comprehensive list of HTML tags

HTML Audio/Video DOM abort event

The abort event was triggered when the resource was not fully loaded, but not due to an error.

HTML Audio/Video DOM Reference Manual

Online example

A prompt message pops up when the video loading is terminated:

var vid = document.getElementById("myVideo");
vid.onabort = function() {
 alert("Video load aborted");
};

Definition and usage

When audio/An abort event occurs when the video loading is interrupted.
This event occurs when media data download is aborted, not due to an error.

Tip: Events affecting multimedia data loading include:

Browser compatibility

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

event




abortYes9.0YesYesYes

Note:Windows 7 in Internet Explorer 11 The abort event is not supported.

Syntax

In HTML:

<element onabort="myScript">

In JavaScript:

object.onabort=function(){myScript};

In JavaScript, use the addEventListener() method:

object.addEventListener("abort", myScript);

Note: Internet Explorer 8 and earlier IE versions do not support addEventListener() Methods.

Technical Details

Supported HTML Tags:<audio> and <video>
Supported JavaScript Objects:Audio, Video


HTML Audio/Video DOM Reference Manual