WCAG provides two techniques for Success Criterion 1.2.2 - Captions (Prerecorded)
The best way to handle both situation is to use the HTML5 <track>
tag to specify the captions.
If your video is a "media alternative for text" you have to clearly label it as such. Problem is that "Using aria-labelledby to provide a text alternative for non-text content" lacks of browser support, but you still can use it. My opinion is that transcript should be linked by a aria-describedby
. But still, for users not using a screenreader, you have to make it clear (and visible) the role of text. It's always annoying to start watching a video after reading a text and realizing that the text was its transcript.
I would say that the best is to use something like the following (using track
for closed captions and/or a transcript clearly announced before the video and indicated as such after) :
<h2 id="title">Title of my video</h2> (<a href="#transcript">see transcript</a>)
<video src="foo.ogv" aria-labelledby="title" aria-describedby="transcript">
<track kind="captions" label="English captions" src="captions.vtt" srclang="en" default></track>
</video>
<div id="transcript">
<strong>Transcript of the video:</strong>
Transcript here
</div>
Note: You should not use the body of the object
(H53 technique) element as this is not supported by modern screen readers which can handle navigation with applets