×

html · level 2 · unit 7 · lesson 3

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

<track> adds , and a helps everyone.

Captions are words that appear on a video in time with the sound, for people who cannot hear it or have the sound off. They live in a separate .vtt file, added with an empty <track> inside <video>.

kind="captions" says what the track holds, srclang gives its language code, label names it in the player's menu, and default turns it on from the start.

Sound on its own has nowhere to show captions, so put a transcript underneath instead: a written copy of everything said and heard.

<video controls width="640" height="360" poster="dog.svg">
  <source src="puppy.mp4" type="video/mp4">
  <track kind="captions" src="puppy.vtt" srclang="en" label="English" default>
</video>

Press show my page to see it here.

Captions also help anyone watching in a noisy café or a quiet library.