HTML Media Fallbacks and Accessible Alternatives
Understand media child fallback
Text inside audio or video is intended for user agents that do not support the element. Modern browsers do not display it merely because a resource is missing or unsupported. Put an independent link outside the player. These examples use the original files in media-fixtures/; open the supplied preview from a local static server or place the files at the shown paths.
<audio controls src="media-fixtures/tone.wav">Audio playback is unavailable in this browser.</audio><p> <a href="media-fixtures/tone.wav">Open the audio file</a></p>The outside link remains visible in a modern browser.
Provide a descriptive transcript
An accessible alternative must convey the meaningful information of the media. For audio-only content provide the meaningful speech and sound information in text. For video, captions cover sound, while a descriptive transcript or audio description can convey important visuals. Specific WCAG requirements depend on the media and conformance level.
<figure> <audio src="media-fixtures/tone.wav" controls></audio> <figcaption>One-second demonstration tone.</figcaption></figure><p>Transcript: A steady tone plays for one second.</p>The transcript supplies equivalent information even without audio playback.
Keep alternatives outside the player
Combine visible links, a transcript and native controls. A transcript is not automatically generated by track or figcaption. If a site needs dynamic failure handling, a later JavaScript lesson can handle media error events; the always-visible alternative requires no script.
<video controls width="160" height="90" src="media-fixtures/demo.webm"> <track kind="captions" src="media-fixtures/demo.en.vtt" srclang="en" label="English" default></video><p> <a href="media-fixtures/demo.mp4">Open alternate video format</a></p><p>Transcript: A blue screen appears while a steady tone plays for two seconds.</p>The link and transcript are available whether or not playback succeeds.
Common mistakes and practice
Do not hide the only transcript inside the media element. Test with keyboard controls, missing resources and real assistive technologies. Avoid promising that a download link will fix unsupported codecs.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Media Fallbacks and Accessible Alternatives — Knowledge Check
Apply the media or embedding concepts from this lesson.
When all video sources fail in a modern browser, what happens to child fallback text?
Where should a persistent transcript go?
What does a descriptive transcript add when visuals matter?
A video cannot play in the learner's environment. Which persistent alternative helps convey its spoken information?
Why should fallback content be reviewed even in a browser that supports video?