mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issue with next song not being sent to embedder
This commit is contained in:
2
server/public/assets/dist/embed.min.js
vendored
2
server/public/assets/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
server/public/assets/dist/main.min.js
vendored
2
server/public/assets/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -21,21 +21,15 @@ var List = {
|
|||||||
if((!offline || (offline && !msg.shuffled)) && !(offline && prev_chan_list == chan)){
|
if((!offline || (offline && !msg.shuffled)) && !(offline && prev_chan_list == chan)){
|
||||||
prev_chan_list = chan;
|
prev_chan_list = chan;
|
||||||
List.populate_list(msg.playlist);
|
List.populate_list(msg.playlist);
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
} else if(offline && prev_chan_list == chan && full_playlist != undefined && !msg.shuffled){
|
} else if(offline && prev_chan_list == chan && full_playlist != undefined && !msg.shuffled){
|
||||||
List.populate_list(full_playlist, true);
|
List.populate_list(full_playlist, true);
|
||||||
if(chromecastAvailable){
|
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "added":
|
case "added":
|
||||||
List.added_song(msg.value);
|
List.added_song(msg.value);
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "deleted":
|
case "deleted":
|
||||||
List.deleted_song(msg.value, msg.removed);
|
List.deleted_song(msg.value, msg.removed);
|
||||||
@@ -43,16 +37,12 @@ var List = {
|
|||||||
case "vote":
|
case "vote":
|
||||||
if(!offline){
|
if(!offline){
|
||||||
List.voted_song(msg.value, msg.time);
|
List.voted_song(msg.value, msg.time);
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "song_change":
|
case "song_change":
|
||||||
if(window.location.pathname != "/") List.song_change(msg.time, msg.remove);
|
if(window.location.pathname != "/") List.song_change(msg.time, msg.remove);
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -365,9 +355,7 @@ var List = {
|
|||||||
//if(removed) {
|
//if(removed) {
|
||||||
$("#"+deleted).remove();
|
$("#"+deleted).remove();
|
||||||
full_playlist.splice(List.getIndexOfSong(deleted), 1);
|
full_playlist.splice(List.getIndexOfSong(deleted), 1);
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
@@ -379,9 +367,7 @@ var List = {
|
|||||||
} else if($("#wrapper").children().length > List.page + List.can_fit){
|
} else if($("#wrapper").children().length > List.page + List.can_fit){
|
||||||
$($("#wrapper").children()[List.page + (List.can_fit - 1)]).css("display", "inline-block");
|
$($("#wrapper").children()[List.page + (List.can_fit - 1)]).css("display", "inline-block");
|
||||||
}
|
}
|
||||||
if(chromecastAvailable){
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ var Player = {
|
|||||||
if(embed) {
|
if(embed) {
|
||||||
if(window.parentWindow && window.parentOrigin) {
|
if(window.parentWindow && window.parentOrigin) {
|
||||||
window.parentWindow.postMessage({type: "np", title: obj.np[0].title}, window.parentOrigin);
|
window.parentWindow.postMessage({type: "np", title: obj.np[0].title}, window.parentOrigin);
|
||||||
|
if(full_playlist.length > 0) {
|
||||||
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user