HTML
Example
A video element set to autoplay:
<
video
controls
autoplay
<
source
src
=
"
movie.mp4
"
type
=
"
video/mp4
"
<
source
src
=
"
movie.ogg
"
type
=
"
video/ogg
"Your browser does not support the video tag.
video
Try it »
Browser support





All major browsers support the autoplay attribute.
Note: Internet Explorer 8 and earlier IE versions are not supported.
Definition and Usage
The autoplay attribute is a boolean attribute.
The autoplay attribute specifies that the video will start playing as soon as it is ready. If this attribute is set, the video will play automatically.
Differences between HTML 4.01 and HTML5
Differences between HTML and XHTML
In XHTML, attributes cannot be abbreviated, so the autoplay attribute must be defined as:
HTML