Video loop property
Example
Set the video to loop playback:
document.getElementById("myVideo").loop = true;
Try it »
Definition and Usage
The loop property sets or returns whether the video should play again when it ends.
This property reflects
When this attribute is present, it describes whether the video plays again after playback ends.
Note:
Browser support





All major browsers support the loop property
Note: Internet Explorer 8 and earlier IE versions do not support
Syntax
Return the loop attribute:
videoObject
.loop
Set the loop attribute:
videoObject
.loop=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Describes whether the video plays again after each playback ends
|
Technical Details
| Return Value: | Boolean, returns true if the video replays after each playback ends, otherwise returns false. |
|---|---|
| Default value: | false |
More examples
Example
Check whether the video restarts playback after each playback ends:
var x = document.getElementById("myVideo").loop;
x
The output is:
true
Try it »
Related pages
HTML Reference Manual: HTML
The Video object