Skip to content
easeweb
Search topics

Background videos that loop with no pause button

A muted video loops behind the home page's headline from the moment the page loads, and nothing on the page pauses or stops it.

WCAG 2.2
SC 2.2.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <video autoplay muted loop playsinline>
The accessibility problem illustrated: Cognitive:How do I stop it moving?
01

The problem

People who are distracted by movement, or who read with a magnifier, have no way to stop the footage playing behind the headline

02

Try it

Try to stop the video behind the headline, first with the mouse, then with Tab

Click the hero, hold the pointer over it, then Tab through the page: nothing in the shop pauses the beans. "Stop demo" is the Learn page’s own button, not the shop’s. Then apply a fix: press the Pause button, or watch the short clip stop by itself.

Broken Can you fix this?

BrokenA muted video that loops behind the headline
Fernhill Coffee

Fresh coffee, roasted every Monday

Single-origin beans, sent out the week they are roasted.

Shop coffee

This week’s coffees

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Let people pause the video, or end it within five seconds

Before
BrokenA muted video that loops behind the headline
<section class="hero">  <video class="hero-video" src="beans.mp4" poster="beans.jpg" autoplay muted loop playsinline></video>  <div class="hero-text">    <h1>Fresh coffee, roasted every Monday</h1>    <p>Single-origin beans, sent out the week they are roasted.</p>    <a href="/shop">Shop coffee</a>  </div></section>
What is wrong3 points
  • The video starts as the page loads, and loop plays its eight seconds again and again for as long as the page is open.
  • muted silences it, but it keeps moving.
  • It has no controls, and the page has no button of its own, so nothing pauses it, by mouse, keyboard or touch.
After

A Pause button on the hero

<section class="hero">  <video class="hero-video" src="beans.mp4" poster="beans.jpg" muted loop playsinline aria-hidden="true"></video>  <button type="button" class="hero-pause">    <svg aria-hidden="true" focusable="false">      <use href="#icon-pause"></use>    </svg>    <span class="visually-hidden">Pause background video</span>  </button>  <div class="hero-text">    <h1>Fresh coffee, roasted every Monday</h1>    <p>Single-origin beans, sent out the week they are roasted.</p>    <a href="/shop">Shop coffee</a>  </div></section>
How it is fixed6 steps
  1. Put a native <button> in the hero, before its words, so the keyboard reaches it before Shop coffee, and draw it in the top corner, where it comes first in reading order too. It is there at rest, with no hover, on every screen size.
  2. Give it a dark disc behind a white icon, so it keeps its contrast over the lightest and the darkest frames of the footage.
  3. Make it call pause() and play() on the video itself. The video stays paused until someone presses the button again.
  4. Set the icon and the hidden name from the video's own play and pause events, between Pause background video and Play background video, so the button tells the truth even when the browser refuses to start the video.
  5. Hide the video from screen readers with aria-hidden="true": it only sets the mood, and the button says what it controls.
  6. Take autoplay off and start the video from the script, leaving it still for people whose system asks for less motion. That is an extra: the button is what passes 2.2.2, and without the script nothing moves at all.

This fixes the Before and passes 2.2.2, with the loop and the design as drawn.

04

Design ideas

Footage can stay, as long as people can stop it

Four ways to draw the control for a video behind a hero. Try each with the mouse, then put it aside and Tab through them: three can be seen and pressed without hovering, and one shows itself only to a mouse.

In the design file

  • Draw the hero with its Pause control at rest, not only on hover, and again once paused, with Play.
  • Put the control on its own dark or light backing, so it keeps at least 3:1 over the lightest and darkest frames.
  • Draw it at least 24 by 24 pixels, with its focus ring over the footage.
  • If there is no control, write beside the hero that the clip runs five seconds or less and plays once.

Passes

  • Roasted every Monday

    A Pause pill with the word in it A dark pill in the hero’s lower corner, the icon and the word Pause in white on #21160f, 17.70:1, so it reads over every frame. The word helps people who don’t know the symbol, and changes to Play with the icon.
  • Roasted every Monday

    One Motion switch in the header A small Motion switch in the site’s header stops this video and every other moving thing on the site, and stays off as the visitor moves on. The hero is drawn with nothing over the footage; draw the switch’s off state, in the same place on every page.
  • Roasted every Monday

    A still hero with Watch the roast The hero opens on a still from the footage, with a Watch the roast pill. Nothing moves until it is pressed, and the same pill then pauses it. The first screen is calm for everyone, and the footage is there for those who want it.

Fails

  • Roasted every Monday

    A pause icon that fades in on hoverWCAG 2.2.2 The corner icon appears only while the pointer is over the hero, keeping the footage clean the rest of the time. A phone has no pointer to hover with, and Tab lands on it while it is still invisible. The sample stops after four seconds; the pattern loops on.
05

Verify the fix

5 checks.

Test with: Keyboard, Touch, Mouse, Reduced motion, Screen reader

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the hero, its video or its player script changes.

Limits

This is a starting pattern, not a guarantee for every application. It covers movement only. Words over footage need their contrast on every frame, which is covered in low-contrast text on brand colours, photos and hover states. Footage that flashes more than three times in any one second is a separate check under 2.3.1, made with a flash analysis tool: see flashing banners and videos that can trigger seizures. A video that plays with its sound on has its own guide, autoplaying sound with no way to stop it. A video meant to be watched is covered in videos without captions, or with unchecked automatic ones and videos a keyboard can't play, or with no captions button. Whether the page is calm enough once the video has stopped still needs a person to judge.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service