Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

durationchange | ondurationchange event

Occurs when the duration attribute is updated.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.12Internet Explorer 9

 

Syntax

HTML Attribute <element ondurationchange = "handler(event)">
Event Property object.ondurationchange = handler;
addEventListener Method object.addEventListener("durationchange", handler, useCapture)

 

Event information

SynchronousNo
BubblesNo
CancelableNo

 

Event handler parameters

handler [in]

Type: function

Event handler object.

Standards information

Remarks

Use the duration property to determine the new duration of the clip.

This event occurs immediately after onloadstart and before onloadedmetadata.

To invoke this event, do one of the following:

  • Load a media resource.

Examples

This example follows the durationchange event and displays a mute button image when the volume is muted. The complete example displays a number of media events.


video.addEventListener("durationchange", function () {
  document.getElementById("dc").textContent = "Duration has changed";
}, false);


See also

audio
audio
document
source
video element
video object
window
Reference
onloadedmetadata
ontimeupdate

 

 

Show:
© 2015 Microsoft