DOM Methods
HTMLMediaElement.load()
Resets resource selection and begins loading again. Pending play promises can reject with AbortError. Use after updating source elements, not repeatedly during playback. This example checks the reset position of an empty player. Example result: 0.
Formal Syntax & Structure
html syntaxhtml
media.load()Return Value
undefined
No return value.
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); media.load(); result.textContent = media.currentTime; })().catch(error => { result.textContent = "Error: " + error.name; });</script>