Warninga11y.autoplay

Sound may play on its own

Why it matters

A screen reader is sound. When a page starts playing audio as it opens, the visitor can't hear the screen reader over it, and so can't find the control that would stop it. For people with some cognitive disabilities, unexpected sound makes a page unusable for as long as it lasts.

Browsers block most unmuted autoplay now, but not for sites the visitor has played media on before, which means it is your regular visitors who get it.

We can see that autoplay is there without muted. We can't see whether the file has a sound track, or lasts less than the three seconds the guidelines allow, so check before you change anything: a silent background video is fine (though it wants muted anyway, or browsers won't autoplay it at all).

Source: WCAG 2.2, 1.4.2 Audio Control (Level A); MDN: autoplay guide.

How to fix it

Let the visitor start it, or start it silent:

<video src="/kitchen.mp4" autoplay muted loop playsinline></video>
<audio src="/welcome.mp3" controls></audio>

Examples

These are the rule's own test pages, and what it says about each. They are run on every change to the rule book.

<video src="/kitchen.mp4" autoplay loop>
</video>

Warning1 audio or video element is set to autoplay without being muted: video. If it has sound, it plays over a screen reader.

fail-unmuted
<audio src="/welcome.mp3" controls>
</audio>

PassedNothing on the page plays sound by itself.

pass-controls
<video src="/kitchen.mp4" autoplay muted loop playsinline>
</video>

PassedNothing on the page plays sound by itself.

pass-muted