An HTML5 video element must include a track element with kind=”captions”. Captions should convey all meaningful audio, including dialogue, musical cues, and sound effects.
If a video doesn’t have captions, deaf users have limited or no access to the details within it.
Developers should ensure that all video elements have a caption using the track element with a caption attribute.
Captions shouldn’t only include dialogue, but also identify who is speaking and include non-speech information where relevant.
The following code shows how to add two different tracks – one in English and one in Spanish:
<video width="300" height="200">
<source src="myVideo.mp4" type="video/mp4">
<track src="captions_en.vtt" kind="captions" srclang="en" label="english_captions">
<track src="captions_es.vtt" kind="captions" srclang="es" label="spanish_captions">
</video>
Copy
For more examples, visit W3C’s GitHub’s ATC Rules library.