Audio played attribute

Definition and Usage

played The property returns a TimeRanges object.

The TimeRanges object represents the audio range played by the user.

The playback range is the time range of the audio played. If there is a jump in the audio, the user will get several playback ranges.

Note:This property is read-only.

Example

Get the first playback range (partial) of the audio, in seconds:

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

Try it yourself

Grammar

audioObject.played

Return Value

Return Value Type
Description

TimeRanges Object

Represents the playing part of the audio.

  • TimeRanges Object Properties:
  • length - Get the number of play ranges in the audioindexstart(
  • ) - Get the start position of the play rangeindex) - Get the end position of the play range

Note:The first play range is index 0

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support