Okay I got the frame to close using:
Codevar iframes = document.querySelectorAll("1%"); var lastIframe = iframes[iframes.length - 1]; lastIframe.parentNode.removeChild(1%);
Next is to get the YouTube API to the iframe and close the iframe on video end.
Any Suggestions? Anywho tried Youtube api in Krpano iframe?
What is the proper element Id of the YouTube player inside this Iframe? is it "iframe" , "Player1"?
Code
function loadYouTube(iframe){
ytplayer = new YT.Player(iframe, {
events: {
'onStateChange': function(event){
/** Yourube API
-1 (unstarted)
0 (ended)
1 (playing)
2 (paused)
3 (buffering)
5 (video cued)
**/
if (event.data == 1) {full(),
console.log('The player API changed');
}
console.log(event.data)
}
}
});
}
Display More