Ministry || Gospel Times || Community || Radio

'visibilitychange', function () { console.log('Picture-in-Picture visibilitychange', document.visibilityState); try { if (document.visibilityState === 'hidden') { if (!player.paused() && !document.pictureInPictureElement) { player.requestPictureInPicture(); } } else { // If the player is in PiP mode, exit it if (document.pictureInPictureElement) { document.exitPictureInPicture(); } } } catch (e) { console.log('Picture-in-Picture visibilitychange error', e); } }); } else { console.log('Picture-in-Picture mode is not supported on this platform'); } } catch (e) {console.error('onPlayerReady', e);};try { var Button = videojs.getComponent('Button'); class SocialButton extends Button { constructor() { super(...arguments); this.addClass('social-button'); this.controlText("social"); setTimeout(function(){avideoTooltip(".social-button","Share");},1000); } handleClick() { console.log('socialButton clicked'); tooglePlayersocial(); } } videojs.registerComponent('SocialButton', SocialButton); player.getChild('controlBar').addChild('SocialButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1); } catch (e) {console.error('onPlayerReady', e);};try { if(typeof updateMediaSessionMetadata === "function"){updateMediaSessionMetadata();}; } catch (e) { console.error('onPlayerReady', e); }});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(); 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; }