durationchange
Overview Table
Synchronous | No |
---|---|
Bubbles | No |
Target | dom/Element |
Cancelable | No |
Default action |
The following example reads the total duration when the video is loaded and updates the current playback position as the video plays.
function timeUpdate()
{
document.getElementById('time').innerHTML = v1.currentTime;
}
function durationChange()
{
document.getElementById('duration').innerHTML = v1.duration;
}
<video id="v1" controls="true" autoplay="1" src="video.aac"
ontimeupdate="timeUpdate()" ondurationchange="durationChange()"/>
<div>Time: <span id="time">0</span> of <span id="duration">0</span> seconds.</div>
Notes
Remarks
Use the duration property to determine the new duration of the clip. This event occurs immediately after loadstart and before loadedmetadata. To invoke this event, do one of the following:
- Load a media resource.
Syntax
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.12
Event handler parameters
- pEvtObj [in]
- Type: ****IHTMLEventObj****
See also
Related pages
- audioElementaudioElement
- audioApiaudioApi
- DocumentDocument
- sourcesource
- videoElementvideoElement
- videoApivideoApi
- WindowWindow
Reference
- loadedmetadataloadedmetadata
- timeupdatetimeupdate
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]