How do I add captions and a transcript to a video in an HTML page?
Quick answer
Put a <track> element inside the <video> element to associate a synchronized captions file, and identify it with a language and a reader-friendly label. Keep the transcript as separate page content or link to it near the video. Captions and transcripts serve different purposes: captions are synchronized with playback, while a transcript can also describe important visual information. Check that both resources are findable and usable in your player.
The question, the details, the next step.
A practical checklist
Place a
<track>element inside the intended<video>element.Set
kind="captions"and provide the correct captions file path.Set an accurate
srclangvalue and a clear, matchinglabel.Put the transcript beneath the video or link to it clearly nearby.
Check that the transcript includes important visual information as well as spoken content.
Play the video to check caption timing and whether the track is presented as expected.
A few more useful answers
Can a transcript replace synchronized captions?
No. A transcript is accompanying text; a captions track is synchronized with playback. Provide the appropriate resource for each purpose. [S1]
Is an English captions label enough if the captions file is in another language?
No. Use a label and language value that accurately describe the actual track, so its identity is clear. [S1]
Does this HTML example prove the video meets every accessibility requirement?
No. The cited guidance distinguishes transcripts from captions and notes that applicable WCAG requirements vary by media type and conformance level. Check the requirements that apply to your specific media and context. [S2]
Sources
References used for this guide.
- [S1] MDN HTML Reference: The track Element developer.mozilla.org · Checked
- [S2] W3C WAI: Transcripts for Audio and Video w3.org · Checked
