DOM Properties
HTMLMediaElement.played
TimeRanges snapshot of intervals already played, not simply elapsed wall-clock time. Seeking can create gaps. If a user jumps ahead, the skipped region is not automatically marked as played. Iterate start(i) and end(i) over every interval to inspect actual media positions visited during playback. Example result: 0.
Formal Syntax & Structure
html syntaxhtml
media.playedReturn Value
TimeRanges
A static normalized TimeRanges object describing played intervals.
Working Example
Example Snippethtml
<p> Result: <output id="result"></output></p><script> const result = document.getElementById("result"); (async () => { const media = document.createElement("audio"); document.body.append(media); result.textContent = media.played.length; })().catch(error => { result.textContent = "Error: " + error.name; });</script>