Code Fix Guide

How to Add Captions to Videos for Accessibility

Videos without captions exclude approximately 15% of adults who have some degree of hearing loss, plus anyone watching in a noisy environment or with the sound off. Captions are required for all prerecorded video content under WCAG.

Common Errors and How to Fix Them

Video with no captions track
Problem
<video src="demo.mp4" controls></video>
Fix
<video src="demo.mp4" controls>
  <track kind="captions" src="demo.vtt"
    srclang="en" label="English" default>
</video>
YouTube embed — enable captions
Problem
<iframe src="https://youtube.com/embed/xyz"></iframe>
Fix
<iframe src="https://youtube.com/embed/xyz?cc_load_policy=1"
  title="Product demo video with captions"></iframe>

Why This Matters

Missing captions violate WCAG 1.2.2 (Captions - Prerecorded) for pre-recorded content and 1.2.4 (Captions - Live) for live content. Auto-generated captions (like YouTube's auto-captions) should be reviewed for accuracy — they often mangle technical terms, proper names, and accented speech.

Find All Your Accessibility Issues Automatically

ADA CodeFix scans your website for WCAG 2.1 AA violations and generates AI-powered code fixes — not vague descriptions, actual code you can copy-paste.

Scan Your Site Free
No credit card required AI-generated code fixes