From c7b5aa91970995271c687cac2489173c8975aadf Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 7 Aug 2019 17:52:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F(controls)=20change=20play=20?= =?UTF-8?q?button=20aria-label=20value=20when=20its=20state=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/js/ui.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/ui.js b/src/js/ui.js index 953ecba2..9febab8b 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -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