From daecc3e1838bc7f592897344cd3751315b0321a9 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Mon, 3 Apr 2017 01:52:14 +0300 Subject: [PATCH] Change aria-text when state changes --- mediagoblin/static/js/audio.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mediagoblin/static/js/audio.js b/mediagoblin/static/js/audio.js index 909307f6..36b4eab2 100644 --- a/mediagoblin/static/js/audio.js +++ b/mediagoblin/static/js/audio.js @@ -155,14 +155,16 @@ var audioPlayer = new Object(); switch (state) { case audioPlayer.PLAYING: - $('.audio-spectrogram .audio-control-play-pause') + el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('paused').addClass('playing') - .text('▮▮'); + .text('▮▮').attr('aria-label', 'Pause'); + el[0].setAttribute('aria-label', 'Pause') break; case audioPlayer.PAUSED: - $('.audio-spectrogram .audio-control-play-pause') + el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('playing').addClass('paused') - .text('▶'); + .text('▶').attr('aria-label', 'Play'); + el[0].setAttribute('aria-label', 'Play') break; } }; -- 2.25.1