Youtube Iframe: Onyoutubeplayerapiready() Not Called May 03, 2024 Post a Comment I have a page with an iframe which load a youtube video (the src of iframe is modified in runtime). I based on code by Rob W provided in different answers on this topic Solution 1: onYouTubePlayerAPIReady should be on the window object.try:window.onYouTubePlayerAPIReady = function() { alert('called onYouTubePlayerAPIReady'); ytIframeplayer = newYT.Player('browser', { events: { "onStateChange": stopCycle } }); } CopySolution 2: It seems like you're not closing the functions off correctly. The last } is closing off onYouTubePlayerAPIReady(), not dispose_ytplayer().Baca JugaJavascript Iframe "top." Multiple Divs?Modal Close Button Not WorkingTrackballcontrols.js: This.domelement.addeventlistener Is Not A FunctionFixed code:functiondispose_ytplayer() { (function(){ var s = document.createElement("script"); s.src = "http://www.youtube.com/player_api"; var before = document.getElementsByTagName("script")[0]; before.parentNode.insertBefore(s, before); })(); alert('called yt_dispose'); var ytIframeplayer; functiononYouTubePlayerAPIReady() { alert('called onYouTubePlayerAPIReady'); ytIframeplayer = newYT.Player('browser', { events: { "onStateChange": stopCycle } }); } } Copy Share You may like these postsCast_sender.js Error: Failed To Load Resource: Net::err_failed In ChromeHow To Identify Volume Change In Youtube PlayerYoutube Api Not Ready SometimesPossible To Add An Onclick Event To A Youtube Iframe? Post a Comment for "Youtube Iframe: Onyoutubeplayerapiready() Not Called"
Post a Comment for "Youtube Iframe: Onyoutubeplayerapiready() Not Called"