oncanplaythrough event
Examples
JavaScript is executed when the video plays correctly and without pause:
<Video oncanplaythrough = "myFunction ()">
try it"
Bottom of this article contains more examples.
Definition and Usage
Oncanplaythrough trigger event can play in normal video / audio (audio / video) and without pause and buffer.
In the video / audio (audio / video) loading process, triggering the sequence of events is as follows:
- onloadstart
- ondurationchange
- onloadedmetadata
- onloadeddata
- onprogress
- oncanplay
- oncanplaythrough
Browser Support
Figures in the table represent the first browser to support this version of events.
event | |||||
---|---|---|---|---|---|
oncanplaythrough | Yes | 9.0 | Yes | Yes | Yes |
grammar
In HTML:
<Elementoncanplaythrough = "myScript"> try
In JavaScript:
object .oncanplaythrough = function () {myScript }; try
JavaScript, use the addEventListener () method:
object .addEventListener ( "canplaythrough", myScript ); try
Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.
technical details
Whether to support the bubble: | No |
---|---|
It can be canceled: | No |
Event Type: | Event |
Supported HTML tags: | <Audio>, <video> |
More examples
Examples
The audio plays correctly and without pause when JavaScript is executed:
<Audio oncanplaythrough = "myFunction ()">
try it"
Event objects