THE WORLD'S LARGEST WEB DEVELOPER SITE

Video loop Property

❮ Video Object

Example

Set the video to loop:

document.getElementById("myVideo").loop = true;
Try it Yourself »

Definition and Usage

The loop property sets or returns whether a video should start playing over again when it is finished.

This property reflects the <video> loop attribute.

When present, it specifies that the video should start playing over again when it is finished.

Note: The <video> element is new in HTML5.


Browser Support

Property
loop Yes 9.0 Yes Yes Yes

Syntax

Return the loop property:

videoObject.loop

Set the loop property:

videoObject.loop = true|false

Property Values

Value Description
true|false Specifies whether the video should start playing over again, every time it is finished
  • true - Indicates that the video should start playing again when it is finished
  • false - Default. Indicates that the video should NOT start playing again when it is finished


Technical Details

Return Value: A Boolean, returns true if the video starts playing over again, every time it is finished. Otherwise it returns false
Default Value: false

More Examples

Example

Find out if the video should start playing over again every time it is finished, or not:

var x = document.getElementById("myVideo").loop;
Try it Yourself »

Related Pages

HTML reference: HTML <video> loop attribute


❮ Video Object