\n {title}\n <\/strong>\n {msg}<\/p>\n {html}\n {created}<\/small>\n <\/div>\n <\/div>\n <\/a>\n {icon}<\/div>\n
\n <\/i>\n <\/button>\n<\/div>"
var requiredUserNotificationTemplateFields = ["href","onclick","status","element_class","element_id","type","image","icon","title","msg","html","id","created"]
var _adWasPlayed = 0;
$(document).ready(function () {
YPTHidenavbar();
});
$(document).ready(function() {
searchInList('#search_647521f031937-search', '.search_647521f031937 .form-check');
$('#search_647521f031937-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLsearchFieldsNames input[type="checkbox"], .searchHTMLsearchFieldsNames input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_647521f031937-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_647521f031937-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('searchFieldsNames[]', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('searchFieldsNames[]');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_647521f031937-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_647521f031d7a-search', '.search_647521f031d7a .form-check');
$('#search_647521f031d7a-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcatName input[type="checkbox"], .searchHTMLcatName input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_647521f031d7a-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_647521f031d7a-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('catName', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('catName');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_647521f031d7a-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_647521f031d85-search', '.search_647521f031d85 .form-check');
$('#search_647521f031d85-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLtags_id input[type="checkbox"], .searchHTMLtags_id input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_647521f031d85-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_647521f031d85-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('tags_id', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('tags_id');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_647521f031d85-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_647521f031d93-search', '.search_647521f031d93 .form-check');
$('#search_647521f031d93-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcreated input[type="checkbox"], .searchHTMLcreated input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_647521f031d93-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_647521f031d93-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('created', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('created');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_647521f031d93-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_647521f031e64-search', '.search_647521f031e64 .form-check');
$('#search_647521f031e64-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLminViews input[type="checkbox"], .searchHTMLminViews input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_647521f031e64-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_647521f031e64-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('minViews', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('minViews');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_647521f031e64-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
var searchTotalSelectedSearchIn = 0;
var searchSelectedCategoryVal = '';
var searchSelectedTagVal = '';
var searchSelectedCategory = '';
var searchSelectedTag = '';
function updateSearchSelectedValues() {
searchTotalSelectedSearchIn = $('#search-tab .form-check-input:checked').length;
searchSelectedCategoryVal = $('#filter-tab .form-check-input:checked').val();
searchSelectedTagVal = $('#filter-tags-tab .form-check-input:checked').val();
searchSelectedCategory = $('#filter-tab .form-check-input:checked').parent().find('.form-check-label').html();
searchSelectedTag = $('#filter-tags-tab .form-check-input:checked').parent().find('.form-check-label').html();
}
$(document).ready(function () {
$('#filterButton').click(function () {
$('#filterDropdown').toggleClass('show');
});
setSearchFilterIcon();
});
function setSearchFilterIcon() {
updateSearchSelectedValues();
$('#searchFieldsNamesBelowNavbar-dropdown .badge').text(searchTotalSelectedSearchIn);
$('#catNameBelowNavbar-dropdown').html(searchSelectedCategory);
$('#tagNameBelowNavbar-dropdown').html(searchSelectedTag);
// check if no filter checkboxes are checked and search_category0 is checked and search_tag0 is checked
if (searchTotalSelectedSearchIn === 0 && empty(searchSelectedCategoryVal) && empty(searchSelectedTagVal)) {
// add the text-muted icon to the filterButton
$('#filterButton').removeClass('active');
} else {
// remove the text-muted icon from the filterButton
$('#filterButton').addClass('active');
}
}
async function refreshGetLiveImage(selector) {
$(selector).find('.thumbsImage img').each(function (index) {
var src = $(this).attr('src');
src = addGetParam(src, 'cache', Math.random());
$(this).attr('src', src);
});
setTimeout(function () {
$(selector).slideDown();
}, 1000); // give some time to load the new images
}
var _processLiveStats_processingNow = 0;
async function processLiveStats(response) {
if (_processLiveStats_processingNow) {
return false;
}
_processLiveStats_processingNow = 1;
setTimeout(function () {
_processLiveStats_processingNow = 0;
}, 200);
if (typeof response !== 'undefined') {
if (isArray(response)) {
for (var i in response) {
if (typeof response[i] !== 'object') {
continue;
}
//console.log('processLiveStats is array', response[i]);
processApplicationLive(response[i]);
}
} else {
//console.log('processLiveStats not array', response);
processApplicationLive(response);
}
if (!response.countLiveStream) {
availableLiveStreamNotFound();
} else {
$('#availableLiveStream').removeClass('notfound');
}
$('.onlineApplications').text($('#availableLiveStream > div').length);
}
setTimeout(function () {
}, 200);
}
async function getStatsMenu(recurrentCall) {
if (avideoSocketIsActive()) {
return false;
}
availableLiveStreamIsLoading();
$.ajax({
url: webSiteRootURL + 'plugin/Live/stats.json.php?Menu',
success: function (response) {
//console.log('getStatsMenu processLiveStats', response);
processLiveStats(response);
if (avideoSocketIsActive()) {
//console.log('getStatsMenu: Socket is enabled we will not process ajax result');
return false;
}
if (recurrentCall) {
var timeOut = 60000;
setTimeout(function () {
getStatsMenu(true);
}, timeOut);
}
}
});
}
async function processApplicationLive(response) {
if (typeof response.applications !== 'undefined') {
var applications = response.applications;
response.applications = [];
for (let key in applications) {
if (applications[key].hasOwnProperty('html')) {
response.applications.push(applications[key]);
}
}
if (typeof onlineLabelOnline == 'function' && response.applications.length) {
//console.log('processApplicationLive 1', response.applications, response.applications.length);
for (i = 0; i < response.applications.length; i++) {
//console.log('processApplicationLive 1 title', response.applications[i].title);
if (!empty(response.applications[i].expires) && response.applications[i].expires < _serverTime) {
return false;
}
processApplication(response.applications[i]);
if (!response.applications[i].comingsoon) {
if (typeof response.applications[i].live_cleanKey !== 'undefined') {
selector = '.liveViewStatusClass_' + response.applications[i].live_cleanKey;
onlineLabelOnline(selector);
}
if (typeof response.applications[i].key !== 'undefined') {
selector = '.liveViewStatusClass_' + response.applications[i].key;
onlineLabelOnline(selector);
}
}
}
mouseEffect();
} else {
//console.log('processApplicationLive ERROR', response);
}
}
// check for live servers
var count = 0;
while (typeof response[count] !== 'undefined') {
//console.log('processApplicationLive 2',count, response[count].applications, response[count].applications.length);
for (i = 0; i < response[count].applications.length; i++) {
processApplication(response[count].applications[i]);
}
count++;
}
}
function availableLiveStreamIsLoading() {
if ($('#availableLiveStream').hasClass('notfound')) {
availableLiveStreamEmpty();
}
}
function availableLiveStreamNotFound() {
$('#availableLiveStream').addClass('notfound');
availableLiveStreamEmpty();
}
async function availableLiveStreamEmpty() {
$('#availableLiveStream').empty();
}
var hideWhenExpireClasses = [];
function hideWhenExpire(application) {
var className = application.className;
// 604.800 = 1 WEEK
if (!empty(application.expires) && application.expires < 604800 && !in_array(className, hideWhenExpireClasses)) {
var expires_in_seconds = application.expires - _serverTime;
console.log('hideWhenExpire', expires_in_seconds, className);
hideWhenExpireClasses.push(className);
setTimeout(function () {
console.log('hideWhenExpire now', className);
$('.' + className).slideUp();
$('.onlineApplications').text($('.onlineApplications').text() - 1);
}, expires_in_seconds * 1000);
}
}
var linksToEmbedTimeout;
async function processApplication(application) {
href = application.href;
title = application.title;
name = application.name;
user = application.user;
photo = application.photo;
if(/Restream test/.test(title)){
return false;
}
if (!empty(application.expires) && application.expires < _serverTime) {
return false;
}
hideWhenExpire(application);
if (application && typeof application.key == 'string') {
key = application.key.replace(/[&=]/g, '');
} else {
key = '';
}
////console.log('processApplication', application.className);
callback = '';
if (typeof application.callback === 'string') {
callback = application.callback;
}
isPrivate = application.isPrivate;
if (application.type === 'Live') {
online = application.users.online;
views = application.users.views;
} else {
online = 0;
views = 0;
}
if (typeof application.html != 'undefined') {
var notificationHTML = $(application.html);
var notificatioID = (notificationHTML.attr('id') + '_notification').replace(/[&=]/g, '');
if (typeof key !== 'undefined') {
////console.log('processApplication remove class .live_' + key);
$('.live_' + key).remove();
}
if (!$('#' + notificatioID).length) {
notificationHTML.attr('id', notificatioID);
if (application.comingsoon) {
//console.log('application.comingsoon 1', application.comingsoon, application.method);
$('#availableLiveStream').append(notificationHTML);
} else {
$('#availableLiveStream').prepend(notificationHTML);
}
animateChilds('#availableLiveStream', 'animate__bounceInRight', 0.05);
} else {
////console.log('processApplication is already present '+notificatioID, application.className);
}
var html;
html = application.htmlExtra;
var id = $(html).attr('id').replace(/[&=]/g, '');
if ($('#' + id).length) {
//console.log('processApplication key found', id);
return false;
}
//console.log('processApplication key NOT found', id);
if (application.comingsoon && application.comingsoon > _serverTime) {
////console.log('application.comingsoon 2', application.comingsoon, application.method);
$('#liveScheduleVideos .extraVideos').append(html);
$('#liveScheduleVideos').slideDown();
} else {
$('#liveVideos .extraVideos').prepend(html);
$('#liveVideos').slideDown();
}
processUserNotificationFromApplication(application);
setTimeout(function () {
lazyImage();
}, 1000);
if (callback) {
eval("try {" + callback + ";} catch (e) {console.log('processApplication application.callback error',e.message);}");
}
} else {
//console.log('application.html is undefined');
}
clearTimeout(linksToEmbedTimeout);
linksToEmbedTimeout = setTimeout(function () {
avideoSocket();
}, 500);
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);
}
}
function processUserNotificationFromApplication(application) {
if (typeof addTemplateFromArray !== 'function') {
return false;
}
var itemsArray = {};
itemsArray.priority = 3;
itemsArray.image = application.poster;
itemsArray.title = application.title;
itemsArray.href = application.href;
itemsArray.element_class = application.className;
itemsArray.element_id = application.className;
itemsArray.icon = 'fas fa-video';
itemsArray.type = 'info';
itemsArray.html = 'LIVE NOW ';
addTemplateFromArray(itemsArray, false);
}
function socketLiveONCallback(json) {
console.log('socketLiveONCallback', json);
processLiveStats(json.stats);
var selector = '.live_' + json.live_servers_id + "_" + json.key;
$(selector).slideDown();
if (typeof onlineLabelOnline == 'function') {
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
selector += ', .liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
selector += ', .liveViewStatusClass_' + json.key;
selector += ', .liveViewStatusClass_' + json.cleanKey;
console.log('socketLiveONCallback ', selector);
onlineLabelOnline(selector);
}
// update the chat if the history changes
var IframeClass = ".yptchat2IframeClass_" + json.key + "_" + json.live_servers_id;
if ($(IframeClass).length) {
var src = $(IframeClass).attr('src');
if (src) {
avideoToast('Loading new chat');
var newSRC = addGetParam(src, 'live_transmitions_history_id', json.live_transmitions_history_id);
$(IframeClass).attr('src', newSRC);
}
}
if (isInLive(json)) {
playerPlay();
showImage('prerollPoster', json.cleanKey);
}
}
function socketLiveOFFCallback(json) {
console.log('socketLiveOFFCallback', json);
var selector = '.live_' + json.live_servers_id + "_" + json.key;
selector += ', .liveVideo_live_' + json.live_servers_id + "_" + json.key;
selector += ', .live_' + json.key;
////console.log('socketLiveOFFCallback 1', selector);
$(selector).slideUp("fast", function () {
$(this).remove();
});
if (typeof onlineLabelOffline == 'function') {
selector = '#liveViewStatusID_' + json.key + '_' + json.live_servers_id;
selector += ', .liveViewStatusClass_' + json.key + '_' + json.live_servers_id;
selector += ', .liveViewStatusClass_' + json.key;
selector += ', .liveViewStatusClass_' + json.cleanKey;
console.log('socketLiveOFFCallback', selector);
onlineLabelOffline(selector);
}
setTimeout(function () {
//console.log('socketLiveOFFCallback processLiveStats');
processLiveStats(json.stats);
setTimeout(function () {
hideExtraVideosIfEmpty();
}, 500);
}, 500);
if (isInLive(json)) {
showImage('postrollPoster', json.cleanKey);
}
if (typeof updateUserNotificationCount == 'function') {
updateUserNotificationCount();
}
}
async function hideExtraVideosIfEmpty() {
$('#liveScheduleVideos .extraVideos').each(function (index, currentElement) {
var somethingIsVisible = false;
$(this).children('div').each(function (index2, currentElement2) {
if ($(this).is(":visible")) {
somethingIsVisible = true;
return false;
}
});
if (!somethingIsVisible) {
$('#liveScheduleVideos').slideUp();
}
});
$('#liveVideos .extraVideos').each(function (index, currentElement) {
var somethingIsVisible = false;
$(this).children('div').each(function (index2, currentElement2) {
if ($(this).is(":visible")) {
somethingIsVisible = true;
return false;
}
});
if (!somethingIsVisible) {
$('#liveVideos').slideUp();
}
});
}
$(document).ready(function () {
if (typeof avideoSocketIsActive == 'function' && !avideoSocketIsActive()) {
availableLiveStreamIsLoading();
getStatsMenu(true);
}
processLiveStats({"total":0,"applications":[],"countLiveStream":0,"timezone":"Africa\/Abidjan"}); });
$(function () {
$("#navBarFlag").change(function () {
var selfURI = "https://video.core-issues.org/view/?lang=nl";
window.location.href = addGetParam(selfURI, 'lang', $(this).val());
});
});
$(document).ready(function () {
loadPL('647','647521f037d60');
});
$(document).ready(function () {
loadPL('563','647521f038b2b');
});
$(document).ready(function () {
loadPL('561','647521f039824');
});
$(document).ready(function () {
loadPL('560','647521f03a4c6');
});
$(document).ready(function () {
loadPL('559','647521f03afec');
});
$(document).ready(function () {
loadPL('558','647521f03bd22');
});
$(document).ready(function () {
loadPL('993','647521f03f3d5');
});
$(document).ready(function () {
loadPL('812','647521f040083');
});
$(document).ready(function () {
loadPL('685','647521f040e50');
});
$(document).ready(function () {
loadPL('682','647521f041ba4');
});
$(document).ready(function () {
loadPL('659','647521f042a0b');
});
$(document).ready(function () {
loadPL('657','647521f0436d3');
});
$(document).ready(function () {
loadPL('705','647521f04730c');
});
$(document).ready(function () {
loadPL('704','647521f04810d');
});
$(document).ready(function () {
loadPL('681','647521f048e58');
});
$(document).ready(function () {
loadPL('680','647521f049d0f');
});
$(document).ready(function () {
loadPL('656','647521f04ab01');
});
$(document).ready(function () {
loadPL('652','647521f04ba43');
});
$(document).ready(function () {
loadPL('1037','647521f04f2ca');
});
$(document).ready(function () {
loadPL('1036','647521f050111');
});
$(document).ready(function () {
loadPL('1035','647521f050f6c');
});
$(document).ready(function () {
loadPL('981','647521f051cfc');
});
$(document).ready(function () {
loadPL('980','647521f0529db');
});
$(document).ready(function () {
loadPL('979','647521f053702');
});
$(document).ready(function () {
loadPL('660','647521f056c88');
});
$(document).ready(function () {
loadPL('658','647521f057a66');
});
$(document).ready(function () {
loadPL('655','647521f05880a');
});
$(document).ready(function () {
loadPL('651','647521f059618');
});
$(document).ready(function () {
loadPL('646','647521f05a458');
});
$(document).ready(function () {
loadPL('645','647521f05b1c0');
});
$(document).ready(function () {
loadPL('790','647521f05ec2c');
});
$(document).ready(function () {
loadPL('789','647521f05faf0');
});
$(document).ready(function () {
loadPL('788','647521f0607b4');
});
$(document).ready(function () {
loadPL('787','647521f0614e8');
});
$(document).ready(function () {
loadPL('786','647521f062428');
});
$(document).ready(function () {
loadPL('785','647521f063128');
});
$(function () {
/** showAlertMessage **/
/** showAlertMessage !requestComesFromSafePlace [] **/ });
$(document).ready(function () {
});
var playListsAdding = false;
var playList = [];
async function reloadPlayLists() {
if (!isOnline()) {
return false;
}
//console.log('reloadPlayLists');
$.ajax({
url: webSiteRootURL + 'objects/playlists.json.php',
success: function (response) {
playList = response;
reloadPlayListButtons();
}
});
}
function reloadPlayListButtons() {
//console.log('reloadPlayListButtons');
$('.watchLaterBtnAdded').hide();
$('.favoriteBtnAdded').hide();
$('.watchLaterBtn').show();
$('.favoriteBtn').show();
for (var i in playList) {
if (!playList[i].id || (playList[i].status !== 'watch_later' && playList[i].status !== 'favorite')) {
continue;
}
for (var x in playList[i].videos) {
if (typeof (playList[i].videos[x]) === 'object') {
if (playList[i].status === 'watch_later') {
$('.watchLaterBtn' + playList[i].videos[x].videos_id).hide();
$('.watchLaterBtnAdded' + playList[i].videos[x].videos_id).show();
} else if (playList[i].status === 'favorite') {
$('.favoriteBtn' + playList[i].videos[x].videos_id).hide();
$('.favoriteBtnAdded' + playList[i].videos[x].videos_id).show();
}
}
}
}
}
loadPlayListsResponseObject = {timestamp: 0, response: false};
async function loadPlayLists(videos_id, crc) {
//console.log('loadPlayLists');
if (loadPlayListsResponseObject.timestamp + 5000 < Date.now()) {
loadPlayListsResponseObject.timestamp = Date.now();
loadPlayListsResponseObject.response = [];
setTimeout(function () {
$.ajax({
url: webSiteRootURL+'objects/playlists.json.php',
cache: true,
success: function (response) {
loadPlayListsResponseObject.response = response;
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
}
});
;
}, 500);
} else {
if (loadPlayListsResponseObject.response) {
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
} else {
setTimeout(function () {
loadPlayLists(videos_id, crc);
}, 1500);
}
}
}
var listGroupItemTemplate = "\n \n <\/i> \n <\/button>\n \n <\/i> \n <\/button>\n \n <\/i> \n {name_translated}<\/span>\n <\/span>\n \n \n <\/label>\n <\/div>\n<\/a>";
async function loadPlayListsResponse(response, videos_id, crc) {
//console.log('loadPlayListsResponse');
//console.log(response, videos_id, crc);
$('.searchlist' + videos_id + crc).html('');
for (var i in response) {
if (!response[i].id) {
continue;
}
var icon = "fa fa-lock"
if (response[i].status == "public") {
icon = "fa fa-globe"
} else if (response[i].status == "watch_later") {
icon = "fas fa-clock"
} else if (response[i].status == "favorite") {
icon = "fas fa-heart"
}
var checked = "";
for (var x in response[i].videos) {
if (typeof (response[i].videos[x]) === 'object' && response[i].videos[x].videos_id == videos_id) {
checked = "checked";
}
}
var randId = (("_" + response[i].id) + videos_id) + Math.random();
var itemsArray = {};
itemsArray.icon = icon;
itemsArray.id = response[i].id;
itemsArray.name_translated = response[i].name_translated;
itemsArray.response_id = response[i].id + '' + videos_id;
itemsArray.checked = checked;
itemsArray.videos_id = videos_id;
itemsArray.randId = randId;
$(".searchlist" + videos_id + crc).append(arrayToTemplate(itemsArray, listGroupItemTemplate));
}
$('.searchlist' + videos_id + crc).btsListFilter('#searchinput' + videos_id + crc, {itemChild: '.nameSearch', initial:false});
$('.playListsVideosIds' + videos_id).change(function () {
if (playListsAdding) {
return false;
}
playListsAdding = true;
addVideoToPlayList(videos_id, $(this).is(":checked"), $(this).val());
return false;
});
}
function addVideoToPlayList(videos_id, isChecked, playlists_id) {
//console.log('addVideoToPlayList');
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'objects/playListAddVideo.json.php',
method: 'POST',
data: {
'videos_id': videos_id,
'add': isChecked,
'playlists_id': playlists_id
},
success: function (response) {
reloadPlayLists();
//console.log(".playListsIds_" + playlists_id + '_videos_id_' + videos_id);
$(".playListsIds_" + playlists_id + '_videos_id_' + videos_id).prop("checked", isChecked);
modal.hidePleaseWait();
setTimeout(function () {
playListsAdding = false
}, 500);
}
});
}
$(document).ready(function () {
reloadPlayLists();
});
var liveLinkAppsCalled = {};
function liveLinkApps($liveLi, className, live_starts) {
if (new Date(live_starts).getTime() < new Date().getTime()) {
return false;
}
if (typeof liveLinkAppsCalled[className] !== 'undefined') { // do not call it twice
//return false;
}
//console.log('liveLinkApps', $liveLi, className, live_starts, $liveLi.find('.liveNow'));
liveLinkAppsCalled[className] = live_starts;
$liveLi.find('.liveNow').html("Starts in " + live_starts + "");
$liveLi.find('.liveNow').attr("class", 'label label-primary liveFuture');
//console.log('liveLinkApps', '.'+className+' '+live_starts);
startTimerToDate(live_starts, '.Timer_' + className, false);
return $liveLi;
}
function onlineLabelOnline(selector) {
selector = selector.replace(/[&=]/g, '');
//console.log("Change video to Online ", selector);
//console.trace();
$(selector).removeClass('label-warning');
$(selector).removeClass('label-danger');
$(selector).addClass('label-success');
$(selector).text("ONLINE");
if ($('#indexCol1 div.panel-heading .label-success').length) {
isOnlineLabel = true;
}
}
function onlineLabelPleaseWait(selector) {
selector = selector.replace(/[&=]/g, '');
console.log("Change video to please wait", selector);
if (!$('#indexCol1 div.panel-heading .label-success').length) {
isOnlineLabel = false;
}
$(selector).removeClass('label-success');
$(selector).removeClass('label-danger');
$(selector).addClass('label-warning');
$(selector).text("Please Wait ...");
if (!$('#indexCol1 div.panel-heading .label-success').length) {
isOnlineLabel = false;
}
}
function onlineLabelOffline(selector) {
selector = selector.replace(/[&=]/g, '');
//console.log("Change video to offline", selector);
//console.trace();
$(selector).removeClass('label-warning');
$(selector).removeClass('label-success');
$(selector).addClass('label-danger');
$(selector).text("OFFLINE");
if (!$('#indexCol1 div.panel-heading .label-success').length) {
isOnlineLabel = false;
}
}
function onlineLabelFinishing(selector) {
selector = selector.replace(/[&=]/g, '');
console.log("Change video to finishing", selector);
$(selector).removeClass('label-warning');
$(selector).removeClass('label-success');
$(selector).addClass('label-danger');
$(selector).text("Finishing Live...");
if (!$('#indexCol1 div.panel-heading .label-success').length) {
isOnlineLabel = false;
}
}
var webSocketSelfURI = 'https://video.core-issues.org/view/?lang=nl';
var webSocketVideos_id = '0';
var webSocketLiveKey = 'false';
var webSocketServerVersion = '4.2';
var webSocketToken = '';
var webSocketURL = '';
var webSocketTypes = {"OPEN_CONNECTION":"OPEN_CONNECTION","NEW_CONNECTION":"NEW_CONNECTION","NEW_DISCONNECTION":"NEW_DISCONNECTION","DEFAULT_MESSAGE":"DEFAULT_MESSAGE","ON_VIDEO_MSG":"ON_VIDEO_MSG","ON_LIVE_MSG":"ON_LIVE_MSG","TESTING":"TESTING"};
function onUserSocketConnect(response) {
try {
for (const key in response.users_id_online) {
if (Object.hasOwnProperty.call(response.users_id_online, key)) {
const element = response.users_id_online[key];
$('#caller'+element.users_id).show();
$('.users_id_'+element.users_id).addClass('online');
}
}
callerNewConnection(response);socketNewConnection(response); } catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
function onUserSocketDisconnect(response) {
try {
$('#caller'+response.msg.users_id).hide();
$('.users_id_'+response.msg.users_id).removeClass('online');callerDisconnection(response);socketDisconnection(response); } catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
$(document).ready(function () {
});
$(function () {setTimeout(function(){if(typeof $("#mainNavBar").autoHidingNavbar == "function"){$("#mainNavBar").autoHidingNavbar();}},5000);});
$(function () {
$("#mainNavBar").on("show.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").removeClass("nopadding");
}
});
$("#mainNavBar").on("hide.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").addClass("nopadding");
}
});
});
iframeAllowAttributes = 'allow="fullscreen;autoplay;camera *;microphone *;" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"';
var checkFooterTimout;
$(function () {
checkFooter();
$(window).scroll(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).resize(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).mouseup(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
});
function checkFooter() {
$("#mainFooter").fadeIn();
var height = $("#mainFooter").height();
if (height < 150 && getPageHeight() <= $(window).height()) {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 1000);
$("#mainFooter").css("position", "fixed");
$('body').css('padding-bottom', height+'px');
} else {
$("#mainFooter").css("position", "relative");
$('body').css('padding-bottom', '');
}
}
function getPageHeight() {
var mainNavBarH = 0;
if ($('#mainNavBar').length) {
mainNavBarH = $('#mainNavBar').height();
}
var mainFooterH = 0;
if ($('#mainFooter').length) {
mainFooterH = $('#mainFooter').height();
}
var containerH = getLargerContainerHeight();
return mainNavBarH + mainFooterH + containerH;
}
function getLargerContainerHeight() {
var conteiners = $('body > .container,body > .container-fluid');
var height = 0;
for (var item in conteiners) {
if (isNaN(item)) {
continue;
}
var h = $(conteiners[item]).height();
if (h > height) {
height = h;
}
}
return height;
}