This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.


Overview Table

Synchronous No
Bubbles No
Target dom/Element
Cancelable No
Default action
## Examples

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>



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.


Standards information

Event handler parameters

pEvtObj [in]
Type: ****IHTMLEventObj****

See also

Related pages