HTML Audio/Video DOMplayedProperty

HTML Audio/Video DOM Reference Manual

Example

Get the first played range (part) of the video, in seconds:

myVid=document.getElementById("video1");
alert("Start: " + myVid.played.start(0)
+ " End: " + myVid.played.end(0));

Try it Yourself »

Definition and Usage

The played property returns a TimeRanges object.

The TimeRanges object represents the audio/video ranges that the user has played or seen.

Played ranges refer to the time ranges of the audio/video that has been played. If the user jumps in the audio/video, multiple played ranges will be obtained.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the played property.

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


Syntax

audio|video.played

Return Value

Type Description
TimeRanges Object Represents the played ranges of the audio/video.

Properties of the TimeRanges object:

  • length - Gets the number of played ranges in the audio/video.
  • start(index) - Gets the start position of a played range.
  • end(index) - Gets the end position of a played range.

Note:The index of the played range in the first segmentindexis 0.



HTML Audio/Video DOM Reference Manualother extensions