️(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:
Manuel Raynaud 2019-08-07 17:52:22 +02:00
parent dfc09b8e04
commit c7b5aa9197
No known key found for this signature in database
GPG Key ID: 06516FC55BD60A39

View File

@ -214,6 +214,7 @@ const ui = {
// Set state
Array.from(this.elements.buttons.play || []).forEach(target => {
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