HTML ondurationchange Attribute
Definition and Usage
The durationchange event occurs when the duration data of the specified audio/video is changed.
Note: 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 ondurationchange attribute is part of the Event Attributes, and can be used on the following elements:
Run "myFunction" when the audio is ready to start playing:
Run "myFunction" when the video is ready to start playing:
ondurationchange attribute has the following browser support for each element: