Update player.js

don't recreate everything just to repeat the song, just change the current time and hit play
This commit is contained in:
GM-Script-Writer-62850 2014-06-03 20:53:08 -04:00
parent dae0538aa0
commit 12f708767e

View file

@ -138,8 +138,11 @@ function init(){
"repeat":false
};
audio.addEventListener("ended",function(){
if(repeat.checked){
audio.currentTime=0;
return audio.play();
}
var next=track;
if(!repeat.checked){
if(shuffle.checked){
next=randInt(0,music.length-1);
}
@ -149,7 +152,6 @@ function init(){
else{
next=0;
}
}
sendEvt(music[next],'click');
},false);
getId('next').addEventListener("click",function(){