\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 videoJsId = "mainVideo";
var isCompressed = false;
var _adWasPlayed = 0;
var autoplay = false;
var playNextURL = '';
$(document).ready(function () {
YPTHidenavbar();
});
$(function () {
$("#navBarFlag").change(function () {
var selfURI = "https://videos.proyectolanuevatierra.com/view/";
window.location.href = addGetParam(selfURI, 'lang', $(this).val());
});
});
mediaId = '269';var player;1
var timeOutCopyToClipboard_63df28392f04f;
$(document).ready(function () {
$('#copyToClipboard_63df28392f04f').click(function () {
clearTimeout(timeOutCopyToClipboard_63df28392f04f);
$('#copyToClipboard_63df28392f04f').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_63df28392f04f').find('i').addClass("text-success");
$('#copyToClipboard_63df28392f04f').addClass('bg-success');
$('#copyToClipboard_63df28392f04f').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_63df28392f04f = setTimeout(function () {
$('#copyToClipboard_63df28392f04f').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_63df28392f04f').find('i').removeClass("text-success");
$('#copyToClipboard_63df28392f04f').removeClass('bg-success');
$('#copyToClipboard_63df28392f04f').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#63df28392f04f').val());
})
});
function showSharing() {
$('#SharingModal').modal("show");
return false;
}
$(document).ready(function () {
var menu = new BootstrapMenu('#mainVideo', {
actions: [{name: 'Loop',
onClick: function () {
toogleImageLoop($(this));
}, iconClass: 'fas fa-sync loopButton'
},{name: 'Copy video URL',
onClick: function () {
copyToClipboard($('#linkFriendly').val());
}, iconClass: 'fas fa-link'
},{name: 'Copy video URL at current time',
onClick: function () {
copyToClipboard($('#linkCurrentTime').val());
}, iconClass: 'fas fa-link'
},{name: 'Copy embed code',
onClick: function () {
$('#textAreaEmbed').focus();
copyToClipboard($('#textAreaEmbed').val());
}, iconClass: 'fas fa-code'
},{name: 'Compartir',
onClick: function () {
showSharing();
}, iconClass: 'fas fa-share'
}]
});
if (typeof setImageLoop === 'function') {
setImageLoop();
}
$('#SharingModal').modal({show: false});
});
var timeOutCopyToClipboard_63df2839365ab;
$(document).ready(function () {
$('#copyToClipboard_63df2839365ab').click(function () {
clearTimeout(timeOutCopyToClipboard_63df2839365ab);
$('#copyToClipboard_63df2839365ab').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_63df2839365ab').find('i').addClass("text-success");
$('#copyToClipboard_63df2839365ab').addClass('bg-success');
$('#copyToClipboard_63df2839365ab').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_63df2839365ab = setTimeout(function () {
$('#copyToClipboard_63df2839365ab').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_63df2839365ab').find('i').removeClass("text-success");
$('#copyToClipboard_63df2839365ab').removeClass('bg-success');
$('#copyToClipboard_63df2839365ab').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#63df2839365ab').val());
})
});
var timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365b0;
$(document).ready(function () {
$('#getButtontCopyToClipboard63df2839365b0').click(function () {
clearTimeout(timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365b0);
$('#getButtontCopyToClipboard63df2839365b0').find('i').removeClass("fa-clipboard");
$('#getButtontCopyToClipboard63df2839365b0').find('i').addClass("text-success");
$('#getButtontCopyToClipboard63df2839365b0').addClass('bg-success');
$('#getButtontCopyToClipboard63df2839365b0').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365b0 = setTimeout(function () {
$('#getButtontCopyToClipboard63df2839365b0').find('i').removeClass("fa-clipboard-check");
$('#getButtontCopyToClipboard63df2839365b0').find('i').removeClass("text-success");
$('#getButtontCopyToClipboard63df2839365b0').removeClass('bg-success');
$('#getButtontCopyToClipboard63df2839365b0').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#textAreaEmbed').val());
})
});
var timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365c6;
$(document).ready(function () {
$('#getButtontCopyToClipboard63df2839365c6').click(function () {
clearTimeout(timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365c6);
$('#getButtontCopyToClipboard63df2839365c6').find('i').removeClass("fa-clipboard");
$('#getButtontCopyToClipboard63df2839365c6').find('i').addClass("text-success");
$('#getButtontCopyToClipboard63df2839365c6').addClass('bg-success');
$('#getButtontCopyToClipboard63df2839365c6').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365c6 = setTimeout(function () {
$('#getButtontCopyToClipboard63df2839365c6').find('i').removeClass("fa-clipboard-check");
$('#getButtontCopyToClipboard63df2839365c6').find('i').removeClass("text-success");
$('#getButtontCopyToClipboard63df2839365c6').removeClass('bg-success');
$('#getButtontCopyToClipboard63df2839365c6').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#textAreaEmbedObject').val());
})
});
var timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365cf;
$(document).ready(function () {
$('#getButtontCopyToClipboard63df2839365cf').click(function () {
clearTimeout(timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365cf);
$('#getButtontCopyToClipboard63df2839365cf').find('i').removeClass("fa-clipboard");
$('#getButtontCopyToClipboard63df2839365cf').find('i').addClass("text-success");
$('#getButtontCopyToClipboard63df2839365cf').addClass('bg-success');
$('#getButtontCopyToClipboard63df2839365cf').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365cf = setTimeout(function () {
$('#getButtontCopyToClipboard63df2839365cf').find('i').removeClass("fa-clipboard-check");
$('#getButtontCopyToClipboard63df2839365cf').find('i').removeClass("text-success");
$('#getButtontCopyToClipboard63df2839365cf').removeClass('bg-success');
$('#getButtontCopyToClipboard63df2839365cf').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#textAreaHTML').val());
})
});
var timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365d3;
$(document).ready(function () {
$('#getButtontCopyToClipboard63df2839365d3').click(function () {
clearTimeout(timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365d3);
$('#getButtontCopyToClipboard63df2839365d3').find('i').removeClass("fa-clipboard");
$('#getButtontCopyToClipboard63df2839365d3').find('i').addClass("text-success");
$('#getButtontCopyToClipboard63df2839365d3').addClass('bg-success');
$('#getButtontCopyToClipboard63df2839365d3').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_getButtontCopyToClipboard63df2839365d3 = setTimeout(function () {
$('#getButtontCopyToClipboard63df2839365d3').find('i').removeClass("fa-clipboard-check");
$('#getButtontCopyToClipboard63df2839365d3').find('i').removeClass("text-success");
$('#getButtontCopyToClipboard63df2839365d3').removeClass('bg-success');
$('#getButtontCopyToClipboard63df2839365d3').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#textAreaBBCode').val());
})
});
var timeOutCopyToClipboard_linkPermanent;
$(document).ready(function () {
$('#copyToClipboard_linkPermanent').click(function () {
clearTimeout(timeOutCopyToClipboard_linkPermanent);
$('#copyToClipboard_linkPermanent').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_linkPermanent').find('i').addClass("text-success");
$('#copyToClipboard_linkPermanent').addClass('bg-success');
$('#copyToClipboard_linkPermanent').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_linkPermanent = setTimeout(function () {
$('#copyToClipboard_linkPermanent').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_linkPermanent').find('i').removeClass("text-success");
$('#copyToClipboard_linkPermanent').removeClass('bg-success');
$('#copyToClipboard_linkPermanent').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#linkPermanent').val());
})
});
var timeOutCopyToClipboard_linkFriendly;
$(document).ready(function () {
$('#copyToClipboard_linkFriendly').click(function () {
clearTimeout(timeOutCopyToClipboard_linkFriendly);
$('#copyToClipboard_linkFriendly').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_linkFriendly').find('i').addClass("text-success");
$('#copyToClipboard_linkFriendly').addClass('bg-success');
$('#copyToClipboard_linkFriendly').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_linkFriendly = setTimeout(function () {
$('#copyToClipboard_linkFriendly').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_linkFriendly').find('i').removeClass("text-success");
$('#copyToClipboard_linkFriendly').removeClass('bg-success');
$('#copyToClipboard_linkFriendly').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#linkFriendly').val());
})
});
var timeOutCopyToClipboard_linkCurrentTime;
$(document).ready(function () {
$('#copyToClipboard_linkCurrentTime').click(function () {
clearTimeout(timeOutCopyToClipboard_linkCurrentTime);
$('#copyToClipboard_linkCurrentTime').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_linkCurrentTime').find('i').addClass("text-success");
$('#copyToClipboard_linkCurrentTime').addClass('bg-success');
$('#copyToClipboard_linkCurrentTime').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_linkCurrentTime = setTimeout(function () {
$('#copyToClipboard_linkCurrentTime').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_linkCurrentTime').find('i').removeClass("text-success");
$('#copyToClipboard_linkCurrentTime').removeClass('bg-success');
$('#copyToClipboard_linkCurrentTime').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#linkCurrentTime').val());
})
});
$(document).ready(function () {
$("#shareDiv").slideUp();
$("#shareBtn").click(function () {
$(".menusDiv").not("#shareDiv").slideUp();
$("#shareDiv").slideToggle();
return false;
});
});
$(document).ready(function() {$('#deleteSelect_sortBy').remove();});
function getSelectformatStateResultsortBy (state) {
if (!state.id) {
return state.text;
}
var $state = $(
' '+
state.text + ' '
);
return $state;
};$(document).ready(function() {$('#sortBy').select2({templateSelection: getSelectformatStateResultsortBy, templateResult: getSelectformatStateResultsortBy,width: '100%'});});
$(function () {
loadVideosListPageTransformLinks();
$('#sortBy, #rowCount').change(function () {
loadVideosListPage(1);
});
videosListDidNotSearchForVideos(); });
var loadVideosListPagerowCount = 'loadVideosListPagerowCount';
var loadVideosListPagesortBy = 'loadVideosListPagesortBy';
function loadVideosListPage(page) {
if (typeof modal === 'undefined') {
setTimeout(function () {
loadVideosListPage(page);
}, 500);
return false;
}
var url = 'https://videos.proyectolanuevatierra.com/view/videosList.php?videos_id=0&sortBy=newest';
var rowCount = $('#rowCount').val();
var sortBy = $('#sortBy').val();
Cookies.set(loadVideosListPagerowCount, rowCount, {
path: '/',
expires: 365
});
Cookies.set(loadVideosListPagesortBy, sortBy, {
path: '/',
expires: 365
});
url = addQueryStringParameter(url, 'rowCount', rowCount);
url = addQueryStringParameter(url, 'sortBy', sortBy);
url = addQueryStringParameter(url, 'current', page);
$.get(url, function (response) {
var videosList = $($.parseHTML(response)).filter("#videosListItems").html();
$('#videosListItems').html(videosList);
animateChilds('#videosListItems', 'animate__flipInX', 0.2);
lazyImage();
avideoSocket();
loadVideosListPageTransformLinks();
modal.hidePleaseWait();
});
}
function loadVideosListPageTransformLinks() {
$('#videosListItems > nav a').click(function (event) {
event.preventDefault();
loadVideosListPage($(this).attr('pageNum'));
});
}
function videosListDidNotSearchForVideos(){
var rowCount = Cookies.get(loadVideosListPagerowCount);
if(!empty(rowCount)){
$('#rowCount').val(rowCount);
}
var sortBy = Cookies.get(loadVideosListPagesortBy);
if(!empty(sortBy)){
$('#sortBy').val(sortBy).trigger('change');
}
loadVideosListPage(1);
}
var fading = false;
var autoPlaySources = [];
var autoPlayURL = 'https://videos.proyectolanuevatierra.com/video/44/the-sequel-to-the-fall-of-the-cabal---part-3?channelName=LANUEVATIERRA';
var autoPlayPoster = 'https://videos.proyectolanuevatierra.com/videos/_YPTuniqid_60115dcadabdb2.43222614.jpg';
var autoPlayThumbsSprit = 'https://videos.proyectolanuevatierra.com/videos/_YPTuniqid_60115dcadabdb2.43222614_thumbsSprit.jpg';
$(document).ready(function () {
});
$(function () {
/** showAlertMessage **/
/** showAlertMessage !requestComesFromSafePlace [] **/ });
$(document).ready(function () {
});
$(document).ready(function () {
});
if ('mediaSession' in navigator) {
navigator.mediaSession.metadata = new MediaMetadata({"title":""});
setActionHandlerIfSupported('play', function () { /* Code excerpted. */
player.play();
});
setActionHandlerIfSupported('pause', function () { /* Code excerpted. */
player.pause();
});
setActionHandlerIfSupported('stop', function () { /* Code excerpted. */
player.pause();
});
setActionHandlerIfSupported('seekbackward', function () { /* Code excerpted. */
player.currentTime(player.currentTime() - 5);
});
setActionHandlerIfSupported('seekforward', function () { /* Code excerpted. */
player.currentTime(player.currentTime() + 5);
});
setActionHandlerIfSupported('seekto', function () { /* Code excerpted. */
console.log('mediaSession seekto');
});
setActionHandlerIfSupported('previoustrack', function () { /* Code excerpted. */
try {
player.playlist.previous();
} catch (e) {
}
});
setActionHandlerIfSupported('nexttrack', function () { /* Code excerpted. */
try {
player.playlist.next();
} catch (e) {
if (playNextURL) {
playNext(playNextURL);
}
}
});
setActionHandlerIfSupported('skipad', function () { /* Code excerpted. */
console.log('mediaSession skipad');
});
setPlaylistUpdate();
}
function setPlaylistUpdate() {
if (typeof player == 'undefined' || typeof player.playlist == 'undefined') {
setTimeout(function () {
setPlaylistUpdate();
}, 1000);
return false;
}
console.log('setPlaylistUpdate');
player.on('playlistitem', function () {
updateMediaSessionMetadata();
});
}
function updateMediaSessionMetadata() {
videos_id = 0;
key = 0;
live_servers_id = 0;
live_schedule_id = 0;
if (typeof player.playlist == 'function') {
if (typeof playerPlaylist == 'undefined') {
playerPlaylist = player.playlist();
console.log('updateMediaSessionMetadata playerPlaylist was undefined', playerPlaylist);
}
}
if (typeof player.playlist == 'function' && typeof playerPlaylist !== 'undefined' && !empty(playerPlaylist)) {
index = player.playlist.currentIndex();
if (!empty(playerPlaylist[index])) {
videos_id = playerPlaylist[index].videos_id;
console.log('updateMediaSessionMetadata playerPlaylist[index].videos_id', videos_id);
}
} else if (mediaId) {
videos_id = mediaId;
console.log('updateMediaSessionMetadata mediaId', mediaId);
} else if (isLive) {
key = isLive.key;
live_servers_id = isLive.live_servers_id;
live_schedule_id = isLive.live_schedule_id;
console.log('updateMediaSessionMetadata isLive', key);
}
if (videos_id) {
console.log('updateMediaSessionMetadata', videos_id);
$.ajax({
url: webSiteRootURL + 'plugin/PlayerSkins/mediaSession.json.php',
method: 'POST',
data: {
'videos_id': videos_id,
'key': key,
'live_servers_id': live_servers_id,
'live_schedule_id': live_schedule_id,
},
success: function (response) {
console.log('updateMediaSessionMetadata response', response);
navigator.mediaSession.metadata = new MediaMetadata(response);
}
});
}
}
function setActionHandlerIfSupported(action, func) {
try {
navigator.mediaSession.setActionHandler(action, func);
} catch (e) {
if (e.name != "TypeError")
throw e;
}
}
$(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 autoPlayVideoURL="https://videos.proyectolanuevatierra.com/video/44/the-sequel-to-the-fall-of-the-cabal---part-3?channelName=LANUEVATIERRA"; var videoJsId = "mainVideo";
var playerSeekForward = 30; var playerSeekBack = 10;var forwardLayer = "\r\n
<\/i>\r\n<\/div>\r\n";var backLayer = "\r\n
<\/i>\r\n<\/div>\r\n";
/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "2", $prepareStartPlayerJS_getDataSetup = "0" */
var timeOutCopyToClipboard_63df28393a203;
$(document).ready(function () {
$('#copyToClipboard_63df28393a203').click(function () {
clearTimeout(timeOutCopyToClipboard_63df28393a203);
$('#copyToClipboard_63df28393a203').find('i').removeClass("fa-clipboard");
$('#copyToClipboard_63df28393a203').find('i').addClass("text-success");
$('#copyToClipboard_63df28393a203').addClass('bg-success');
$('#copyToClipboard_63df28393a203').find('i').addClass("fa-clipboard-check");
timeOutCopyToClipboard_63df28393a203 = setTimeout(function () {
$('#copyToClipboard_63df28393a203').find('i').removeClass("fa-clipboard-check");
$('#copyToClipboard_63df28393a203').find('i').removeClass("text-success");
$('#copyToClipboard_63df28393a203').removeClass('bg-success');
$('#copyToClipboard_63df28393a203').find('i').addClass("fa-clipboard");
}, 3000);
copyToClipboard($('#63df28393a203').val());
})
});
function showSharing63df2839396f0() {
if ($('#mainVideo').length) {
$('#SharingModal63df2839396f0').appendTo("#mainVideo");
} else {
$('#SharingModal63df2839396f0').appendTo("body");
}
$('#SharingModal63df2839396f0').modal("show");
$('.modal-backdrop').hide();
return false;
}
$(document).ready(function () {
$('#SharingModal63df2839396f0').modal({show: false});
});
function tooglePlayersocial(){showSharing63df2839396f0();}
var originalVideo;
var adTagOptions;
var _adTagUrl = ''; var player; $(document).ready(function () {
originalVideo = $('#mainVideo').clone();
/* prepareStartPlayerJS_onPlayerReady = 6, prepareStartPlayerJS_getDataSetup = 0 */
if (typeof player === 'undefined' && $('#mainVideo').length) {
player = videojs('mainVideo',{errorDisplay: false,'playbackRates':[0.5, 1, 1.5, 2]});
}
player.ready(function () {player.on('error', () => {
AvideoJSError(player.error().code);
});
player.persistvolume({
namespace: 'AVideo'
});var err = this.error();
if (err && err.code) {
$('.vjs-error-display').hide();
$('#mainVideo').find('.vjs-poster').css({'background-image': 'url(https://videos.proyectolanuevatierra.com/plugin/Live/view/Offline.jpg)'});
}
player.on('play', function () {
addView(269, this.currentTime());
_addViewBeaconAdded = false;
});
player.on('timeupdate', function () {
var time = Math.round(this.currentTime());
playerCurrentTime = time;
var url = 'https://videos.proyectolanuevatierra.com/video/269/asi-se-quieren-hacer-con-el-mundo-la-oms?channelName=LANUEVATIERRA';
if (url.indexOf('?') > -1) {
url += '&t=' + time;
} else {
url += '?t=' + time;
}
$('#linkCurrentTime, .linkCurrentTime').val(url);
if (time >= 5 && time % 1 === 0) {
addView(269, time);
}else{
addViewFromCookie();
addViewSetCookie(PHPSESSID, 269, time, seconds_watching_video);
}
});
player.on('ended', function () {
var time = Math.round(this.currentTime());
addView(269, time);
});playNextURL = 'https://videos.proyectolanuevatierra.com/video/44/the-sequel-to-the-fall-of-the-cabal---part-3?channelName=LANUEVATIERRA';player.on('ended', function () {setTimeout(function(){if(playNextURL){playNext(playNextURL);}},playerHasAds()?10000:500);});
player.seekButtons({forward: playerSeekForward, back: playerSeekBack});
var trackDisplayTimeout;
var showingSeekButton = true;
function startTrackDisplay() {
if ($(".vjs-text-track-display").length === 0) {
setTimeout(function () {
startTrackDisplay();
}, 500);
}
console.log("startTrackDisplay started");
$(".vjs-text-track-display").css('pointerEvents', "auto");
$(".vjs-text-track-display").dblclick(function (e) {
e.preventDefault();
console.log("dbl click happen " + trackDisplayTimeout);
clearTimeout(trackDisplayTimeout);
const playerWidth = $("#mainVideo").width();
if (0.66 * playerWidth < e.offsetX) {
$(forwardLayer).prependTo("#mainVideo");
setTimeout(function () {
$("#forwardLayer i").addClass('active');
$('#forwardLayer').fadeOut('slow', function () {
$('#forwardLayer').remove();
});
}, 100);
player.currentTime(player.currentTime() + playerSeekForward);
} else if (e.offsetX < 0.33 * playerWidth) {
$(backLayer).prependTo("#mainVideo");
setTimeout(function () {
$("#backLayer i").addClass('active');
$('#backLayer').fadeOut('slow', function () {
$('#backLayer').remove();
});
}, 100);
player.currentTime((player.currentTime() - playerSeekBack) < 0 ? 0 : (player.currentTime() - playerSeekBack));
} else {
if (player.paused()) {
player.play();
} else {
player.pause();
}
}
});
$(".vjs-text-track-display").click(function (e) {
e.preventDefault();
console.log("single click happen");
clearTimeout(trackDisplayTimeout);
trackDisplayTimeout = setTimeout(function () {
console.log("single click timeout");
if (player.paused()) {
player.play();
} else {
player.pause();
}
}, 300);
console.log("single click register " + trackDisplayTimeout);
});
$( "
" ).insertBefore( ".vjs-text-track-display" );
}
startTrackDisplay();
if (player.getChild('controlBar').getChild('PictureInPictureToggle')) {
player.getChild('controlBar').addChild('Theater', {}, getPlayerButtonIndex('PictureInPictureToggle') + 1);
} else {
player.getChild('controlBar').addChild('Theater', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
}
var Button = videojs.getComponent('Button');
var socialButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
this.addClass('social-button');
this.controlText("social");
setTimeout(function(){avideoTooltip(".social-button","Share");},1000);
},
handleClick: function () {
console.log('socialButton clicked');
tooglePlayersocial();
}
});
videojs.registerComponent('socialButton', socialButton);
player.getChild('controlBar').addChild('socialButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
var Button = videojs.getComponent('Button');
var autoplayButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
this.addClass('autoplay-button');
this.controlText("autoplay");
setTimeout(function(){avideoTooltip(".autoplay-button","Autoplay");},1000);
},
handleClick: function () {
console.log('autoplayButton clicked');
if($('.autoplay-button').hasClass('checked')){
disableAutoPlay();
}else{
enableAutoPlay();
}
}
});
videojs.registerComponent('autoplayButton', autoplayButton);
player.getChild('controlBar').addChild('autoplayButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
checkAutoPlay();
updateMediaSessionMetadata();
playerPlayIfAutoPlay(0);
});var Button = videojs.getComponent('Button');
var LoopButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
this.addClass('loop-button');
if (!isPlayerLoop()) {
this.addClass('loop-disabled-button');
} else {
this.addClass('fa-spin');
}
this.controlText("Loop");
},
handleClick: function () {
tooglePlayerLoop();
}
});
videojs.registerComponent('LoopButton', LoopButton);
player.getChild('controlBar').addChild('LoopButton', {}, 0);var sourcesForAdsInterval = setInterval(function(){
setSourcesForAds();
},200);
function setSourcesForAds(){
if(typeof player ==='undefined'){
return false;
}
if(typeof player.currentSources !== 'function'){
if(typeof player.currentSources === 'object'){
console.log('currentSources changed to function');
var sourcesForAds = player.currentSources;
player.currentSources = function(){return sourcesForAds;};
console.log('currentSources', player.currentSources);
}
}else{
clearTimeout(sourcesForAdsInterval);
setTimeout(function(){
setSourcesForAds();
},1000);
}
}});
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();
if (getPageHeight() <= $(window).height()) {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 1000);
$("#mainFooter").css("position", "fixed");
} else {
$("#mainFooter").css("position", "relative");
}
}
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;
}
var fading = false;