Dostępność
a11y/video-captions
Recorded video with speech or meaningful sound has synchronised captions, for example a <track kind="captions">.
krytycznastatyczneWCAG 1.2.2 · Afe-a11y-media
Dlaczego
Without captions, people who are deaf or hard of hearing get nothing from the sound track, and so does everyone watching with the sound off. Auto-generated captions with errors in names and numbers do not count as an equivalent.
Poprawka
Ship a WebVTT file and add <track kind="captions" src="….vtt" srclang="en" label="English" default> inside <video>. Captions include who speaks and meaningful sounds. A video player library must expose its captions button; a silent background video should carry muted.
Przykłady
<!-- bad -->
<video controls src="launch.mp4"></video>
<!-- good -->
<video controls src="launch.mp4">
<track kind="captions" src="launch.en.vtt" srclang="en" label="English" default>
</video>Źródła
Fakty
- Identyfikator
a11y/video-captions- Waga
- krytyczna
- Sprawdzanie
- statyczne sprawdzane w kodzie źródłowym przez
audit - Dotyczy plików
htmlangularvuesvelteastrojsx- WCAG 2.2
- 1.2.2, poziom A
- Ten sam problem w
- axe-core
video-caption - Uczy jej skill
fe-a11y-mediaMedia, motion and flashing- Od wersji
- 0.1.0
Przeczytaj w terminalu
npx github:dawidolko/frontend-skills explain a11y/video-captions