<video>: The VIDEO Element
Last updated: 2026-10-13
<video>The VIDEO Element
Embeds a video player with controls, poster image and multiple source formats.
| Category | Links & Media |
|---|---|
| Content Model | Embedded content |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Yes — requires closing </video> tag |
| Status | Standard |
📝 Syntax
<video controls>video content</video>
⚙️ Attributes
This element supports the global attributes plus the following:
| Attribute | Value | Description |
|---|---|---|
src | Video file URL. | |
controls | Shows playback controls. | |
autoplay | Auto-plays (usually needs muted). | |
loop | Loops the video. | |
muted | Starts muted. | |
poster | Poster image URL shown before playback. | |
width | Display width in pixels. | |
height | Display height in pixels. | |
preload | Preload hint: none/metadata/auto. |
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <video> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: poster sets the cover image before playback; mobile autoplay also usually needs muted.
❓ FAQ
QWhich formats does video support and how to choose?
AThree mainstream formats: MP4 (H.264+AAC) with ~100% support, WebM (VP9) open and free, AV1 newest with the best encoding efficiency. Practical advice: always provide MP4 as the primary format, add WebM/AV1 via multiple
<source> elements to save bandwidth; the browser picks automatically.QWhat is the poster attribute of video for?
A
poster='cover.jpg' sets the cover image shown while loading / before playing. Without it, browsers show the video's first frame (some show blank). A cover also improves perceived load speed, so set one consistently.QWhich attribute combination enables video autoplay?
AAutoplay with sound gets blocked; the reliable combo is
<video autoplay muted loop playsinline> — muted looping inline playback (the standard for background video). When sound is needed, listen for the first user interaction, then remove muted and play.🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.