Make Playback Rate control work with screen readers - fixes #7121 #7193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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