Captions and Transcripts for Product Videos #
Description:
Captions and transcripts are essential for making product videos accessible to all users, including those who are deaf, hard of hearing, or prefer a text-based alternative.
Key Accessibility Features for Captions and Transcripts #
- Captions: Real-time text synchronized with audio that includes spoken dialogue and non-verbal sounds.
- Transcripts: A full written version of the video content that includes dialogue, visual descriptions, and any relevant actions.
- Interactive Transcript Toggle: Allow users to view or hide the transcript as needed.
- Keyboard Accessibility: Make all controls accessible via keyboard for non-mouse users.
Example: Accessible Product Video with Captions and Transcript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accessible Product Video with Captions and Transcript</title>
<style>
/* Basic styling */
.video-container {
max-width: 600px;
margin: 20px auto;
text-align: center;
}
.transcript {
background-color: #f9f9f9;
padding: 15px;
margin-top: 20px;
display: none; /* Hide by default */
font-size: 0.9em;
color: #333;
}
.transcript-toggle {
background-color: #333;
color: #fff;
border: none;
padding: 10px;
font-size: 1em;
cursor: pointer;
margin-top: 10px;
}
.transcript-toggle:focus {
outline: 2px solid #005fcc;
}
</style>
</head>
<body>
<div class="video-container" aria-labelledby="product-video-title">
<h2 id="product-video-title">Product Assembly and Usage Guide</h2>
<!-- Accessible Video with Captions -->
<video id="product-video" controls width="100%" aria-describedby="video-description">
<source src="video/product-demo.mp4" type="video/mp4">
<track kind="captions" src="video/product-demo-captions.vtt" srclang="en" label="English">
<!-- Fallback text if video is unsupported -->
Your browser does not support the video tag.
</video>
<p id="video-description" class="sr-only">
This video demonstrates how to assemble and use the eco-friendly leather backpack, showing each step in detail.
</p>
<!-- Transcript Toggle Button -->
<button class="transcript-toggle" id="transcript-toggle" aria-expanded="false" aria-controls="transcript">
Show Transcript
</button>
<!-- Full Transcript -->
<div class="transcript" id="transcript">
<h3>Transcript</h3>
<p><strong>Narrator:</strong> Welcome to the assembly guide for our eco-friendly leather backpack. In this video, we’ll show you how to put it together and highlight some of its key features.</p>
<p><strong>[Sound]</strong> Zipper opening</p>
<p><strong>Narrator:</strong> Start by unzipping the main compartment. [On screen, the main compartment is unzipped to show the spacious interior.]</p>
<p><strong>Narrator:</strong> Next, place your belongings in the main section, and use the smaller compartments for easy access items like your phone and keys.</p>
<p><strong>[Visual]</strong> Close-up of smaller zippered compartments for storage.</p>
<p><strong>Narrator:</strong> Finally, adjust the straps for comfort. Our eco-friendly leather ensures durability and style for everyday use.</p>
</div>
</div>
<script>
// Toggle transcript visibility
const transcriptToggle = document.getElementById('transcript-toggle');
const transcript = document.getElementById('transcript');
transcriptToggle.addEventListener('click', () => {
const isExpanded = transcriptToggle.getAttribute('aria-expanded') === 'true';
transcriptToggle.setAttribute('aria-expanded', !isExpanded);
transcript.style.display = isExpanded ? 'none' : 'block';
transcriptToggle.textContent = isExpanded ? 'Show Transcript' : 'Hide Transcript';
});
</script>
</body>
</html>
Explanation #
- Captions for Real-Time Accessibility:
- The
<track>element withkind="captions"provides captions in a.vttfile, which are displayed along with the video. Captions cover spoken dialogue, sounds (e.g., “Zipper opening”), and non-verbal audio cues to enhance accessibility for users who are deaf or hard of hearing. - The video player includes
controlsfor play, pause, volume, and captions, allowing users to customize their viewing experience.
- The
- Detailed Transcript:
- A full transcript is provided in a
<div>element with anid="transcript". The transcript includes both spoken content and visual cues, like “Close-up of smaller zippered compartments,” to help visually impaired users understand key actions or details in the video. - Visual and audio descriptions are clearly marked, so users can follow along even if they cannot see the video or hear the audio.
- A full transcript is provided in a
- Toggleable Transcript Display:
- The transcript is hidden by default and can be toggled on or off using the “Show Transcript” button. The button has
aria-expandedandaria-controlsattributes to announce its state to screen readers. - Toggling the transcript allows users to access it only when needed, reducing visual clutter.
- The transcript is hidden by default and can be toggled on or off using the “Show Transcript” button. The button has
- Keyboard Accessibility:
- All controls, including the “Show Transcript” button, are keyboard-accessible, allowing users to navigate and control the video experience without a mouse.
- The
outlinefocus style on the button makes it easy to see when the element is focused, enhancing accessibility for keyboard users.
Tips for Implementing Accessible Captions and Transcripts #
- Use
.vttFiles for Captions: Use.vttfiles with the<track>element for accurate, synced captions. - Include Visual Descriptions in Transcripts: For actions, settings, and visuals not covered by the video’s audio, include them in the transcript to provide context.
- Interactive Transcript Toggle: Make the transcript easy to open or close, with clear ARIA labels to indicate its current state.
- Keyboard-Friendly Controls: Ensure all controls are keyboard-accessible with clear focus indicators.
Key Takeaways #
- Captions for Real-Time Accessibility: Captions help users who are deaf or hard of hearing follow along in real-time.
- Transcripts for Full Access: Transcripts provide a complete text version, accessible for screen reader users or users who prefer reading.
- Toggleable Options: Offering the ability to hide or show transcripts makes the interface cleaner and lets users choose when to view additional text.
- Keyboard Navigation: Make sure all controls, including transcript toggles and video playback, are keyboard-friendly.