Skip to content

Commit

Permalink
fix: make Playback Rate control work better with screen readers (vide…
Browse files Browse the repository at this point in the history
…ojs#7193)

Add an aria-describedby to the playback rate button.

Improves behavior of videojs#7121.
  • Loading branch information
OwenEdwards authored Apr 20, 2021
1 parent 2c6e439 commit 17919ce
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class PlaybackRateMenuButton extends MenuButton {
constructor(player, options) {
super(player, options);

this.menuButton_.el_.setAttribute('aria-describedby', this.labelElId_);

this.updateVisibility();
this.updateLabel();

Expand All @@ -42,8 +44,11 @@ class PlaybackRateMenuButton extends MenuButton {
createEl() {
const el = super.createEl();

this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_;

this.labelEl_ = Dom.createEl('div', {
className: 'vjs-playback-rate-value',
id: this.labelElId_,
innerHTML: '1x'
});

Expand Down

0 comments on commit 17919ce

Please sign in to comment.