HTML Audio/Video DOM Reference
Alert that the duration of the video has changed:
The durationchange event occurs when the duration data of the specified audio/video is changed.
When an audio/video is loaded, the duration will change from "NaN" to the actual duration of the audio/video.
During the loading process of an audio/video, the following events occur, in this order:
![]()
The durationchange event is supported in all major browsers.
Note: This property is not supported in Internet Explorer 8 and earlier.
In HTML:
In JavaScript:
Using addEventListener():
| Supported HTML tags: | <audio>, <video> |
|---|---|
| Supported JavaScript objects: | Audio, Video |
Use the ondurationchange attribute on an HTML element
Use addEventListener() to listen for the durationchange event
HTML Audio/Video DOM Reference
Your message has been sent to W3Schools.