CKTIS / HTML
autoplay: request automatic media playback
Request a start while preserving user control and accounting for playback policy.
Version: HTML Living Standard
Syntax
<video autoplay muted playsinline controls></video>The boolean attribute autoplay requests automatic playback of an audio or video resource when it can start. Its presence enables the request: writing autoplay="false" does not disable it. Browser policy, user preferences, media readiness and an embedding document may still prevent playback. A request is not a promise that sound will start without interaction.
Muted video is commonly permitted where audible playback is blocked, but muted is not a universal bypass. Provide controls and a usable manual start, and avoid surprising users or interfering with assistive technology. playsinline concerns inline video presentation on applicable devices; it does not grant permission to autoplay.
The example attaches a stream made from a local canvas to a muted video. Playback starts without calling the play method, and the handler records the playing state and dimensions before stopping the stream. This was verified in Chromium 145; a real media file, sound or a different browser policy needs its own check.
Examples
<!doctype html><meta charset="utf-8">
<canvas id="image" width="40" height="30"></canvas>
<video id="video" autoplay muted playsinline controls></video><output id="result"></output>
<script>
const canvas = document.querySelector('#image');
canvas.getContext('2d').fillRect(0, 0, 40, 30);
const video = document.querySelector('#video');
video.addEventListener('playing', () => {
document.querySelector('#result').textContent = 'playing=' + !video.paused + '; muted=' + video.muted + '; width=' + video.videoWidth;
video.srcObject.getTracks().forEach(track => track.stop());
}, { once: true });
// A local canvas stream: no camera, microphone or downloaded movie.
video.srcObject = canvas.captureStream(1);
</script>Result
playing=true; muted=true; width=40
Only a local canvas stream is used. The result confirms this muted case, not unrestricted automatic sound playback.