Subtitles with track and WebVTT
Add captions and subtitles to video with track and .vtt files.
Captions and Subtitles
Video accessibility requires text alternatives for audio content:
- Subtitles — dialogue transcription, assumes viewer can hear sounds
- Captions — dialogue + descriptions of sounds (for deaf users)
- Audio descriptions — describes visual content for blind users
The track Element
The <track> element links a subtitle/caption file to a video:
<video controls>
<source src="tutorial.mp4" type="video/mp4">
<track
src="tutorial-en.vtt"
kind="subtitles"
srclang="en"
label="English"
default
>
<track
src="tutorial-es.vtt"
kind="subtitles"
srclang="es"
label="Spanish"
>
</video>All lessons in this course
- The audio Element src controls loop autoplay
- The video Element and Aspect Ratio
- The source Element for Multiple Formats
- Subtitles with track and WebVTT