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

Allow play embed without iframe

This commit is contained in:
DanielnetoDotCom 2021-01-14 12:10:08 -03:00
parent 24235d8900
commit 939ad22ab1
4 changed files with 27 additions and 12 deletions

View file

@ -57,6 +57,7 @@ class YouPHPFlix2 extends PluginAbstract {
$obj->backgroundRGB = "20,20,20";
$obj->landscapePosters = true;
$obj->playVideoOnFullscreen = true;
$obj->playVideoOnFullscreenOnIframe = true;
$obj->youtubeModeOnFullscreen = false;
$obj->paidOnlyLabelOverPoster = false;
$obj->titleLabel = true;
@ -115,10 +116,16 @@ class YouPHPFlix2 extends PluginAbstract {
global $global;
$js = '';
if(!empty($obj->playVideoOnFullscreen) && !isSerie()){
$js = '<script>var playVideoOnFullscreen = true</script>';
}else{
$js = '<script>var playVideoOnFullscreen = false</script>';
if (!empty($obj->playVideoOnFullscreenOnIframe) && !isSerie()) {
$js .= '<script>$(function () { if(typeof linksToFullscreen === \'function\'){ linksToFullscreen(\'a.galleryLink\'); } });</script>';
$js .= '<script>var playVideoOnFullscreen = 1</script>';
} else
if (!empty($obj->playVideoOnFullscreen) && !isSerie()) {
$js .= '<script>$(function () { if(typeof linksToEmbed === \'function\'){ linksToEmbed(\'a.galleryLink\'); } });</script>';
$js .= '<script>var playVideoOnFullscreen = 2</script>';
} else{
$js .= '<script>var playVideoOnFullscreen = false</script>';
}
$js .= '<script src="' . $global['webSiteRootURL'] . 'plugin/YouPHPFlix2/view/js/fullscreen.js"></script>';
return $js;

View file

@ -1,5 +1,5 @@
$(document).ready(function () {
linksToFullscreen('a.canWatchPlayButton');
transformLinksToEmbed('a.canWatchPlayButton');
$(document).on('keyup', function (evt) {
if (evt.keyCode == 27) {
closeFlixFullScreen();
@ -8,6 +8,14 @@ $(document).ready(function () {
});
function transformLinksToEmbed(selector){
if(playVideoOnFullscreen === 1 && typeof linksToFullscreen === 'function'){
linksToFullscreen(selector);
}else if (playVideoOnFullscreen === 2 && typeof linksToEmbed === 'function'){
linksToEmbed(selector);
}
}
var flixFullScreenActive = false;
function flixFullScreen(link, url) {

View file

@ -101,7 +101,7 @@ function startModeFlix(container) {
});
$(container + ".thumbsImage").attr('startModeFlix', 1);
if(typeof linksToFullscreen == 'function'){
linksToFullscreen(container + ' a.canWatchPlayButton');
if(typeof transformLinksToEmbed == 'function'){
transformLinksToEmbed(container + ' a.canWatchPlayButton');
}
}

View file

@ -259,15 +259,15 @@ $percent = 90;
});
lazyImage();
if (typeof linksToFullscreen === 'function') {
linksToFullscreen('a.galleryLink');
linksToFullscreen('a.canWatchPlayButton');
if (typeof transformLinksToEmbed === 'function') {
transformLinksToEmbed('a.galleryLink');
transformLinksToEmbed('a.canWatchPlayButton');
}
});
setTimeout(function () {
lazyImage();
if (typeof linksToFullscreen === 'function') {
linksToFullscreen('a.galleryLink');
if (typeof transformLinksToEmbed === 'function') {
transformLinksToEmbed('a.galleryLink');
}
}, 500);
});