setInterval dirty check not working
-
Hi support
In testing the plugin, when a youtube iframe tag is detected, and the “onYouTubeIframeAPIReady” event is missed, the dirty check to call the yotuwp.init() function is not working.
In testing by overriding the javascript, the window.YT.loaded condition is never returning true, thus the init function is never called. It could be that because the loaded property is not documented it has been removed. Changing window.YT.loaded to window.YT.Player addressed the issue for myself. You could even check if window.YT.Player is a function if you wanted the extra check.
var yotu_check = setInterval(function (){
if (typeof window.YT !== 'undefined' && window.YT.loaded)
{
if(!yotuwp.ready) yotuwp.init();
}
}, 10);
- You must be logged in to reply to this topic.