Accessible Video Demonstrations for Product Use #
Description:
Key Accessibility Features for Product Videos #
- Captions: Ensure all spoken content is displayed as text to aid users who are deaf or hard of hearing.
- Audio Descriptions: Provide narration for visual elements that aren’t covered by audio (e.g., “The person is assembling the product”).
- Transcript: A written version of both spoken and visual content for users who prefer to read or need an alternative format.
- Keyboard Navigation: Allow all controls to be accessed via keyboard for users who cannot use a mouse.
- ARIA Labels: Use ARIA attributes to make controls and the player more accessible to screen readers.
<!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 Demonstration</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 */
}
.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>
<section class="video-container" aria-labelledby="video-demo-title">
<h2 id="video-demo-title">How to Use the Product</h2>
<!-- Video Player with Controls -->
<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">
<track kind="descriptions" src="video/product-demo-audio-description.vtt" srclang="en" label="English">
<!-- Alternative text if the video cannot be played -->
Your browser does not support the video tag.
</video>
<p id="video-description" class="sr-only">
A step-by-step demonstration of assembling and using the product, narrated with captions and audio descriptions.
</p>
<!-- Transcript Toggle Button -->
<button class="transcript-toggle" id="transcript-toggle" aria-expanded="false" aria-controls="transcript">
Show Transcript
</button>
<!-- Transcript Content -->
<div class="transcript" id="transcript">
<h3>Video Transcript</h3>
<p>[Narrator] In this video, we’ll show you how to assemble and use our eco-friendly coffee press. Start by removing the lid and filling the container with ground coffee. [On screen, a person fills the container.] Next, pour hot water over the coffee grounds. [Water is poured.]...</p>
</div>
</section>
<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 Speech and Sounds:
- The
<track>element withkind="captions"provides captions in a.vttfile. This ensures users who are deaf or hard of hearing can read what’s being spoken. - The captions also include important sounds that help convey the context (e.g., “[Water pouring]”).
- The
- Audio Descriptions for Visual Elements:
- A second
<track>element withkind="descriptions"provides an audio description file, describing on-screen actions that are not otherwise explained in the main audio. - For instance, when someone pours water, the audio description could say, “Water is poured into the coffee press,” providing context for visually impaired users.
- A second
- Transcript with Toggle Button:
- The transcript provides a full text version of both spoken words and descriptions of visual elements, making it accessible for users who prefer text or need a non-audio format.
- A button toggles the visibility of the transcript, and its state is managed by the
aria-expandedattribute. This feature is accessible via keyboard and labeled witharia-controlsto link it to the transcript container.
- ARIA Labels and Descriptions:
- The
aria-labelledbyandaria-describedbyattributes provide screen readers with additional context:aria-labelledby="video-demo-title"links the video section to the heading, giving screen readers the section’s purpose.aria-describedby="video-description"on the video tag summarizes the video content, including mentions of captions and audio descriptions.
- The
- Keyboard Accessibility:
- All controls (play/pause, captions, volume) are accessible by keyboard via the native
<video>controls. - The transcript toggle button can also be accessed with
Tab, and focus styling ensures it’s clearly visible.
- All controls (play/pause, captions, volume) are accessible by keyboard via the native
Tips for Accessible Video Demonstrations #
- Include All Key Information: Ensure that captions, audio descriptions, and transcripts cover all important visual and auditory information in the video.
- Provide a Toggle for the Transcript: Not all users will want the transcript visible, so provide a toggle button with clear instructions and an
aria-expandedattribute. - Use Clear ARIA Labels: ARIA labels and descriptions help clarify the purpose of video elements for screen reader users.
- Optimize for Keyboard Navigation: Ensure all controls are keyboard-accessible and provide clear focus indicators.
Key Takeaways #
- Captions ensure accessibility for users who are deaf or hard of hearing.
- Audio Descriptions offer additional context for users who are visually impaired.
- Transcript provides a text version of the video, which is helpful for users who prefer reading or cannot watch the video.
- ARIA Attributes and Keyboard Support enhance accessibility for screen reader users and users navigating by keyboard.
Screen reader: NVDA
Video: