ondurationchange event
Examples
JavaScript is executed when a change in the length of the video:
try it"
Bottom of this article contains more examples.
Definition and Usage
ondurationchange event video / audio (audio / video) Duration trigger change.
Note: When the video / audio (audio / video) has been loaded, the video / audio (audio / video) the length of time from the "NaN" is modified to the length of time.
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 | |||||
---|---|---|---|---|---|
ondurationchange | Yes | 9.0 | Yes | Yes | Yes |
grammar
In HTML:
In JavaScript:
JavaScript, use the addEventListener () method:
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
Executed when the audio starts loading JavaScript:
try it"
Event objects