HTML Audio/Video DOM suspendEvents
HTML Audio/Video DOM Reference Manual
Example
Display a prompt message when media data is blocked from loading:
var vid = document.getElementById("myVideo");
vid.onsuspend = function() {
alert("Media data loading was blocked");
};
vid.onsuspend = function() {
alert("Media data loading was blocked");
};
Definition and Usage
The suspend event is triggered when the browser deliberately does not load media data.
This event is triggered when media data is blocked from loading. It can be triggered after loading is complete, or because of the suspension reason.
Tip:Events affecting media data loading include:
Browser Support
The numbers in the table indicate the version number of the first browser that supported this event.
| Events | |||||
|---|---|---|---|---|---|
| suspend | Yes | 9.0 | Yes | Yes | Yes |
Syntax
In HTML:
<element onsuspend="myScript">
In JavaScript:
object.onsuspend=function(){myScript};
In JavaScript, using the addEventListener() method:
object.addEventListener("suspend", myScript);
Note:Internet Explorer 8 and earlier IE versions are not supported.addEventListener()method.
Technical Details
| Supported HTML tags: | <audio> and <video> |
|---|---|
| Supported JavaScript objects: | Audio, Video |
HTML Audio/Video DOM Reference Manualother extensions