Audio playedProperty
Example
Get the first played range (in seconds) of the audio:
var x = document.getElementById("myAudio");
document.getElementById("demo").innerHTML = "Start: " + x.played.start(0)
+ " End: " + x.played.end(0)
document.getElementById("demo").innerHTML = "Start: " + x.played.start(0)
+ " End: " + x.played.end(0)
xThe output is:
Start: 0 End: 2.162583
Try it Yourself »
Definition and Usage
The played property returns a TimeRanges object.
The TimeRanges object represents the audio ranges that the user has played or seen.
The played range refers to the time ranges of the audio that have been played. If the user jumps around in the audio, multiple played ranges will be obtained.
Note:This property is read-only.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the played property.
Note:Internet Explorer 8 and earlier IE versions do not support this property.
Syntax
audioObject.played
Return Value
| Type | Description |
|---|---|
| TimeRanges object |
Represents the played ranges of the audio. Properties of the TimeRanges object:
Note:The index of the first played range is 0. |
Audio Object Other Extensions