diff --git a/public/javascripts/player.js b/public/javascripts/player.js index f8cc0d2..fa13106 100644 --- a/public/javascripts/player.js +++ b/public/javascripts/player.js @@ -38,7 +38,7 @@ $(function(){ playPrev(); }).disableTextSelect(); $('#player .next').click(function(){ - playNext(); + playNext(false); }).disableTextSelect(); $('#player .shuffle, #player .repeat').click(function(){ $(this).toggleClass('on'); @@ -53,7 +53,7 @@ function updatePlayer() { duration = audio.duration; cur_time = audio.currentTime; if (cur_time == duration) { - playNext(); + playNext(true); } loaded = 0; if ((audio.buffered != undefined) && (audio.buffered.length != 0)) { @@ -95,7 +95,9 @@ function playNext(auto) { $('#playlist ul.list li').rand().dblclick(); } if ($('#playlist ul.list li.now-playing').next().length == 0) { - $('#playlist ul.list li:first').dblclick(); + if ((auto && $('#player .repeat').hasClass('on')) || !auto) { + $('#playlist ul.list li:first').dblclick(); + } } else { $('#playlist ul.list li.now-playing').next().dblclick(); }