Video playedProperty

Video 对象参考手册Video Object

Examples

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

var x = document.getElementById("myVideo");
document.getElementById("demo").innerHTML = "Start: " + x.played.start(0)
+ " End: " + x.played.end(0)

xThe output value is:

Start: 0 End: 2.162583

Try it Yourself »

Definition and Usage

The played property returns a TimeRanges object.

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

A played range refers to the time range of the video that has been played. If the user jumps in the video, multiple played ranges will be obtained.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the played property.

Note:Internet Explorer 8 or earlier browsers do not support this property.


Syntax

videoObject.played

Return Value

Type Description
TimeRanges object

Represents the played ranges of the video.

TimeRanges object properties:

  • length - Gets the number of played ranges in the 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 first played range is 0.



Video 对象参考手册Video Object Other extensions