HTML Audio/Video DOM autoplay Property
HTML Audio/Video DOM Reference
Example
Enable autoplay and reload the video:
myVid=document.getElementById("video1");
myVid.autoplay=true;
myVid.load();
Try it »
Definition and Usage
The autoplay property sets or returns whether the audio/video should start playing immediately after it is loaded.
Browser support





All major browsers support the autoplay attribute.
**Note:** Internet Explorer 8 and earlier versions do not support this property.
Syntax
Set the autoplay attribute:
audio|video
.autoplay=true|false
Returns the autoplay attribute:
audio|video
.autoplay
Attribute values
| Value | Description |
|---|---|
| true | Indicates that the audio/video should start playing immediately after loading. |
| false | Default. Indicates that the audio/video should not start playing immediately after loading. |
Technical Details
| Return Value: | Boolean value, true|false |
|---|---|
| Default value: | false |
HTML Audio/Video DOM Reference