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

Make Playback Rate control work with screen readers - fixes #7121 #7193

Conversation

OwenEdwards
Copy link
Member

@OwenEdwards OwenEdwards commented Apr 19, 2021

Description

The Playback Rate control is a MenuButton, but has been modified from the standard MenuButton operation so that clicking on the button just switches to the next playback rate without displaying the menu. Also, the label of the button visually includes the current playback rate but that visual indication is not included in the accessible name or description of the button. As a result, screen reader users cannot perceive the current setting of the control, and do not realize that they actually can change the setting (by activating the button) since activating the button does not open a menu but also does not announce the rate change.

This temporary fix associates the current rate selection display in the button with the button itself using aria-describedby, so that it is announced by screen readers when the button receives focus, but is not included as part of the name/label of the button (which would be confusing). The new rate is also announced by the screen reader when the setting is changed by activating the button.

This fixes #7121.

Long term, the button needs to be fixed to correctly operate as a menu button for screen reader users, but for now, this change doesn't change any of the DOM structure or any of the behavior for sighted mouse users or sighted keyboard-only users.

Specific Changes proposed

Add a unique HTML ID to the visible rate label in the Playback Rate menu button control, and associate it with the button via aria-describedby.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome + JAWS)
    • Unit Tests updated or fixed
    • Docs/guides updated
  • Reviewed by Two Core Contributors

@OwenEdwards OwenEdwards requested a review from gkatsev April 19, 2021 20:48
@gkatsev
Copy link
Member

gkatsev commented Apr 20, 2021

Thanks, Owen, looks like a great workaround for now.

@gkatsev gkatsev merged commit 17919ce into videojs:main Apr 20, 2021
@gkatsev
Copy link
Member

gkatsev commented Apr 20, 2021

Leaving #7121 open to track replacement/updates for the playback rate menu button.

edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
…ojs#7193)

Add an aria-describedby to the playback rate button.

Improves behavior of videojs#7121.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screen Readers do not announce new playback rate after switching to new rate using keyboard only commands
2 participants