What is Video Autoplay?
Video autoplay begins playback without an explicit user command once a page or media element is ready. Browsers commonly restrict autoplay with sound, particularly before the user interacts with the page.
How Video Autoplay works
Autoplay is a request made through markup or script, but the user agent decides whether playback may begin under its current policy. Audible media generally faces stricter gating than muted or silent media, and permission can depend on prior interaction, settings, embedding context, or power-saving behavior. Applications must treat startup as asynchronous and render a usable paused state. It is applied to previews, ambient backgrounds, and feed experiences after accessibility and data costs are considered.
Key facts
- The promise returned by
HTMLMediaElement.play()rejects when startup is denied or otherwise fails; handling that rejection avoids controls and application state falsely claiming playback began. - Setting
mutedcan make autoplay eligible under common browser policies, but it is not a universal guarantee and does not override user preferences or every embedded-frame restriction. - The
preloadattribute concerns fetching and buffering, not permission to play; a fully downloaded video can still remain paused when its autoplay request is blocked.
When Video Autoplay matters
Use muted autoplay for previews or background media only when motion is appropriate to the experience. Always handle rejection, because browser policy or user preferences may prevent playback from starting.