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

View file

@ -1,5 +1,5 @@
$(document).ready(function () { $(document).ready(function () {
linksToFullscreen('a.canWatchPlayButton'); transformLinksToEmbed('a.canWatchPlayButton');
$(document).on('keyup', function (evt) { $(document).on('keyup', function (evt) {
if (evt.keyCode == 27) { if (evt.keyCode == 27) {
closeFlixFullScreen(); 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; var flixFullScreenActive = false;
function flixFullScreen(link, url) { function flixFullScreen(link, url) {

View file

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

View file

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