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:
parent
24235d8900
commit
939ad22ab1
4 changed files with 27 additions and 12 deletions
|
@ -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->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()) {
|
if (!empty($obj->playVideoOnFullscreen) && !isSerie()) {
|
||||||
$js = '<script>var playVideoOnFullscreen = true</script>';
|
$js .= '<script>$(function () { if(typeof linksToEmbed === \'function\'){ linksToEmbed(\'a.galleryLink\'); } });</script>';
|
||||||
|
$js .= '<script>var playVideoOnFullscreen = 2</script>';
|
||||||
} else{
|
} else{
|
||||||
$js = '<script>var playVideoOnFullscreen = false</script>';
|
$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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue