mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Enhance BigVideoLive handling with additional user feedback messages and improve Shorts player iframe interaction
This commit is contained in:
parent
a236991b34
commit
b9288420e2
3 changed files with 24 additions and 17 deletions
|
@ -1,21 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
if ($obj->BigVideoLiveForLoggedUsersOnly) {
|
if ($obj->BigVideoLiveForLoggedUsersOnly) {
|
||||||
if(!User::isLogged()){
|
if (!User::isLogged()) {
|
||||||
|
echo '<!-- BigVideoLive is disabled for non-logged users -->';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->BigVideoLive->value == Gallery::BigVideoLiveDisabled) {
|
if ($obj->BigVideoLive->value == Gallery::BigVideoLiveDisabled) {
|
||||||
|
echo '<!-- BigVideoLive is disabled -->';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->BigVideoLiveOnFirstPageOnly && (!isFirstPage() || !empty($_GET['catName']) || !empty($_GET['showOnly']) || !empty($_GET['tags_id']))) {
|
if ($obj->BigVideoLiveOnFirstPageOnly && (!isFirstPage() || !empty($_GET['catName']) || !empty($_GET['showOnly']) || !empty($_GET['tags_id']))) {
|
||||||
|
echo '<!-- BigVideoLive is disabled on this page -->';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->BigVideoLive->value == Gallery::BigVideoLiveShowLiveOnly) {
|
if ($obj->BigVideoLive->value == Gallery::BigVideoLiveShowLiveOnly) {
|
||||||
$liveVideo = Live::getLatest(true);
|
$liveVideo = Live::getLatest(true);
|
||||||
if (empty($liveVideo)) {
|
if (empty($liveVideo)) {
|
||||||
|
echo '<!-- BigVideoLive is disabled because there is no live video -->';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,18 +123,18 @@ $urlLiveNow = addQueryStringParameter($urlLiveNow, 'isClosed', 1);
|
||||||
BigVideoLiveFullscreen(true);
|
BigVideoLiveFullscreen(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('message', event => {
|
|
||||||
switch (event.data.type) {
|
|
||||||
case 'showBigVideo':
|
|
||||||
$('#BigVideoLive').slideDown();
|
|
||||||
break;
|
|
||||||
case 'hideBigVideo':
|
|
||||||
$('#BigVideoLive').slideUp();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
window.addEventListener('message', event => {
|
||||||
break;
|
switch (event.data.type) {
|
||||||
}
|
case 'showBigVideo':
|
||||||
});
|
$('#BigVideoLive').slideDown();
|
||||||
</script>
|
break;
|
||||||
|
case 'hideBigVideo':
|
||||||
|
$('#BigVideoLive').slideUp();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -39,6 +39,7 @@ saveRequestVars();
|
||||||
if (empty($_GET['search']) && !isInfiniteScroll()) {
|
if (empty($_GET['search']) && !isInfiniteScroll()) {
|
||||||
$include = AVideoPlugin::getBigVideoIncludeFile();
|
$include = AVideoPlugin::getBigVideoIncludeFile();
|
||||||
if (!empty($include)) {
|
if (!empty($include)) {
|
||||||
|
echo '<!-- BigVideoIncludeFile: ' . $include . ' -->';
|
||||||
include $include;
|
include $include;
|
||||||
} else {
|
} else {
|
||||||
if ($obj->showLivesAboveBigVideo) {
|
if ($obj->showLivesAboveBigVideo) {
|
||||||
|
@ -46,6 +47,8 @@ saveRequestVars();
|
||||||
}
|
}
|
||||||
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideoLive.php';
|
include $global['systemRootPath'] . 'plugin/Gallery/view/BigVideoLive.php';
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo '<!-- BigVideoLive is not included because search is enabled -->';
|
||||||
}
|
}
|
||||||
//var_dump(!empty($video), debug_backtrace());exit;
|
//var_dump(!empty($video), debug_backtrace());exit;
|
||||||
if (!empty($video)) {
|
if (!empty($video)) {
|
||||||
|
|
|
@ -200,8 +200,8 @@ if ($removeAnimation || !empty($advancedCustom->disableAnimations)) {
|
||||||
<script>
|
<script>
|
||||||
function shareCarouselShorts() {
|
function shareCarouselShorts() {
|
||||||
$('.ShortsPlayerOverlay').hide();
|
$('.ShortsPlayerOverlay').hide();
|
||||||
if (iframe && iframe[0] && iframe[0].contentWindow) {
|
if ($('.ShortsPlayerIframe').length) {
|
||||||
iframe[0].contentWindow.postMessage('togglePlayerSocial', '*');
|
$('.ShortsPlayerIframe')[0].contentWindow.postMessage('togglePlayerSocial', '*');
|
||||||
} else {
|
} else {
|
||||||
if (typeof togglePlayerSocial === 'function') {
|
if (typeof togglePlayerSocial === 'function') {
|
||||||
togglePlayerSocial();
|
togglePlayerSocial();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue