media

<video>

Embeds a video player in the page, with native browser controls and multiple source support. Use it for self-hosted or CDN-hosted video instead of Flash or heavy JS players.

<video src="clip.mp4" controls poster="cover.jpg"></video>

Common attributes

Attribute Purpose
src Video URL (or use <source> children)
controls Show native play/pause/volume UI
autoplay Start playing automatically (needs muted on most browsers)
muted Start with audio muted
loop Restart when the video ends
poster Placeholder image shown before playback
preload none | metadata | auto — how much to prefetch
playsinline Play inline on iOS instead of fullscreen

Examples

<video src="demo.mp4" controls poster="cover.jpg" width="640"></video>

Simple video with a poster frame

<video controls><source src="v.webm" type="video/webm"><source src="v.mp4" type="video/mp4">Fallback text.</video>

Multiple formats for cross-browser support

<video autoplay muted loop playsinline src="bg.mp4"></video>

Silent looping background video (iOS-safe)

Gotcha

Autoplay requires muted (and often playsinline) or browsers will block it. Always provide captions via for accessibility.

Related tags

← All HTML tags · CSS selectors · HTML entities