HTML Audio/Video DOM loop Property
Example
var vid = document.getElementById("myVideo");
function checkLoop() {
alert(vid.loop);
}
function enableLoop() {
vid.loop = true;
}
function disableLoop() {
vid.loop = false;
}
Meaning
The loop property sets or returns whether the audio/video should start over again when finished.
Returns a Boolean value, returns true if the audio/video starts playing over again, every time it is finished. Otherwise it returns false.
The default value is false.
Standard Syntax
Return the loop property:
audio|video.loop
Set the loop property:
audio|video.loop=true|false
Advertisement
Property Value
| Type | Description |
|---|---|
| true | Specifies that the audio/video should start playing again when it is finished. |
| false | Default. Specifies that the audio/video should NOT start playing again when it is finished. |