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

Fix VideoPlayer accessibility issues #703

Merged
merged 13 commits into from
Dec 19, 2024

Conversation

joshfarrant
Copy link
Contributor

@joshfarrant joshfarrant commented Aug 19, 2024

Summary

Fixes two Sev-2 VideoPlayer a11y issues.

The styling of the controls bar is heavier than it was before, but it's necessary to achieve the required contrast.

List of notable changes:

  • Improved contrast of VideoPlayer focus styles by making the focus outline thicker and offsetting it.
  • Improved contrast of controls and title.
  • To offset the heavier title bar styles, the title bar now hides while the video is playing. This should probably have been default behaviour from day 1.
  • Similarly, the controls bar now hides when the cursor or focus leaves the VideoPlayer, or after a few seconds of inactivity, and reappears when the cursor or focus returns.
  • Made the video tooltip more efficient by being more judicious about when the event listener is added.

Steps to test:

  1. Focus the VideoPlayer with the keyboard
  2. Observe the focus styles

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Before After

image

image

image

image

Copy link

changeset-bot bot commented Aug 19, 2024

🦋 Changeset detected

Latest commit: 7aeb162

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 19, 2024

🔍 Design token changes found

View CSS variable changes
- --brand-videoPlayer-title-bgColor: linear-gradient(#01040966, var(--base-color-scale-transparent));
+ --brand-videoPlayer-title-bgColor: linear-gradient(180deg, #000000e6, #00000073 66%, transparent);
- --brand-videoPlayer-controls-bgColor: linear-gradient(var(--base-color-scale-transparent), #01040966);
+ --brand-videoPlayer-controls-bgColor: #000000bf;
- --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-5);
+ --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-4);
- --brand-videoPlayer-title-bgColor: linear-gradient(#01040966, var(--base-color-scale-transparent));
+ --brand-videoPlayer-title-bgColor: linear-gradient(180deg, #000000e6, #00000073 66%, transparent);
- --brand-videoPlayer-controls-bgColor: linear-gradient(var(--base-color-scale-transparent), #01040966);
+ --brand-videoPlayer-controls-bgColor: #000000bf;
- --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-5);
+ --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-4);

Copy link
Contributor

github-actions bot commented Aug 19, 2024

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@joshfarrant joshfarrant changed the title improve contrast of VideoPlayer focus styles Improve contrast of VideoPlayer focus styles Aug 20, 2024
@joshfarrant joshfarrant changed the title Improve contrast of VideoPlayer focus styles Fix VideoPlayer accessibility issues Aug 20, 2024
@joshfarrant joshfarrant marked this pull request as ready for review August 20, 2024 14:46
@joshfarrant joshfarrant force-pushed the joshfarrant/videoplayer-a11y-improvements branch from 9beb0d8 to f1953af Compare August 29, 2024 08:05
@joshfarrant joshfarrant force-pushed the joshfarrant/videoplayer-a11y-improvements branch from c79c3aa to 5ed8496 Compare September 2, 2024 11:00
@joshfarrant joshfarrant force-pushed the joshfarrant/videoplayer-a11y-improvements branch from 528ef06 to 05a24e4 Compare September 10, 2024 08:53
@joshfarrant joshfarrant force-pushed the joshfarrant/videoplayer-a11y-improvements branch from 05a24e4 to d5fc0a4 Compare September 13, 2024 10:41
Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking great, thanks @joshfarrant.

Something that would be nice to look at in a follow-up is the position of captions. It's quite high at the moment due to the controls bar offset.

Screenshot 2024-12-19 at 09 13 54

@joshfarrant joshfarrant merged commit 621d8ee into main Dec 19, 2024
16 of 17 checks passed
@joshfarrant joshfarrant deleted the joshfarrant/videoplayer-a11y-improvements branch December 19, 2024 15:36
@primer-css primer-css mentioned this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants