var PlayList={ urlBase:OC.linkTo('media','ajax/api.php')+'?action=play&path=', current:-1, items:[], player:null, volume:0.8, next:function(){ var next=PlayList.current+1; if(next>=PlayList.items.length){ next=0; } PlayList.play(next); PlayList.render(); }, previous:function(){ var next=PlayList.current-1; if(next<0){ next=PlayList.items.length-1; } PlayList.play(next); PlayList.render(); }, play:function(index,time,ready){ if(index==null){ index=PlayList.current; } if(index>-1 && index0){ var previous=index-1; }else{ var previous=PlayList.items.length-1; } if(index+1