Advertisement
Home Open Editor ❯

HTML Audio/Video DOM played Property

Example

var vid = document.getElementById("myVideo");

function myFunction() {
  alert("Start: " + vid.played.start(0) + " End: "  + vid.played.end(0));
}

Try this code ❯

Meaning

The played property returns a TimeRanges object representing the played parts of the audio/video.

Note: The first played range is index 0.


Standard Syntax

audio|video.played


Advertisement

Return Value

Type Description
TimeRanges Object Returns the played parts of the audio/video.

TimeRanges Object Properties:

  • length: get the number of played ranges in the audio/video.
  • start(index): get the start position of a played range.
  • end(index): get the end position of a played range.
Home Open Editor ❯
Advertisement