onsuspend event
Definition and usage
The onsuspend event occurs when the browser deliberately does not retrieve media data.
This event occurs when the media loading is paused (prevented from continuing). It may occur when the download is completed or paused for some reason.
Tip:The related events that occur when there is some interference in the media loading process are:
Example
Execute JavaScript when the browser deliberately does not retrieve media data:
<video onsuspend="myFunction()">
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 or earlier versions do not support addEventListener() method.
Technical details
Bubble: | Not supported |
---|---|
Can be canceled: | Not supported |
Event Type: | Event |
Supported HTML Tags: | <audio> and <video> |
DOM Version: | Level 3 Events |
Browser Support
The numbers in the table indicate the first browser version that fully supports the event.
Events | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
onsuspend | Support | 9.0 | Support | Support | Support |