Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM suspend Event

HTML Audio/Video DOM suspend Event

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Display a message when media data loading is suspended:

var vid = document.getElementById("myVideo");

vid.onsuspend = function() {

    alert("Media data loading suspended");

};


Definition and Usage

The suspend event is triggered when the browser deliberately stops loading media data.

This event is triggered when media data loading is suspended. It can be triggered after loading is complete, or because it was paused.

Tip: Events that affect the loading of media data include:


Browser support

The numbers in the table indicate the version number of the first browser to support the event.

Events
suspend Yes 9.0 Yes Yes Yes

Syntax

In HTML:

<

element

onsuspend="

myScript

">

In JavaScript:

object

.onsuspend=function(){

myScript

};

In JavaScript, use the addEventListener() method:

object

.addEventListener("suspend",

myScript

);

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


Technical Details

Supported HTML tags:
Supported JavaScript objects: Audio, Video

HTML audio/video Tag Reference HTML Audio/Video DOM Reference