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

Fix reload

This commit is contained in:
Daniel 2022-02-22 16:01:02 -03:00
parent 856fdcbf1a
commit 6810fb4690

View file

@ -1337,7 +1337,7 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
html += '<button class="btn btn-default pull-left" onclick="avideoModalIframeFullScreenClose();">'; html += '<button class="btn btn-default pull-left" onclick="avideoModalIframeFullScreenClose();">';
html += '<i class="fas fa-chevron-left"></i>'; html += '<i class="fas fa-chevron-left"></i>';
html += '</button><img src="' + webSiteRootURL + 'videos/userPhoto/logo.png" class="img img-responsive " style="max-height:34px;"></div>'; html += '</button><img src="' + webSiteRootURL + 'videos/userPhoto/logo.png" class="img img-responsive " style="max-height:34px;"></div>';
html += '<iframe frameBorder="0" class="animate__animated animate__bounceInDown" src="' + url + '" allow="camera *;microphone *" ></iframe>'; html += '<iframe id="avideoModalIframe" frameBorder="0" class="animate__animated animate__bounceInDown" src="' + url + '" allow="camera *;microphone *" ></iframe>';
var span = document.createElement("span"); var span = document.createElement("span");
span.innerHTML = html; span.innerHTML = html;
swal({ swal({
@ -1353,13 +1353,20 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
} }
}); });
setTimeout(function () { setTimeout(function () {
var contentLoaded = false;
try { try {
$('body > div.swal-overlay iframe').load(function () { $('#avideoModalIframe').load(function () {
clearTimout(avideoModalIframeWithClassNameTimeout); contentLoaded = true;
avideoModalIframeRemove();
}); });
} catch (e) { } catch (e) {
if($('#avideoModalIframe').contents().find("body").length){
contentLoaded = true;
}
}
if(contentLoaded){
console.log('avideoModalIframeWithClassName content loaded');
clearTimout(avideoModalIframeWithClassNameTimeout);
avideoModalIframeRemove();
} }
avideoModalIframeWithClassNameTimeout = setTimeout(function () { avideoModalIframeWithClassNameTimeout = setTimeout(function () {
// is not loaded // is not loaded