Updated embedded player to send now playing and next sooner

This commit is contained in:
Kasper Rynning-Tønnesen
2017-06-15 12:59:50 +02:00
parent a0c1fa293a
commit 7e0b1d9034
3 changed files with 11 additions and 11 deletions

View File

@@ -29,6 +29,15 @@ var Player = {
} catch(e){}
Helper.log("video_id variable: " + video_id);
Helper.log("---------------------------------");
if(embed && obj.np) {
if(window.parentWindow && 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});
}
}
}
if(!obj.np){
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!";
@@ -77,15 +86,6 @@ var Player = {
song_title = obj.np[0].title;
duration = obj.np[0].duration;
if(embed) {
if(window.parentWindow && 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});
}
}
}
if(mobile_beginning && Helper.mobilecheck() && seekTo === 0 && !chromecastAvailable) {
seekTo = 1;
}