The <video> element embeds a video player in a document. Point to a file with src or nested <source> elements; the browser picks a format it can play.
Add controls for a native player, poster for a preview image, and <track> for captions. Put fallback text (and download links) between the tags for unsupported browsers. For sound-only media, prefer <audio>.
Baseline · Widely available.
Not deprecated. Core support has been stable across browsers since about July 2015. Some attributes (for example loading) still vary.
Autoplay warning.
Unmuted autoplay is often blocked. Prefer user-started playback with controls. If you must autoplay, start muted (and often playsinline on mobile).
Experimental / uneven extras.
loading="lazy", controlslist, and Picture-in-Picture / remote-playback flags are newer or inconsistently supported — treat them as progressive enhancements.
Both start and end tags are required. Without controls (or custom UI via JavaScript), most users have no useful player. Set width and height (CSS pixels) to reserve space and reduce layout shift.
Reference
Attributes
The attributes you will use most often on <video>:
Toggle controls, loop, and muted on a real <video> element.
A real <video> using /video/count.mp4. Toggle chips, then press Apply (or the chip itself).
Player
controls on · loop off · muted off
Code
HTML Examples
Short, copy-ready snippets. Use Try It Yourself for a live editor.
Example 1 — Basic Player with Controls
Embed one file, reserve size, and show the native player UI.
HTML
<video
src="/video/count.mp4"
width="360"
height="203"
controls
preload="metadata"
>
Your browser does not support the video element.
<a href="/video/count.mp4">Download MP4</a>.
</video>
Set kind, srclang, and label so the player can list the track.
Optional default selects that track when the browser supports it.
Edge Cases & Pitfalls
Most video bugs come from autoplay policy, missing controls, format support, or layout shift.
ux
Always give a way to play and stop
Without controls (or custom UI), users may see a blank box with no player. Prefer visible controls.
policy
Unmuted autoplay is unreliable
Browsers often require a user gesture. Prefer opt-in play; use muted autoplay (plus playsinline on mobile) only when necessary.
layout
Set width and height
Explicit dimensions (or CSS aspect-ratio) reduce layout shift. Especially important if you use lazy loading.
formats
Not every codec works everywhere
Offer multiple <source> formats (commonly WebM plus MP4).
a11y
Captions need a track file
Use <track> + WebVTT for timed text. Also provide a transcript when speech is important.
api
muted="false" does not unmute
Boolean attributes: if muted (or autoplay) is present, it is on. Remove the attribute to turn it off.
hint
controlslist is only a hint
Values like nodownload may hide UI in some browsers but are not a security boundary — users can still obtain the file URL.
Compatibility
Browser Support
The <video> element is core HTML media in every modern browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<video>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support the element; codec support, autoplay rules, and extras like controlslist still differ by browser and OS.
97%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet Explorer9+
Partial
<video>Widely supported
Bottom line: Safe to use with controls, dimensions, and a format fallback. Treat autoplay, controlslist, and loading="lazy" as progressive extras.
Remember
Key Takeaways
Role:<video> embeds video; controls gives users a real player.
Formats: use nested <source> when one codec is not enough.
Autoplay: prefer user play; muted + playsinline when you must autoplay.
Access: dimensions, poster, captions via <track>, and a download fallback.
One line: a good <video> has a playable source, controls, size, and a simple fallback.
UA style
Default CSS Settings
Typical user-agent styling for video (exact chrome varies by browser):
default.css
video {
object-fit: contain;
}
video:not([controls]) {
/* without controls, many UAs still show the video box */
}
You can style the outer box (width, max-width, border-radius). Use CSS object-fit and object-position to fit the picture inside the frame. Individual control chrome is browser-specific.
Frequently Asked Questions
The video element embeds a media player for video (and can play audio). With the controls attribute, the browser shows a native UI for play, pause, seek, volume, and fullscreen — no plugin required.
Use src on video for one file. Use nested source elements when you offer multiple formats (for example WebM and MP4); the browser picks the first format it can play.
Most browsers block autoplay with sound. Prefer controls and a user play action. If you must autoplay, start muted (and often playsinline on mobile) so playback is more likely to be allowed.
Set the poster attribute to an image URL. Until the first frame is ready, the poster is shown. Set width and height to avoid layout shift.
Nest a track element that points to a WebVTT (.vtt) file, with kind, srclang, and label. Users can enable captions from the player menu when supported.
No. muted is a boolean attribute: if it is present, the video starts muted. Remove the attribute entirely to start unmuted.