1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 10:49:36 +02:00
This commit is contained in:
Daniel Neto 2023-11-07 11:13:34 -03:00
parent 26d71e513a
commit cda6a27ca9
9 changed files with 147 additions and 163 deletions

View file

@ -39,6 +39,7 @@ class CustomizeAdvanced extends PluginAbstract {
'useFFMPEGToGenerateThumbs', 'useFFMPEGToGenerateThumbs',
'makeVideosInactiveAfterEncode', 'makeVideosInactiveAfterEncode',
'makeVideosUnlistedAfterEncode', 'makeVideosUnlistedAfterEncode',
'embedBackgroundColor',
); );
} }
@ -70,7 +71,6 @@ class CustomizeAdvanced extends PluginAbstract {
'doNotShowEncoderButton', 'doNotShowEncoderButton',
'encoderButtonLabel', 'encoderButtonLabel',
'doNotShowEmbedButton', 'doNotShowEmbedButton',
'embedBackgroundColor',
'embedButtonLabel', 'embedButtonLabel',
'embedCodeTemplate', 'embedCodeTemplate',
'embedCodeTemplateObject', 'embedCodeTemplateObject',

View file

@ -89,11 +89,6 @@ $objectToReturnToParentIframe->posterURL = $poster;
margin: 0 !important; margin: 0 !important;
overflow:hidden; overflow:hidden;
} }
<?php
if (!empty($customizedAdvanced->embedBackgroundColor)) {
echo "body {background-color: $customizedAdvanced->embedBackgroundColor;}";
}
?>
</style> </style>
<script> <script>
var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>'; var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>';

View file

@ -68,11 +68,6 @@ $poster = Live::getPosterImage($livet['users_id'], $_REQUEST['live_servers_id'],
margin: 0 !important; margin: 0 !important;
overflow:hidden; overflow:hidden;
} }
<?php
if (!empty($customizedAdvanced->embedBackgroundColor)) {
echo "body {background-color: $customizedAdvanced->embedBackgroundColor;}";
}
?>
</style> </style>
<script> <script>
var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>'; var webSiteRootURL = '<?php echo $global['webSiteRootURL']; ?>';

View file

@ -73,12 +73,6 @@ $poster = Live::getPosterImage($livet['users_id'], $_REQUEST['live_servers_id'],
body { body {
padding: 0 !important; padding: 0 !important;
margin: 0 !important; margin: 0 !important;
<?php
if (!empty($customizedAdvanced->embedBackgroundColor)) {
echo "background-color: $customizedAdvanced->embedBackgroundColor;";
}
?>
} }
</style> </style>
<script> <script>

View file

@ -5,7 +5,8 @@ if(!empty($_REQUEST['Chat']) || preg_match('/plugin.Chat2/', $uri)){
} }
_session_start(); _session_start();
if (!function_exists('getColorValue')) { if (!function_exists('getColorValue')) {
function getColorValue($requestKey) { function getColorValue($requestKey)
{
if (!empty($_REQUEST[$requestKey])) { if (!empty($_REQUEST[$requestKey])) {
$_SESSION[$requestKey] = $_REQUEST[$requestKey]; $_SESSION[$requestKey] = $_REQUEST[$requestKey];
return substr($_REQUEST[$requestKey], 10, 6); return substr($_REQUEST[$requestKey], 10, 6);
@ -33,85 +34,104 @@ $textColorDark = getColorValue('textColorDark');
$textColorHigh = getColorValue('textColorHigh'); $textColorHigh = getColorValue('textColorHigh');
?> ?>
<style> <style>
#CloseButtonInVideo, .offline-button, .loop-button,.autoplay-button { <?php if (isAVideoMobileApp()) : ?>
#CloseButtonInVideo,
.offline-button,
.loop-button,
.autoplay-button {
display: none !important; display: none !important;
} }
/* Overwrite Bootstrap styles <?php echo $uri; ?> */
<?php if ($bgColor): ?>
body,
.table>thead>tr>td,
.table>thead>tr>th,
.btn-default,
.alert, .row,
.bootgrid-table td.loading,
.bootgrid-table td.no-results,
.modal-content, .list-group-item, .dropdown-menu, .well, .panel-default {
background-color: #<?php echo $bgColor; ?> !important;
}
<?php endif; ?> <?php endif; ?>
<?php if ($bgColor1): ?> /* Overwrite Bootstrap styles <?php echo $uri; ?> */
.panel, .panel-default>.panel-heading, <?php if ($bgColor) : ?>body,
.table>thead>tr>td,
.table>thead>tr>th,
.btn-default,
.alert,
.row,
.bootgrid-table td.loading,
.bootgrid-table td.no-results,
.modal-content,
.list-group-item,
.dropdown-menu,
.well,
.panel-default {
background-color: #<?php echo $bgColor; ?> !important;
}
<?php endif; ?><?php if ($bgColor1) : ?>.panel,
.panel-default>.panel-heading,
.table, .table,
.btn-primary, .btn-primary,
.alert-info, .alert-info,
.table-striped>tbody>tr:hover { .table-striped>tbody>tr:hover {
background-color: #<?php echo $bgColor1; ?> !important; background-color: #<?php echo $bgColor1; ?> !important;
} }
<?php endif; ?>
<?php if ($bgColor2): ?> <?php endif; ?><?php if ($bgColor2) : ?>.panel-footer,
.panel-footer,
.table>tfoot>tr>th, .table>tfoot>tr>th,
.btn-success, .btn-success,
.alert-success, .alert-success,
.table-striped>tbody>tr:nth-of-type(odd) { .table-striped>tbody>tr:nth-of-type(odd) {
background-color: #<?php echo $bgColor2; ?> !important; background-color: #<?php echo $bgColor2; ?> !important;
} }
<?php endif; ?>
<?php if ($bgColorAppBar): ?> <?php endif; ?><?php if ($bgColorAppBar) : ?>.panel-danger,
.panel-danger,
.btn-danger, .btn-danger,
.alert-danger, .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover { .alert-danger,
.nav-tabs>li.active>a,
.nav-tabs>li.active>a:focus,
.nav-tabs>li.active>a:hover {
background-color: #<?php echo $bgColorAppBar; ?> !important; background-color: #<?php echo $bgColorAppBar; ?> !important;
} }
<?php endif; ?>
<?php if ($bgColorAppBarDarker): ?> <?php endif; ?><?php if ($bgColorAppBarDarker) : ?>.panel-warning,
.panel-warning,
.btn-warning, .btn-warning,
.alert-warning,.img-thumbnail, .navbar-default, .dropdown-menu>li>a:focus, .alert-warning,
.dropdown-menu>li>a:hover, .nav-tabs>li>a:hover, .panel-heading, .swal-modal, .popover-title { .img-thumbnail,
.navbar-default,
.dropdown-menu>li>a:focus,
.dropdown-menu>li>a:hover,
.nav-tabs>li>a:hover,
.panel-heading,
.swal-modal,
.popover-title {
background-color: #<?php echo $bgColorAppBarDarker; ?> !important; background-color: #<?php echo $bgColorAppBarDarker; ?> !important;
} }
<?php endif; ?>
<?php if ($textColor): ?> <?php endif; ?><?php if ($textColor) : ?>.panel-default>.panel-heading,
.panel-default>.panel-heading,
.table>thead>tr>th, .table>thead>tr>th,
.btn-default, .btn-default,
.alert, .list-group-item, .dropdown-menu, .dropdown-menu>li>a { .alert,
.list-group-item,
.dropdown-menu,
.dropdown-menu>li>a {
color: #<?php echo $textColor; ?> !important; color: #<?php echo $textColor; ?> !important;
} }
<?php endif; ?>
<?php if ($textColorDark): ?> <?php endif; ?><?php if ($textColorDark) : ?>.panel,
.panel,
.table, .table,
.btn-primary, .btn-primary,
.alert-info, .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover, .alert-info,
.nav-tabs>li>a:hover, .swal-title, .swal-text, .swal-footer { .nav-tabs>li.active>a,
.nav-tabs>li.active>a:focus,
.nav-tabs>li.active>a:hover,
.nav-tabs>li>a:hover,
.swal-title,
.swal-text,
.swal-footer {
color: #<?php echo $textColorDark; ?> !important; color: #<?php echo $textColorDark; ?> !important;
} }
<?php endif; ?>
<?php if ($textColorHigh): ?> <?php endif; ?><?php if ($textColorHigh) : ?>.panel-footer,
.panel-footer,
.table>tfoot>tr>th, .table>tfoot>tr>th,
.btn-success, .btn-success,
.alert-success, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover { .alert-success,
.dropdown-menu>li>a:focus,
.dropdown-menu>li>a:hover {
color: #<?php echo $textColorHigh; ?> !important; color: #<?php echo $textColorHigh; ?> !important;
} }
<?php endif; ?> <?php endif; ?>
</style> </style>

View file

@ -171,12 +171,6 @@ PlayerSkins::getStartPlayerJS($str);
padding: 0 !important; padding: 0 !important;
margin: 0 !important; margin: 0 !important;
overflow: hidden; overflow: hidden;
<?php
if (!empty($customizedAdvanced->embedBackgroundColor)) {
echo "background-color: $customizedAdvanced->embedBackgroundColor !important;";
}
?>
} }
.vjs-control-bar{ .vjs-control-bar{
z-index: 1; z-index: 1;

View file

@ -114,6 +114,8 @@ if (!isVideo()) {
$metaDescription .= getSEOComplement(["addAutoPrefix" => false]); $metaDescription .= getSEOComplement(["addAutoPrefix" => false]);
$metaDescription = getSEODescription($metaDescription); $metaDescription = getSEODescription($metaDescription);
echo '<meta name="description" content="' . $metaDescription . '">'; echo '<meta name="description" content="' . $metaDescription . '">';
}else if(isEmbed()){
echo '<style>body{background-color: #000;}</style>';
} }
//var_dump($metaDescription);var_dump(debug_backtrace());exit; //var_dump($metaDescription);var_dump(debug_backtrace());exit;
if (empty($advancedCustom->disableAnimations)) { if (empty($advancedCustom->disableAnimations)) {

View file

@ -889,7 +889,7 @@ function playNext(url) {
webSocketVideos_id = mediaId; webSocketVideos_id = mediaId;
$('video, #mainVideo').attr('poster', response.poster); $('video, #mainVideo').attr('poster', response.poster);
player.poster(response.poster); player.poster(response.poster);
history.pushState(null, null, url); avideoPushState(url);
$('.topInfoTitle, title').text(response.title); $('.topInfoTitle, title').text(response.title);
$('#topInfo img').attr('src', response.userPhoto); $('#topInfo img').attr('src', response.userPhoto);
$('#topInfo a').attr('href', response.url); $('#topInfo a').attr('href', response.url);
@ -1319,12 +1319,25 @@ function avideoAlertHTMLText(title, msg, type) {
} }
function avideoModalIframeClose() { function avideoModalIframeClose() {
//console.log('avideoModalIframeClose'); if (fullscreenIframe) {
fullscreenIframe.remove();
fullscreenIframe = null;
$('body').removeClass('fullscreen');
// Revert the browser's address bar to the original URL
if (originalURL) {
history.pushState({}, null, originalURL);
}
} else {
if (typeof swal === 'function') {
$('.swal-overlay iframe').attr('src', 'about:blank');
try { try {
swal.close(); swal.close();
} catch (e) { } catch (e) {
} }
}
}
try { try {
if (inIframe()) { if (inIframe()) {
window.parent.swal.close(); window.parent.swal.close();
@ -1334,6 +1347,14 @@ function avideoModalIframeClose() {
} }
} }
function avideoModalIframeFullScreenClose() {
avideoModalIframeClose();
}
function closeFullscreenVideo() {
avideoModalIframeClose();
}
function avideoModalIframeCloseToastSuccess(msg) { function avideoModalIframeCloseToastSuccess(msg) {
avideoModalIframeClose(); avideoModalIframeClose();
avideoToastSuccess(msg); avideoToastSuccess(msg);
@ -1399,33 +1420,6 @@ function avideoModalIframeFullScreenMaximize() {
$('.swal-modal-iframe-full-with-minimize').closest('.swal-overlay').removeClass('swal-offline-video-compress'); $('.swal-modal-iframe-full-with-minimize').closest('.swal-overlay').removeClass('swal-offline-video-compress');
} }
function avideoModalIframeFullScreenClose() {
if (typeof swal === 'function') {
$('.swal-overlay iframe').attr('src', 'about:blank');
try {
/*
$('.swal-overlay').slideUp();
setTimeout(function(){
swal.close();
},500);
*/
swal.close();
} catch (e) {
}
}
}
// this is to make sure when the use click on the back page button it will close the iframe
window.onload = function () {
if (typeof history.pushState === "function") {
////console.log('history.pushState loaded');
window.onpopstate = function (e) {
////console.log('onpopstate', e.state, history.state);
avideoModalIframeFullScreenClose();
};
}
}
function avideoModalIframeFull(url) { function avideoModalIframeFull(url) {
avideoModalIframeFullScreen(url); avideoModalIframeFullScreen(url);
} }
@ -1574,11 +1568,18 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
} }
function avideoPushState(url) { function avideoPushState(url) {
window.history.pushState("", "", url); if (!validURL(url)) {
return false;
}
window.history.pushState(null, null, url);
if (typeof parent.updatePageSRC == 'funciton') { if (typeof parent.updatePageSRC == 'funciton') {
console.log('avideoPushState', url); console.log('avideoPushState', url);
parent.updatePageSRC(url); parent.updatePageSRC(url);
} }
// Then we set up the popstate event listener
window.onpopstate = function(event) {
avideoModalIframeClose();
};
} }
function checkIframeLoaded(id) { function checkIframeLoaded(id) {
@ -3054,7 +3055,7 @@ async function _alertFromGet(type) {
break; break;
} }
var url = removeGetParam(window.location.href, type); var url = removeGetParam(window.location.href, type);
window.history.pushState({}, document.title, url); avideoPushState(url);
} }
} }
} }
@ -3885,8 +3886,13 @@ let fullscreenIframe;
let originalURL; // to store the original URL let originalURL; // to store the original URL
function openFullscreenVideosId(videos_id) { function openFullscreenVideosId(videos_id) {
var url = webSiteRootURL + 'video/' + videos_id + '/-';
openFullscreenVideo(url, url);
}
function openFullscreenEmbedVideosId(videos_id) {
var url = webSiteRootURL + 'videoEmbed/' + videos_id + '/-'; var url = webSiteRootURL + 'videoEmbed/' + videos_id + '/-';
var urlBar = webSiteRootURL + 'v/' + videos_id + '/-'; var urlBar = webSiteRootURL + 'video/' + videos_id + '/-';
openFullscreenVideo(url, urlBar); openFullscreenVideo(url, urlBar);
} }
@ -3921,28 +3927,11 @@ function openFullscreenVideo(url, urlBar) {
'background-color': 'black' 'background-color': 'black'
}); });
if (validURL(url)) { avideoPushState(urlBar);
window.history.pushState(null, null, urlBar);
}
// Append the iframe to the body // Append the iframe to the body
fullscreenIframe.appendTo('body'); fullscreenIframe.appendTo('body');
} }
function closeFullscreenVideo() {
if (fullscreenIframe) {
fullscreenIframe.remove();
fullscreenIframe = null;
$('body').removeClass('fullscreen');
// Revert the browser's address bar to the original URL
if (originalURL) {
history.pushState({}, null, originalURL);
}
} else {
swal.close();
}
}
function addCloseButtonInVideo() { function addCloseButtonInVideo() {
try { try {
// If either function exists, add a close button inside videojs // If either function exists, add a close button inside videojs

View file

@ -209,11 +209,6 @@ if (User::hasBlockedUser($video['users_id'])) {
padding: 0 !important; padding: 0 !important;
margin: 0 !important; margin: 0 !important;
overflow: hidden; overflow: hidden;
<?php
if (!empty($customizedAdvanced->embedBackgroundColor)) {
echo "background-color: $customizedAdvanced->embedBackgroundColor !important;";
}
?>
} }
.video-js { .video-js {