1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00
Oinktube/plugin/Gallery/fullscreen.js
Daniel Neto 7197a238bf update
2023-08-09 08:06:43 -03:00

45 lines
1.2 KiB
JavaScript

let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
window.addEventListener("resize", () => {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
});
$(document).ready(function () {
$('a.galleryLink').click(function (event) {
event.preventDefault();
var id = $(this).attr('videos_id');
startFullScreen(webSiteRootURL + 'v/' + id);
});
$('a.evideo').click(function (event) {
event.preventDefault();
var href = $(this).attr('href');
startFullScreen(href);
});
$('a.hrefLink').click(function (event) {
event.preventDefault();
var link = $(this).attr('href');
startFullScreen(link);
});
$(document).on('keyup', function (evt) {
if (evt.keyCode == 27) {
closeIframe();
}
});
if (typeof playVideoOnBrowserFullscreen !== 'undefined') {
setInterval(function () {
if (!(!window.screenTop && !window.screenY)) {
closeIframe();
}
}, 1000);
}
});
function startFullScreen(link) {
openFullscreenVideo(link, link);
}