1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-02 09:11:54 +02:00

fix: make Playback Rate control work better with screen readers (#7193)

Add an aria-describedby to the playback rate button.

Improves behavior of #7121.
This commit is contained in:
Owen Edwards 2021-04-20 16:11:29 -07:00 committed by GitHub
parent 2c6e4397bb
commit 17919ce77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
@ -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'
});