mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updated embedded player to send now playing and next sooner
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user