mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
fix counter
This commit is contained in:
parent
beef07849d
commit
aa9fcd172c
2 changed files with 339 additions and 339 deletions
|
@ -6,399 +6,399 @@ $obj = $this->getDataObject();
|
||||||
if (User::canStream()) {
|
if (User::canStream()) {
|
||||||
if (empty($obj->doNotShowGoLiveButton)) {
|
if (empty($obj->doNotShowGoLiveButton)) {
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<button id="TopCopyKeysButton" onclick="avideoModalIframeFull(webSiteRootURL+'plugin/Live')" class="faa-parent animated-hover btn btn-danger navbar-btn"
|
<button id="TopCopyKeysButton" onclick="avideoModalIframeFull(webSiteRootURL+'plugin/Live')" class="faa-parent animated-hover btn btn-danger navbar-btn"
|
||||||
data-toggle="tooltip" title="<?php echo __("Broadcast a Live Stream"); ?>"
|
data-toggle="tooltip" title="<?php echo __("Broadcast a Live Stream"); ?>"
|
||||||
data-placement="bottom" >
|
data-placement="bottom" >
|
||||||
<i class="fa fa-circle faa-flash"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo __($buttonTitle); ?></span>
|
<i class="fa fa-circle faa-flash"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo __($buttonTitle); ?></span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (empty($obj->hideTopCopyKeysButton)) {
|
if (empty($obj->hideTopCopyKeysButton)) {
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<button id="TopCopyKeysButton" onclick="copyToClipboard('<?php echo Live::getRTMPLink(User::getId()); ?>')" class="faa-parent animated-hover btn btn-primary navbar-btn" data-toggle="tooltip" title="<?php echo __($obj->topCopyKeysButtonTitle); ?>" data-placement="bottom" >
|
<button id="TopCopyKeysButton" onclick="copyToClipboard('<?php echo Live::getRTMPLink(User::getId()); ?>')" class="faa-parent animated-hover btn btn-primary navbar-btn" data-toggle="tooltip" title="<?php echo __($obj->topCopyKeysButtonTitle); ?>" data-placement="bottom" >
|
||||||
<i class="far fa-copy faa-ring"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo __($obj->topCopyKeysButtonTitle); ?></span>
|
<i class="far fa-copy faa-ring"></i> <span class="hidden-md hidden-sm hidden-mdx"><?php echo __($obj->topCopyKeysButtonTitle); ?></span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($obj->hideTopButton)) {
|
if (empty($obj->hideTopButton)) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.liveVideo{
|
.liveVideo{
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.liveVideo .liveNow, .liveVideo .liveFuture{
|
.liveVideo .liveNow, .liveVideo .liveFuture{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
right: 5px;
|
right: 5px;
|
||||||
}
|
}
|
||||||
#availableLiveStream{
|
#availableLiveStream{
|
||||||
width: 350px;
|
width: 350px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-height: 75vh;
|
max-height: 75vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
#availableLiveStream li a div{
|
#availableLiveStream li a div{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<li class="dropdown" onclick="setTimeout(function () {lazyImage();}, 500);setTimeout(function () {lazyImage();}, 1000);setTimeout(function () {lazyImage();}, 1500);">
|
<li class="dropdown" onclick="setTimeout(function () {lazyImage();}, 500);setTimeout(function () {lazyImage();}, 1000);setTimeout(function () {lazyImage();}, 1500);">
|
||||||
<a href="#" class="faa-parent animated-hover btn btn-default navbar-btn" data-toggle="dropdown">
|
<a href="#" class="faa-parent animated-hover btn btn-default navbar-btn" data-toggle="dropdown">
|
||||||
<span class="fas fa-bell faa-ring"></span>
|
<span class="fas fa-bell faa-ring"></span>
|
||||||
<span class="badge onlineApplications" style=" background: rgba(255,0,0,1); color: #FFF;">0</span>
|
<span class="badge onlineApplications" style=" background: rgba(255,0,0,1); color: #FFF;">0</span>
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dropdown-menu-right notify-drop" >
|
<ul class="dropdown-menu dropdown-menu-right notify-drop" >
|
||||||
<?php
|
<?php
|
||||||
if (Live::canStreamWithWebRTC() || Live::canScheduleLive()) {
|
if (Live::canStreamWithWebRTC() || Live::canScheduleLive()) {
|
||||||
?>
|
?>
|
||||||
<div class="btn-group btn-group-justified" style="padding: 5px;">
|
<div class="btn-group btn-group-justified" style="padding: 5px;">
|
||||||
<?php
|
<?php
|
||||||
if (Live::canStreamWithWebRTC()) {
|
if (Live::canStreamWithWebRTC()) {
|
||||||
?>
|
?>
|
||||||
<button class="btn btn-default btn-sm faa-parent animated-hover " onclick="avideoModalIframeFull(webSiteRootURL + 'plugin/Live/webcamFullscreen.php');" data-toggle="tooltip" title="<?php echo __('Go Live') ?>" >
|
<button class="btn btn-default btn-sm faa-parent animated-hover " onclick="avideoModalIframeFull(webSiteRootURL + 'plugin/Live/webcamFullscreen.php');" data-toggle="tooltip" title="<?php echo __('Go Live') ?>" >
|
||||||
<i class="fas fa-circle faa-flash" style="color:red;"></i> <span class="hidden-sm hidden-xs"><?php echo __($buttonTitle); ?></span>
|
<i class="fas fa-circle faa-flash" style="color:red;"></i> <span class="hidden-sm hidden-xs"><?php echo __($buttonTitle); ?></span>
|
||||||
</button>
|
</button>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (Live::canScheduleLive()) {
|
if (Live::canScheduleLive()) {
|
||||||
?>
|
?>
|
||||||
<button class="btn btn-primary btn-sm" onclick="avideoModalIframeFull(webSiteRootURL + 'plugin/Live/view/Live_schedule/panelIndex.php');" data-toggle="tooltip" title="<?php echo __('Schedule') ?>" >
|
<button class="btn btn-primary btn-sm" onclick="avideoModalIframeFull(webSiteRootURL + 'plugin/Live/view/Live_schedule/panelIndex.php');" data-toggle="tooltip" title="<?php echo __('Schedule') ?>" >
|
||||||
<i class="far fa-calendar"></i> <span class="hidden-sm hidden-xs"><?php echo __('Schedule'); ?></span>
|
<i class="far fa-calendar"></i> <span class="hidden-sm hidden-xs"><?php echo __('Schedule'); ?></span>
|
||||||
</button>
|
</button>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
<div id="availableLiveStream">
|
<div id="availableLiveStream">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border hidden extraVideosModel liveVideo">
|
<div class="col-lg-12 col-sm-12 col-xs-12 bottom-border hidden extraVideosModel liveVideo">
|
||||||
<a href="" class="videoLink" class="videoLink galleryLink " >
|
<a href="" class="videoLink" class="videoLink galleryLink " >
|
||||||
<div class="aspectRatio16_9" style="min-height: 70px;" >
|
<div class="aspectRatio16_9" style="min-height: 70px;" >
|
||||||
<img src="<?php echo getCDN(); ?>videos/userPhoto/logo.png" class="thumbsJPG img-responsive" height="130" itemprop="thumbnailUrl" alt="Logo" />
|
<img src="<?php echo getCDN(); ?>videos/userPhoto/logo.png" class="thumbsJPG img-responsive" height="130" itemprop="thumbnailUrl" alt="Logo" />
|
||||||
<img src="" style="position: absolute; top: 0; display: none;" class="thumbsGIF img-responsive" height="130" />
|
<img src="" style="position: absolute; top: 0; display: none;" class="thumbsGIF img-responsive" height="130" />
|
||||||
<span class="label label-danger liveNow faa-flash faa-slow animated"><?php echo __("LIVE NOW"); ?></span>
|
<span class="label label-danger liveNow faa-flash faa-slow animated"><?php echo __("LIVE NOW"); ?></span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="h6 galleryLink " href="_link_" >
|
<a class="h6 galleryLink " href="_link_" >
|
||||||
<strong class="title liveTitle"><?php echo __("Title"); ?></strong>
|
<strong class="title liveTitle"><?php echo __("Title"); ?></strong>
|
||||||
</a>
|
</a>
|
||||||
<div class="galeryDetails" style="overflow: hidden;">
|
<div class="galeryDetails" style="overflow: hidden;">
|
||||||
<div>
|
<div>
|
||||||
<img src="" class="photoImg img img-circle img-responsive" style="max-width: 20px;">
|
<img src="" class="photoImg img img-circle img-responsive" style="max-width: 20px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="liveUser"><?php echo __("User"); ?></div>
|
<div class="liveUser"><?php echo __("User"); ?></div>
|
||||||
<div class="galleryTags">
|
<div class="galleryTags">
|
||||||
<?php
|
<?php
|
||||||
if (AVideoPlugin::isEnabledByName("LiveUsers") && method_exists("LiveUsers", "getLabels")) {
|
if (AVideoPlugin::isEnabledByName("LiveUsers") && method_exists("LiveUsers", "getLabels")) {
|
||||||
echo LiveUsers::getLabels('extraVideosModelOnLineLabels');
|
echo LiveUsers::getLabels('extraVideosModelOnLineLabels');
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function refreshGetLiveImage(selector) {
|
function refreshGetLiveImage(selector) {
|
||||||
$(selector).find('.thumbsImage img').each(function (index) {
|
$(selector).find('.thumbsImage img').each(function (index) {
|
||||||
var src = $(this).attr('src');
|
var src = $(this).attr('src');
|
||||||
src = addGetParam(src, 'cache', Math.random());
|
src = addGetParam(src, 'cache', Math.random());
|
||||||
$(this).attr('src', src);
|
$(this).attr('src', src);
|
||||||
});
|
});
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$(selector).slideDown();
|
$(selector).slideDown();
|
||||||
}, 1000); // give some time to load the new images
|
}, 1000); // give some time to load the new images
|
||||||
}
|
}
|
||||||
|
|
||||||
function processLiveStats(response) {
|
function processLiveStats(response) {
|
||||||
//console.log('processLiveStats', response);
|
//console.log('processLiveStats', response);
|
||||||
if (typeof response !== 'undefined') {
|
if (typeof response !== 'undefined') {
|
||||||
if (isArray(response)) {
|
if (isArray(response)) {
|
||||||
for (var i in response) {
|
for (var i in response) {
|
||||||
if (typeof response[i] !== 'object') {
|
if (typeof response[i] !== 'object') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
processApplicationLive(response[i]);
|
processApplicationLive(response[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
processApplicationLive(response);
|
processApplicationLive(response);
|
||||||
}
|
}
|
||||||
if (!response.countLiveStream) {
|
if (!response.countLiveStream) {
|
||||||
availableLiveStreamNotFound();
|
availableLiveStreamNotFound();
|
||||||
} else {
|
} else {
|
||||||
$('#availableLiveStream').removeClass('notfound');
|
$('#availableLiveStream').removeClass('notfound');
|
||||||
}
|
}
|
||||||
$('.onlineApplications').text(response.countLiveStream);
|
$('.onlineApplications').text($('#availableLiveStream > div').length);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
<?php
|
<?php
|
||||||
if (!empty($obj->playLiveInFullScreenOnIframe)) {
|
if (!empty($obj->playLiveInFullScreenOnIframe)) {
|
||||||
echo 'if (typeof linksToFullscreen === \'function\') {linksToFullscreen(\'.liveVideo a, #availableLiveStream a\');}';
|
echo 'if (typeof linksToFullscreen === \'function\') {linksToFullscreen(\'.liveVideo a, #availableLiveStream a\');}';
|
||||||
} elseif (!empty($obj->playLiveInFullScreen)) {
|
} elseif (!empty($obj->playLiveInFullScreen)) {
|
||||||
echo 'if (typeof linksToEmbed === \'function\') {linksToEmbed(\'.liveVideo a, #availableLiveStream a\');}';
|
echo 'if (typeof linksToEmbed === \'function\') {linksToEmbed(\'.liveVideo a, #availableLiveStream a\');}';
|
||||||
} ?>
|
} ?>
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStatsMenu(recurrentCall) {
|
function getStatsMenu(recurrentCall) {
|
||||||
if (avideoSocketIsActive()) {
|
if (avideoSocketIsActive()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
availableLiveStreamIsLoading();
|
availableLiveStreamIsLoading();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: webSiteRootURL + 'plugin/Live/stats.json.php?Menu',
|
url: webSiteRootURL + 'plugin/Live/stats.json.php?Menu',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
if (avideoSocketIsActive()) {
|
if (avideoSocketIsActive()) {
|
||||||
console.log('getStatsMenu: Socket is enabled we will not process ajax result');
|
console.log('getStatsMenu: Socket is enabled we will not process ajax result');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
processLiveStats(response);
|
processLiveStats(response);
|
||||||
if (recurrentCall) {
|
if (recurrentCall) {
|
||||||
var timeOut = <?php echo $obj->requestStatsInterval * 1000; ?>;
|
var timeOut = <?php echo $obj->requestStatsInterval * 1000; ?>;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
getStatsMenu(true);
|
getStatsMenu(true);
|
||||||
}, timeOut);
|
}, timeOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function processApplicationLive(response) {
|
function processApplicationLive(response) {
|
||||||
if (typeof response.applications !== 'undefined') {
|
if (typeof response.applications !== 'undefined') {
|
||||||
if (response.applications.length) {
|
if (response.applications.length) {
|
||||||
for (i = 0; i < response.applications.length; i++) {
|
for (i = 0; i < response.applications.length; i++) {
|
||||||
processApplication(response.applications[i]);
|
processApplication(response.applications[i]);
|
||||||
var selector = '.liveViewStatusClass_' + response.applications[i].live_cleanKey;
|
var selector = '.liveViewStatusClass_' + response.applications[i].live_cleanKey;
|
||||||
onlineLabelOnline(selector);
|
onlineLabelOnline(selector);
|
||||||
selector = '.liveViewStatusClass_' + response.applications[i].key;
|
selector = '.liveViewStatusClass_' + response.applications[i].key;
|
||||||
onlineLabelOnline(selector);
|
onlineLabelOnline(selector);
|
||||||
}
|
}
|
||||||
mouseEffect();
|
mouseEffect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check for live servers
|
// check for live servers
|
||||||
var count = 0;
|
var count = 0;
|
||||||
while (typeof response[count] !== 'undefined') {
|
while (typeof response[count] !== 'undefined') {
|
||||||
for (i = 0; i < response[count].applications.length; i++) {
|
for (i = 0; i < response[count].applications.length; i++) {
|
||||||
processApplication(response[count].applications[i]);
|
processApplication(response[count].applications[i]);
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function availableLiveStreamIsLoading() {
|
function availableLiveStreamIsLoading() {
|
||||||
if ($('#availableLiveStream').hasClass('notfound')) {
|
if ($('#availableLiveStream').hasClass('notfound')) {
|
||||||
availableLiveStreamEmpty();
|
availableLiveStreamEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function availableLiveStreamNotFound() {
|
function availableLiveStreamNotFound() {
|
||||||
$('#availableLiveStream').addClass('notfound');
|
$('#availableLiveStream').addClass('notfound');
|
||||||
availableLiveStreamEmpty();
|
availableLiveStreamEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
function availableLiveStreamEmpty() {
|
function availableLiveStreamEmpty() {
|
||||||
$('#availableLiveStream').empty();
|
$('#availableLiveStream').empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
var linksToEmbedTimeout;
|
var linksToEmbedTimeout;
|
||||||
function processApplication(application) {
|
function processApplication(application) {
|
||||||
href = application.href;
|
href = application.href;
|
||||||
title = application.title;
|
title = application.title;
|
||||||
name = application.name;
|
name = application.name;
|
||||||
user = application.user;
|
user = application.user;
|
||||||
photo = application.photo;
|
photo = application.photo;
|
||||||
if(application && typeof application.key == 'string'){
|
if(application && typeof application.key == 'string'){
|
||||||
key = application.key.replace(/[&=]/g, '');
|
key = application.key.replace(/[&=]/g, '');
|
||||||
}else{
|
}else{
|
||||||
key = '';
|
key = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('processApplication', application.className);
|
//console.log('processApplication', application.className);
|
||||||
callback = '';
|
callback = '';
|
||||||
if (typeof application.callback === 'string') {
|
if (typeof application.callback === 'string') {
|
||||||
callback = application.callback;
|
callback = application.callback;
|
||||||
}
|
}
|
||||||
isPrivate = application.isPrivate;
|
isPrivate = application.isPrivate;
|
||||||
if (application.type === 'Live') {
|
if (application.type === 'Live') {
|
||||||
online = application.users.online;
|
online = application.users.online;
|
||||||
views = application.users.views;
|
views = application.users.views;
|
||||||
} else {
|
} else {
|
||||||
online = 0;
|
online = 0;
|
||||||
views = 0;
|
views = 0;
|
||||||
}
|
}
|
||||||
if (typeof application.html != 'undefined') {
|
if (typeof application.html != 'undefined') {
|
||||||
var notificationHTML = $(application.html);
|
var notificationHTML = $(application.html);
|
||||||
var notificatioID = (notificationHTML.attr('id') + '_notification').replace(/[&=]/g, '');
|
var notificatioID = (notificationHTML.attr('id') + '_notification').replace(/[&=]/g, '');
|
||||||
if (typeof key !== 'undefined') {
|
if (typeof key !== 'undefined') {
|
||||||
//console.log('processApplication remove class .live_' + key);
|
//console.log('processApplication remove class .live_' + key);
|
||||||
$('.live_' + key).remove();
|
$('.live_' + key).remove();
|
||||||
}
|
}
|
||||||
if (!$('#' + notificatioID).length) {
|
if (!$('#' + notificatioID).length) {
|
||||||
notificationHTML.attr('id', notificatioID);
|
notificationHTML.attr('id', notificatioID);
|
||||||
if (application.comingsoon) {
|
if (application.comingsoon) {
|
||||||
$('#availableLiveStream').append(notificationHTML);
|
$('#availableLiveStream').append(notificationHTML);
|
||||||
} else {
|
} else {
|
||||||
$('#availableLiveStream').prepend(notificationHTML);
|
$('#availableLiveStream').prepend(notificationHTML);
|
||||||
}
|
}
|
||||||
animateChilds('#availableLiveStream', 'animate__bounceInRight', 0.05);
|
animateChilds('#availableLiveStream', 'animate__bounceInRight', 0.05);
|
||||||
} else {
|
} else {
|
||||||
//console.log('processApplication is already present '+notificatioID, application.className);
|
//console.log('processApplication is already present '+notificatioID, application.className);
|
||||||
}
|
}
|
||||||
|
|
||||||
var html;
|
var html;
|
||||||
<?php
|
<?php
|
||||||
if (isVideo()) {
|
if (isVideo()) {
|
||||||
?>
|
?>
|
||||||
html = application.htmlExtraVideoListItem;
|
html = application.htmlExtraVideoListItem;
|
||||||
<?php
|
<?php
|
||||||
} elseif (isLive()) {
|
} elseif (isLive()) {
|
||||||
?>
|
?>
|
||||||
html = application.htmlExtraVideoPage;
|
html = application.htmlExtraVideoPage;
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
html = application.htmlExtra;
|
html = application.htmlExtra;
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
var id = $(html).attr('id').replace(/[&=]/g, '');
|
var id = $(html).attr('id').replace(/[&=]/g, '');
|
||||||
if ($('#' + id).length) {
|
if ($('#' + id).length) {
|
||||||
//console.log('processApplication key found', id);
|
//console.log('processApplication key found', id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (application.comingsoon) {
|
if (application.comingsoon) {
|
||||||
$('#liveScheduleVideos .extraVideos').prepend(html);
|
$('#liveScheduleVideos .extraVideos').prepend(html);
|
||||||
$('#liveScheduleVideos').slideDown();
|
$('#liveScheduleVideos').slideDown();
|
||||||
} else {
|
} else {
|
||||||
$('#liveVideos .extraVideos').prepend(html);
|
$('#liveVideos .extraVideos').prepend(html);
|
||||||
$('#liveVideos').slideDown();
|
$('#liveVideos').slideDown();
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
lazyImage();
|
lazyImage();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
if (callback) {
|
if (callback) {
|
||||||
eval("try {" + callback + ";} catch (e) {console.log('processApplication application.callback error',e.message);}");
|
eval("try {" + callback + ";} catch (e) {console.log('processApplication application.callback error',e.message);}");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('application.html is undefined');
|
console.log('application.html is undefined');
|
||||||
}
|
}
|
||||||
clearTimeout(linksToEmbedTimeout);
|
clearTimeout(linksToEmbedTimeout);
|
||||||
linksToEmbedTimeout = setTimeout(function () {
|
linksToEmbedTimeout = setTimeout(function () {
|
||||||
<?php
|
<?php
|
||||||
if (!empty($obj->playLiveInFullScreenOnIframe)) {
|
if (!empty($obj->playLiveInFullScreenOnIframe)) {
|
||||||
echo 'if (typeof linksToFullscreen === \'function\') {linksToFullscreen(\'.liveVideo a, #availableLiveStream a\');}';
|
echo 'if (typeof linksToFullscreen === \'function\') {linksToFullscreen(\'.liveVideo a, #availableLiveStream a\');}';
|
||||||
} elseif (!empty($obj->playLiveInFullScreen)) {
|
} elseif (!empty($obj->playLiveInFullScreen)) {
|
||||||
echo 'if (typeof linksToEmbed === \'function\') {linksToEmbed(\'.liveVideo a, #availableLiveStream a\');}';
|
echo 'if (typeof linksToEmbed === \'function\') {linksToEmbed(\'.liveVideo a, #availableLiveStream a\');}';
|
||||||
} ?>
|
} ?>
|
||||||
avideoSocket();
|
avideoSocket();
|
||||||
}, 500);
|
}, 500);
|
||||||
if (application.users && typeof application.users.views !== 'undefined') {
|
if (application.users && typeof application.users.views !== 'undefined') {
|
||||||
$('.views_on_total_on_live_' + application.users.transmition_key + '_' + application.users.live_servers_id).text(application.users.views);
|
$('.views_on_total_on_live_' + application.users.transmition_key + '_' + application.users.live_servers_id).text(application.users.views);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function socketLiveONCallback(json) {
|
function socketLiveONCallback(json) {
|
||||||
console.log('socketLiveONCallback', json);
|
console.log('socketLiveONCallback', json);
|
||||||
processLiveStats(json.stats);
|
processLiveStats(json.stats);
|
||||||
var selector = '.live_' + json.live_servers_id + "_" + json.key;
|
var selector = '.live_' + json.live_servers_id + "_" + json.key;
|
||||||
$(selector).slideDown();
|
$(selector).slideDown();
|
||||||
|
|
||||||
if (typeof onlineLabelOnline == 'function') {
|
if (typeof onlineLabelOnline == 'function') {
|
||||||
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
|
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
|
||||||
onlineLabelOnline(selector);
|
onlineLabelOnline(selector);
|
||||||
selector = '.liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
|
selector = '.liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
|
||||||
onlineLabelOnline(selector);
|
onlineLabelOnline(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the chat if the history changes
|
// update the chat if the history changes
|
||||||
var IframeClass = ".yptchat2IframeClass_" + json.key + "_" + json.live_servers_id;
|
var IframeClass = ".yptchat2IframeClass_" + json.key + "_" + json.live_servers_id;
|
||||||
if ($(IframeClass).length) {
|
if ($(IframeClass).length) {
|
||||||
var src = $(IframeClass).attr('src');
|
var src = $(IframeClass).attr('src');
|
||||||
if (src) {
|
if (src) {
|
||||||
avideoToast('Loading new chat');
|
avideoToast('Loading new chat');
|
||||||
var newSRC = addGetParam(src, 'live_transmitions_history_id', json.live_transmitions_history_id);
|
var newSRC = addGetParam(src, 'live_transmitions_history_id', json.live_transmitions_history_id);
|
||||||
$(IframeClass).attr('src', newSRC);
|
$(IframeClass).attr('src', newSRC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function socketLiveOFFCallback(json) {
|
function socketLiveOFFCallback(json) {
|
||||||
console.log('socketLiveOFFCallback', json);
|
console.log('socketLiveOFFCallback', json);
|
||||||
var selector = '.live_' + json.live_servers_id + "_" + json.key;
|
var selector = '.live_' + json.live_servers_id + "_" + json.key;
|
||||||
selector += ', .liveVideo_live_' + json.live_servers_id + "_" + json.key;
|
selector += ', .liveVideo_live_' + json.live_servers_id + "_" + json.key;
|
||||||
selector += ', .live_' + json.key;
|
selector += ', .live_' + json.key;
|
||||||
//console.log('socketLiveOFFCallback 1', selector);
|
//console.log('socketLiveOFFCallback 1', selector);
|
||||||
$(selector).slideUp("fast", function () {
|
$(selector).slideUp("fast", function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
if (typeof onlineLabelOffline == 'function') {
|
if (typeof onlineLabelOffline == 'function') {
|
||||||
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
|
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
|
||||||
//console.log('socketLiveOFFCallback 2', selector);
|
//console.log('socketLiveOFFCallback 2', selector);
|
||||||
onlineLabelOffline(selector);
|
onlineLabelOffline(selector);
|
||||||
selector = '.liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
|
selector = '.liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
|
||||||
//console.log('socketLiveOFFCallback 3', selector);
|
//console.log('socketLiveOFFCallback 3', selector);
|
||||||
onlineLabelOffline(selector);
|
onlineLabelOffline(selector);
|
||||||
selector = '.liveViewStatusClass_' + json.cleanKey;
|
selector = '.liveViewStatusClass_' + json.cleanKey;
|
||||||
//console.log('socketLiveOFFCallback 3', selector);
|
//console.log('socketLiveOFFCallback 3', selector);
|
||||||
onlineLabelOffline(selector);
|
onlineLabelOffline(selector);
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
processLiveStats(json.stats);
|
processLiveStats(json.stats);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
hideExtraVideosIfEmpty();
|
hideExtraVideosIfEmpty();
|
||||||
}, 500);
|
}, 500);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideExtraVideosIfEmpty() {
|
function hideExtraVideosIfEmpty() {
|
||||||
$('#liveScheduleVideos .extraVideos').each(function (index, currentElement) {
|
$('#liveScheduleVideos .extraVideos').each(function (index, currentElement) {
|
||||||
var somethingIsVisible = false;
|
var somethingIsVisible = false;
|
||||||
$(this).children('div').each(function (index2, currentElement2) {
|
$(this).children('div').each(function (index2, currentElement2) {
|
||||||
if ($(this).is(":visible")) {
|
if ($(this).is(":visible")) {
|
||||||
somethingIsVisible = true;
|
somethingIsVisible = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!somethingIsVisible) {
|
if (!somethingIsVisible) {
|
||||||
$('#liveScheduleVideos').slideUp();
|
$('#liveScheduleVideos').slideUp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#liveVideos .extraVideos').each(function (index, currentElement) {
|
$('#liveVideos .extraVideos').each(function (index, currentElement) {
|
||||||
var somethingIsVisible = false;
|
var somethingIsVisible = false;
|
||||||
$(this).children('div').each(function (index2, currentElement2) {
|
$(this).children('div').each(function (index2, currentElement2) {
|
||||||
if ($(this).is(":visible")) {
|
if ($(this).is(":visible")) {
|
||||||
somethingIsVisible = true;
|
somethingIsVisible = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!somethingIsVisible) {
|
if (!somethingIsVisible) {
|
||||||
$('#liveVideos').slideUp();
|
$('#liveVideos').slideUp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if (!avideoSocketIsActive()) {
|
if (!avideoSocketIsActive()) {
|
||||||
availableLiveStreamIsLoading();
|
availableLiveStreamIsLoading();
|
||||||
getStatsMenu(true);
|
getStatsMenu(true);
|
||||||
}
|
}
|
||||||
<?php
|
<?php
|
||||||
if (AVideoPlugin::isEnabledByName('YPTSocket')) {
|
if (AVideoPlugin::isEnabledByName('YPTSocket')) {
|
||||||
echo 'processLiveStats(' . json_encode(getStatsNotifications()) . ');';
|
echo 'processLiveStats(' . json_encode(getStatsNotifications()) . ');';
|
||||||
} ?>
|
} ?>
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -168,7 +168,7 @@ if (isMobile()) {
|
||||||
playCorrectSource<?php echo $liveViewStatusID; ?>();
|
playCorrectSource<?php echo $liveViewStatusID; ?>();
|
||||||
$('.liveViewCount').text(" " + response.nclients);
|
$('.liveViewCount').text(" " + response.nclients);
|
||||||
$('#<?php echo $liveViewStatusID; ?>').text(response.msg);
|
$('#<?php echo $liveViewStatusID; ?>').text(response.msg);
|
||||||
$('#onlineApplications').text(response.applications.lenght);
|
$('.onlineApplications').text($('#availableLiveStream > div').length);
|
||||||
timeout = 15000;
|
timeout = 15000;
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue