Easy Tutorial
❮ Ev Onkeyup Att Base Href ❯

HTML Audio/Video DOM durationchange Event

HTML Audio/Video DOM Reference Manual

Example

Alerts the user that the duration of the video has changed:


Definition and Usage

The durationchange event occurs when the duration data of the specified audio/video changes.

After the audio/video is loaded, the duration changes from "NaN" to the actual duration of the audio/video.

During the loading process of the audio/video, the following events occur in sequence:


Browser Support

All major browsers support the durationchange event.

Note: Internet Explorer 8 and earlier versions do not support this event.


Syntax

In HTML:

In JavaScript:

Using addEventListener():

Technical Details

Supported HTML Tags: <audio>, <video>
Supported JavaScript Objects: Audio, Video
--- ---

More Examples

Using the ondurationchange attribute on HTML elements

Using addEventListener() to listen for the durationchange event


❮ Ev Onkeyup Att Base Href ❯