1
0
Fork 0

Player Repeat. closes #38

This commit is contained in:
magnolia-fan 2011-04-13 01:28:46 +04:00
parent 3a40da1dbe
commit 74b4c1e04a
1 changed files with 5 additions and 3 deletions

View File

@ -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();
}