Player next fixed
This commit is contained in:
parent
82f2624ed5
commit
2dc8b0da49
|
@ -15,7 +15,7 @@ $(function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#player .play').click(function(){
|
$('#player .play').click(function(){
|
||||||
if (! audio.src) return;
|
if (! audio) return;
|
||||||
audio.play();
|
audio.play();
|
||||||
utid = window.setTimeout(updatePlayer, 100);
|
utid = window.setTimeout(updatePlayer, 100);
|
||||||
$('#player .pause').show();
|
$('#player .pause').show();
|
||||||
|
@ -138,6 +138,7 @@ function addToPlaylist(artist, track, length, id) {
|
||||||
playTrack(artist, track, id);
|
playTrack(artist, track, id);
|
||||||
$('#playlist li').removeClass('now-playing');
|
$('#playlist li').removeClass('now-playing');
|
||||||
$(this).addClass('now-playing');
|
$(this).addClass('now-playing');
|
||||||
|
setNext();
|
||||||
})
|
})
|
||||||
if ($('#playlist ul.list li').length == 1) {
|
if ($('#playlist ul.list li').length == 1) {
|
||||||
$('#playlist ul.list li:first').dblclick();
|
$('#playlist ul.list li:first').dblclick();
|
||||||
|
@ -155,7 +156,8 @@ function addAudio(id) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function switchAudio(id) {
|
function switchAudio(id) {
|
||||||
if (typeof(audio) != 'undefined') {
|
if (typeof(audio) != 'undefined' && audio.buffered.length != 0) {
|
||||||
|
console.log(audio, audio.buffered.length);
|
||||||
audio.pause();
|
audio.pause();
|
||||||
audio.currentTime = 0;
|
audio.currentTime = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue