}
if(typeof PlayList==='undefined'){
if(typeof localStorage !== 'undefined'){
- if(localStorage.hasOwnProperty('oc_playlist_items')){
+ if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_items')){
loadPlayer();
}
}
Collection.hide();
});
var tab=window.location.href.slice(window.location.href.indexOf('#') + 1);
- if(tab=='collection'){
- $('#plugins a[href="#collection"]').trigger('click');
- }
+ PlayList.init('mp3',function(){
+ if(tab=='collection'){
+ $('#plugins a[href="#collection"]').trigger('click');
+ }
+ });
OC.search.customResults.Music=function(row,item){
var parts=item.link.substr(item.link.indexOf('#')+1).split('&');
var data={};
});
row.find('div.name').append(button);
}
- PlayList.init();
});
PlayList.player.jPlayer("setMedia", PlayList.items[PlayList.current]);
PlayList.items[index].playcount++;
PlayList.player.jPlayer("play");
- localStorage.setItem('oc_playlist_current',index);
- localStorage.setItem('oc_playlist_playing','true');
- if(index>=0){
+ localStorage.setItem(oc_current_user+'oc_playlist_current',index);
+ localStorage.setItem(oc_current_user+'oc_playlist_playing','true');
+ if(index>0){
var previous=index-1;
}else{
var previous=PlayList.items.length-1;
},
save:function(){
if(typeof localStorage !== 'undefined'){
- localStorage.setItem('oc_playlist_items',JSON.stringify(PlayList.items));
+ localStorage.setItem(oc_current_user+'oc_playlist_items',JSON.stringify(PlayList.items));
}
},
load:function(){
if(typeof localStorage !== 'undefined'){
- if(localStorage.hasOwnProperty('oc_playlist_items')){
- PlayList.items=JSON.parse(localStorage.getItem('oc_playlist_items'));
- PlayList.current=parseInt((localStorage.getItem('oc_playlist_current')));
- if(JSON.parse(localStorage.getItem('oc_playlist_playing'))){
+ if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_items')){
+ PlayList.items=JSON.parse(localStorage.getItem(oc_current_user+'oc_playlist_items'));
+ PlayList.current=parseInt((localStorage.getItem(oc_current_user+'oc_playlist_current')));
+ if(JSON.parse(localStorage.getItem(oc_current_user+'oc_playlist_playing'))){
PlayList.play();
}
PlayList.render();
<?php endforeach; ?>
<script type="text/javascript">
var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+ var oc_current_user = '<?php echo OC_User::getUser() ?>';
// </script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
<?php endforeach; ?>
<script type="text/javascript">
var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+ var oc_current_user = '<?php echo OC_User::getUser() ?>';
// </script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>