mirror of
https://github.com/videojs/video.js.git
synced 2024-12-10 11:10:19 +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:
parent
2c6e4397bb
commit
17919ce77b
@ -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'
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user