W3Schools.com

HTML5 <video> autoplay Attribute

HTML5 video Tag Reference HTML5 <video> tag

Example

A video that will automatically start playing:

<video controls="controls" autoplay="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 yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The autoplay attribute is supported in all major browsers.

Note: Internet Explorer 8 and earlier versions, do not support the <video> tag.


Definition and Usage

The autoplay attribute is a boolean attribute.

When present, the video will automatically start playing as soon as it can do so without stopping.


Differences Between HTML 4.01 and HTML5

The <video> tag is new in HTML5.


Syntax

<video autoplay="autoplay">

Note: The autoplay attribute is a boolean attribute, and can be set in the following ways:

  • <video autoplay>
  • <video autoplay="autoplay">
  • <video autoplay="">

HTML5 video Tag Reference HTML5 <video> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE