Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM played Property

HTML Audio/Video DOM played Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

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

myVid=document.getElementById("video1");

alert("Start: " + myVid.played.start(0)

Try it »


Definition and Usage

The played attribute returns a TimeRanges object.

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

A played range refers to the time range of the audio/video that has been played. If the user jumps around in the audio/video, multiple played ranges are obtained.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the played attribute.

**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.

TimeRanges object properties:

  • length - Gets 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
  • Note:The index of the first played range index is 0.

    |

    HTML audio/video Tag Reference HTML Audio/Video DOM Reference