1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 10:49:36 +02:00

fix iframe

This commit is contained in:
Daniel 2022-02-22 21:44:26 -03:00
parent 5e81d64ffd
commit 301783ec50

View file

@ -1357,6 +1357,9 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
try {
$('#avideoModalIframe').load(function () {
contentLoaded = true;
console.log('avideoModalIframeWithClassName content loaded 1');
clearTimout(avideoModalIframeWithClassNameTimeout);
avideoModalIframeRemove();
});
} catch (e) {
}
@ -1364,16 +1367,17 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
if($('#avideoModalIframe').contents().find("body").length){
contentLoaded = true;
}
if(contentLoaded){
console.log('avideoModalIframeWithClassName content loaded 2');
clearTimout(avideoModalIframeWithClassNameTimeout);
avideoModalIframeRemove();
}else{
avideoModalIframeWithClassNameTimeout = setTimeout(function () {
// is not loaded
url = addGetParam(url, 'avideoIframe', 0);
document.location = url;
}, 5000);
if(contentLoaded){
console.log('avideoModalIframeWithClassName content loaded');
clearTimout(avideoModalIframeWithClassNameTimeout);
avideoModalIframeRemove();
}
}, 1000);
}