Change aria-text when state changes
authorBoris Bobrov <breton@cynicmansion.ru>
Sun, 2 Apr 2017 22:52:14 +0000 (01:52 +0300)
committerBoris Bobrov <breton@cynicmansion.ru>
Tue, 23 May 2017 08:28:46 +0000 (11:28 +0300)
mediagoblin/static/js/audio.js

index 50d58cd9b066263152062f88b15ded4893f6d2f0..06f01b0d948012b03aa798c13d58edd61afb41c8 100644 (file)
@@ -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;
         }
     };