1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Fix iframe load

This commit is contained in:
Daniel 2022-01-25 14:50:48 -03:00
parent 85e59b9f86
commit 18a10d42d2

View file

@ -1317,6 +1317,7 @@ function avideoModalIframeFull(url) {
} }
var avideoModalIframeFullScreenOriginalURL = false; var avideoModalIframeFullScreenOriginalURL = false;
var avideoModalIframeWithClassNameTimeout;
function avideoModalIframeWithClassName(url, className, updateURL) { function avideoModalIframeWithClassName(url, className, updateURL) {
showURL = document.location.href; showURL = document.location.href;
if (updateURL) { if (updateURL) {
@ -1351,15 +1352,14 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
avideoModalIframeFullScreenOriginalURL = false; avideoModalIframeFullScreenOriginalURL = false;
} }
}); });
setTimeout(function () { $('#avideoModalIframeDiv iframe').load(function(){
if ($('#avideoModalIframeDiv iframe').contents().find('body').children().length > 0) { clearTimout(avideoModalIframeWithClassNameTimeout);
// is loaded avideoModalIframeRemove();
avideoModalIframeRemove(); });
} else { avideoModalIframeWithClassNameTimeout = setTimeout(function () {
// is not loaded // is not loaded
url = addGetParam(url, 'avideoIframe', 0); url = addGetParam(url, 'avideoIframe', 0);
document.location = url; document.location = url;
}
}, 5000); }, 5000);
} }