The <video> tag
<video> embeds a video player with the browser's native controls, no third-party players or Flash needed.
Syntax
<video src="movie.mp4" controls></video> Attributes
| controls | Shows the standard player controls (play, volume, seek). |
| autoplay | Starts playback automatically — in most browsers this only works combined with muted, due to anti-nuisance autoplay policies. |
| loop | Restarts playback automatically after it ends. |
| muted | Muted by default. |
| poster | The URL of a cover image shown before playback starts. |
Example
<video controls poster="cover.jpg" width="640" height="360">
<source src="movie.mp4" type="video/mp4">
Your browser doesn't support video.
</video>
Notes
- autoplay without muted is blocked by most modern browsers — this is a deliberate anti-nuisance policy, not a bug.
- The text inside video (fallback content) only shows if the browser doesn't support the video tag at all.
Accessibility
- For accessibility, add captions to video via the track element.