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

HTML DOM Video played Property

Video played property

Video Object Reference The Video object

Example

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

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

document.getElementById("demo").innerHTML = "Start: " + x.played.start(0)

xOutput value:

Start: 0 End: 2.162583

Try it »


Definition and Usage

The played attribute returns a TimeRanges object.

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

The played range refers to the time range of the played video. If the user jumps within 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 attribute.


Syntax

videoObject

.played

Return Value

Type Description
TimeRanges Object

Represents the played range of the video.

TimeRanges object properties:

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

    |

    Video Object Reference The Video object