From cfb80ab089ac3893f1e746ca4395582fbd6f2d56 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 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; } }; -- 2.25.1