Hello everyone,
I'm not sure if it's just my copy of Safari (Lion) or not, but for some reason the following doesn't work:
It's suppose to move the playlist to the next song. I don't get any errors, it just doesn't move i. It works in every other browser, just not Safari, which is weird because it use to before.
Any ideas?
I'm not sure if it's just my copy of Safari (Lion) or not, but for some reason the following doesn't work:
Code:
$(document).ready(function(){
var audio=document.querySelector("audio");
audio.src="playlists/music/"+song[i];
audio.volume = audio.volume - .6;
audio.load();
audio.play();
$("#nowplaying").text(song[i]);
$("#next").text(song[i+1]);
//});
audio.addEventListener('ended',function(){
//alert(i);
audio=document.querySelector("audio");
audio.src="playlists/music/"+song[i+1];
//alert(song[i]);
audio.load();
audio.play();
i++;
//alert(song.length);
//alert(i);
$("#song").text("playlists/music/"+song[i]);
$("#nowplaying").text(song[i]);
$("#next").text(song[i+1]);
if(i==song.length){
i=0;
audio.src="playlists/music/"+song[i];
$("#song").text("playlists/music/"+song[i]);
$("#nowplaying").text(song[i]);
$("#next").text(song[i+1]);
}
},false);
});
});
Any ideas?
Comment