Video autoplay Property
Find out if the video started to play as soon as it was ready:
The result of x will be:
Definition and Usage
The autoplay property sets or returns whether a video should start playing as soon as it is loaded.
This property reflects the <video> autoplay attribute.
When present, it specifies that the video should automatically start playing as soon as it is loaded.
Note: The <video> element is new in HTML5.
The autoplay property is supported in all major browsers.
Note: Internet Explorer 8 and earlier versions, do not support the <video> element.
Return the autoplay property:
Set the autoplay property:
|true|false||Specifies whether a video should automatically start playing as soon as
it is loaded
|Return Value:||A Boolean, returns true if the video automatically starts playing, otherwise it returns false|
Enable autoplay, and reload the video:
x.autoplay = true;
A demonstration of how to create a <video> element and setting the autoplay property:
HTML reference: HTML <video> autoplay attribute