diff options
author | Manuel Raynaud <manu@raynaud.io> | 2019-08-07 17:52:22 +0200 |
---|---|---|
committer | Manuel Raynaud <manu@raynaud.io> | 2019-08-07 18:00:02 +0200 |
commit | c7b5aa91970995271c687cac2489173c8975aadf (patch) | |
tree | 88230bae1a1046be4d1658dd1d4c91c3c58d4fda /src/js | |
parent | dfc09b8e04f6e4829c29a68106eb4af5be76a2ff (diff) | |
download | plyr-c7b5aa91970995271c687cac2489173c8975aadf.tar.lz plyr-c7b5aa91970995271c687cac2489173c8975aadf.tar.xz plyr-c7b5aa91970995271c687cac2489173c8975aadf.zip |
♿️(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.
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/ui.js | 1 |
1 files changed, 1 insertions, 0 deletions
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 |