From: Boris Bobrov Date: Sun, 2 Apr 2017 22:52:14 +0000 (+0300) Subject: Change aria-text when state changes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cfb80ab089ac3893f1e746ca4395582fbd6f2d56;p=mediagoblin.git Change aria-text when state changes --- diff --git a/mediagoblin/static/js/audio.js b/mediagoblin/static/js/audio.js index 50d58cd9..06f01b0d 100644 --- a/mediagoblin/static/js/audio.js +++ b/mediagoblin/static/js/audio.js @@ -151,14 +151,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; } };