Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle a11y in video iframe #8636

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cfgov/unprocessed/js/organisms/VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ function VideoPlayer(element) {
* to video player instance.
*/
function _videoPlayerReadyHandler(event) {
// Video has loaded into the iframe, so we can show it to assistive devices.
_iframeDom.removeAttribute('aria-hidden');
_iframeDom.removeAttribute('tabindex');

// Add duration timestamp to video.
const player = event.target;
const duration = player.getDuration();
Expand Down
3 changes: 2 additions & 1 deletion cfgov/v1/jinja2/v1/includes/organisms/video-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
src="{{ video_url }}"
allow="fullscreen; autoplay"
aria-hidden="true"
tabindex="-1">
tabindex="-1"
title="This is a placeholder for a video that will load.">
</iframe>
</div>
</div>
Expand Down
Loading