hypra

A11Y-011: autoplaying video isn't muted

Warning: the page still builds, but this is most likely a mistake.

Sound that starts on its own startles people and talks over screen readers. Browsers block autoplay with sound anyway, so the video wouldn't start. (WCAG 1.4.2)

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  video("/videos/hero.mp4", captions: "/videos/hero.vtt", autoplay: true)
}
warning[A11Y-011]: video plays sound on its own
 --> page.hypra:3:3
  |
3 |   video("/videos/hero.mp4", captions: "/videos/hero.vtt", autoplay: true)
  |   ^^^^^
  = help: add muted: true, or remove autoplay
  = docs: https://hypralang.dev/rules/a11y-011/

0 errors, 1 warning

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  video("/videos/hero.mp4", captions: "/videos/hero.vtt", autoplay: true, muted: true)
}