Skip to content

Commit

Permalink
Handle a11y in video iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed Nov 13, 2024
1 parent 59b109b commit ecc40ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit ecc40ab

Please sign in to comment.