♿️(controls) change play button aria-label value when its state change
The aria-label attribute set on all play buttons does not change according the player state. When the video is playing, the aria-label should change to pause otherwise screen reader will not detect that this button now can be used to pause the video.
This commit is contained in:
parent
dfc09b8e04
commit
c7b5aa9197
@ -214,6 +214,7 @@ const ui = {
|
|||||||
// Set state
|
// Set state
|
||||||
Array.from(this.elements.buttons.play || []).forEach(target => {
|
Array.from(this.elements.buttons.play || []).forEach(target => {
|
||||||
Object.assign(target, { pressed: this.playing });
|
Object.assign(target, { pressed: this.playing });
|
||||||
|
target.setAttribute('aria-label', i18n.get(this.playing ? 'pause' : 'play', this.config));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Only update controls on non timeupdate events
|
// Only update controls on non timeupdate events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user