X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML Audio/Video DOM autoplay Property

HTML audio Tag Reference HTML Audio/Video DOM Reference

Example

Enable autoplay, and reload video:

myVid=document.getElementById("video1");
myVid.autoplay=true;
myVid.load();

Try it Yourself »

Definition and Usage

The autoplay property sets or returns if the audio/video should start playing as soon as it is loaded.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The autoplay property is supported in all major browsers.

Note: This property is not supported in Internet Explorer 8 and earlier.


Syntax

Set the autoplay property:

audio|video.autoplay=true|false

Return the autoplay property:

audio|video.autoplay

Property Values

Value Description
true Indicates that the audio/video should start playing as soon as it is loaded
false Default. Indicates that the audio/video should NOT start playing as soon as it is loaded

Technical Details

Return Value: A Boolean. true|false
Default Value: false


HTML audio Tag Reference HTML Audio/Video DOM Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook