diff --git a/web/app/assets/images/content/icon_pausebutton.png b/web/app/assets/images/content/icon_pausebutton.png index 0df0af051..3dcd6420f 100644 Binary files a/web/app/assets/images/content/icon_pausebutton.png and b/web/app/assets/images/content/icon_pausebutton.png differ diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 090463280..09649dcd5 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -114,32 +114,30 @@ var showMusicSession = new JK.ShowMusicSession(JK.app); showMusicSession.initialize("<%= @music_session.id %>"); - // remainder of this code is related to playing/pausing the session + // remainder of this code is related to playing/pausing the session var htmlAudio = $(".recording-controls").find('audio').get(0); + var $imgPlayPauseSelector = $("#imgPlayPause"); + var playButtonPath = '/assets/content/icon_playbutton.png'; + var pauseButtonPath = '/assets/content/icon_pausebutton.png'; - function formatTime(time) { - var minutes = Math.floor(time / 60); - var seconds = Math.floor(time % 60); - return minutes.toString() + ":" + (seconds > 9 ? seconds.toString() : '0' + seconds.toString()); - } - + // this updates the current play time $(htmlAudio).on('timeupdate', function() { - $(".recording-current").html(formatTime(htmlAudio.currentTime)); + $(".recording-current").html(context.JK.prettyPrintSeconds (htmlAudio.currentTime)); - // reset icon to play and slider to far left when done + // reset icon to play when done if (percentComplete === 100) { - $("#imgPlayPause").attr('src', '/assets/content/icon_playbutton.png'); + $imgPlayPauseSelector.attr('src', playButtonPath); } }); $("#btnPlayPause").click(function() { if (htmlAudio.paused) { htmlAudio.play(); - $("#imgPlayPause").attr('src', '/assets/content/icon_pausebutton.png'); + $imgPlayPauseSelector.attr('src', pauseButtonPath); } else { htmlAudio.pause(); - $("#imgPlayPause").attr('src', '/assets/content/icon_playbutton.png'); + $imgPlayPauseSelector.attr('src', playButtonPath); } }); }); diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index cd982c0df..cec8f1caa 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -66,8 +66,8 @@