The controls attribute on <video> or <audio> is a boolean flag. When present, the browser shows its built-in playback UI (play/pause, seek, volume, and often fullscreen on video).
Without controls, there is no default UI — users cannot play the media unless you add custom buttons with JavaScript. Pair with src (or <source>), and optionally poster, loop, or muted.
Baseline · Widely available.
Not deprecated and not experimental. Standard media attribute across modern browsers. Exact control chrome looks different per browser.
Syntax
HTML Syntax
syntax.html
<videocontrols src="…"></video>
Same boolean form on <audio>. Presence turns controls on; no value is required (controls="controls" is also valid).
Toggle controls on a real video. With controls off, the native play bar disappears.
Use the video’s play button when controls are on. When off, playback UI is hidden.
video
controls present
Code
HTML Examples
Short, copy-ready snippets. Use Try It Yourself for a live editor.
Example 1 — Video with controls
Add the boolean attribute so users can play, pause, and seek.
HTML
<video controls width="320" playsinline>
<source src="/video/count.mp4" type="video/mp4">
<source src="/video/count.webm" type="video/webm">
Your browser does not support the video element.
</video>
No controls attribute — the native bar is not shown.
Custom button uses the media element’s play() / pause() methods.
You own the UX — add seek, mute, and captions yourself for a full player.
For beginners, prefer native controls unless you need a custom design.
Edge Cases & Pitfalls
Default controls are the easiest accessible path — custom UIs need extra work.
a11y
Prefer native controls first
Browser controls are keyboard-operable out of the box. Custom players must reimplement focus, labels, and shortcuts carefully.
autoplay
Autoplay still has limits
autoplay with sound is often blocked. controls does not bypass that — mute or wait for a user gesture.
audio
Audio without controls is nearly invisible
An <audio> tag with no controls (and no custom UI) gives users nothing to click.
look
UI differs by browser
Icons and layout of the control bar are not identical in Chrome, Firefox, and Safari. Plan for that if branding must match.
JS
Toggle with .controls
In JavaScript: video.controls = true or false, or use setAttribute / removeAttribute.
Compatibility
Browser Support
controls is an HTML attribute for <video> and <audio> in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
controls
Widely available with HTML5 media. The presence of controls is consistent; the visual design of the bar varies by engine.
96%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet ExplorerIE9+ HTML5 media
Supported
controlsWidely supported
Bottom line: Safe default for playable media. Use custom controls only when you need a branded player and can meet accessibility requirements.
Remember
Key Takeaways
Role: show the browser’s built-in media playback UI.
Elements:<video> and <audio> only.
Boolean: present = on; absent = no default bar.
Custom UI: omit controls and wire your own buttons with script.
One line: add controls so users can play media — omit it only when you supply your own UI.
Frequently Asked Questions
On video or audio, controls tells the browser to show its built-in playback UI — play/pause, seeking, and volume (and fullscreen on video where supported).
HTML media elements: video and audio. It does not apply to img, iframe, or other non-media tags.
Yes. Presence means show controls. Absence means the browser does not show its default control bar.
Users get no default play UI. You must play media with script (or custom buttons) via the HTMLMediaElement API, or users cannot start playback easily.
You can style the media element as a box (size, margin, border). Individual control buttons inside the native UI are not reliably styleable — use a custom player for full design control.
An optional hint (when controls is present) that can suggest hiding some UI pieces, such as download. Browser support varies.