no-autoplay-audio

Autoplaying audio should provide a pause/stop or volume-control mechanism

manualWCAG 1.4.2 (A)confidence: lowseverity: moderateperceivable

Flags <audio>/<video> elements that autoplay unmuted with no native controls attribute, and <embed>, <object> or <bgsound> elements that may play sound, for manual review of whether the sound plays for more than 3 seconds.

Applies to. Any <audio autoplay> or <video autoplay> element that is not muted. Also any <bgsound>, and any <embed> or <object> that loads sound or video, or a plugin (Flash) that may play it: its type is audio/, video/ or a plugin type, or its src/data ends in a sound or video file extension. An <embed> or <object> with autostart or autoplay set to false (attribute or <param>) is left out.

Expectation. SC 1.4.2 only applies when audio plays automatically for MORE than 3 seconds; clip duration is not knowable from static markup (jsdom does not decode media), so this rule cannot determine whether the SC even applies to a given element. It is authored as type: 'manual' (cantTell-capped, never fail) on purpose rather than guessing: an autoplaying unmuted element with no controls attribute (the native, statically-verifiable mechanism to pause/stop or adjust volume) is flagged for human review rather than treated as a deterministic violation.

Examples

pass
<audio autoplay controls src="x.mp3"></audio>

Native controls gives the user a pause/volume mechanism.

can't tell
<audio autoplay src="x.mp3"></audio>

The audio autoplays unmuted with no controls attribute, giving the user no way to pause or stop it.

can't tell
<embed src="welcome.mp3">

An <embed> or <object> that loads sound or video, and any <bgsound>, may play as soon as the page loads, and it has no controls or muted to read. One with autostart="false" (or a <param> saying so) is not asked about.

How to check

When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.

AUTOPLAY_CONTROLS_HIDDEN

  1. Load the page with sound on and listen whether the hidden audio or video the report names starts by itself.
  2. If it plays sound for more than 3 seconds, look for some other visible control on the page that pauses, stops or mutes it.
  3. Try that control with the keyboard and check the sound stops.

Pass. No sound plays for more than 3 seconds, or a visible, keyboard-reachable control stops or mutes it.

Fail. Sound plays from a hidden player whose controls cannot be reached and nothing else stops it, which fails WCAG 1.4.2 (F23).

AUTOPLAY_NO_CONTROLS_MECHANISM

  1. Load the page with sound on and listen whether the audio or video the report names starts by itself.
  2. If it plays sound for more than 3 seconds, look for a way to pause, stop or mute it, or to set its volume. Look near the top of the page first, where people expect it, but it counts wherever it is on the page.
  3. Try that control with the keyboard (Tab to it, press Enter or Space) and with a screen reader running, and check the sound stops or drops.

Pass. No sound plays for more than 3 seconds, or a control on the page that works with the keyboard and a screen reader pauses, stops or mutes it.

Fail. Sound plays by itself for more than 3 seconds with no way to pause, stop or turn it down independently of the system volume, which fails WCAG 1.4.2 (F23).

EMBEDDED_SOUND_SOURCE

  1. Load the page with sound on and listen whether the embed, object or bgsound the report names plays sound by itself.
  2. If it plays for more than 3 seconds, look for a control to pause, stop or mute it, in the embedded player or near the top of the page.
  3. Try that control with the keyboard and check the sound stops.

Pass. Nothing plays automatically for more than 3 seconds, or a reachable control pauses, stops or mutes it.

Fail. Sound plays by itself for more than 3 seconds with no reachable way to stop it or turn it down, which fails WCAG 1.4.2 (F23).

View source