English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <video> autoplay attribute

<video> autoplay attribute usage The autoplay attribute is a boolean (boolean) attribute, the autoplay attribute specifies that the video should start playing as soon as it is ready. If this attribute is set, the video will play automatically

 HTML <video> tag

Online Example

Automatically Playing Video:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>基础教程网(oldtoolbag.com)</title> 
</head>
<body>
<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>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the autoplay attribute.

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

Definition and Usage

The autoplay attribute is a boolean (boolean) attribute.

The autoplay attribute specifies that the video should start playing as soon as it is ready. If this attribute is set, the video will play automatically.

HTML 4.01 between5difference

<video> tag is an HTML5 New tags.

Differences between HTML and XHTML

In XHTML, attributes cannot be abbreviated, and the autoplay attribute must be defined as: <video autoplay="autoplay">.

Syntax

<video autoplay>
 HTML <video> tag