window.liveFunctions={viewers:null,controlStats:null,lastStatusId:0,init:function(){signalR.liveHubMethods.start()},viewersCallback:function(n){try{liveFunctions.viewers=liveFunctions.viewers||document.getElementById("live-video-viewers");window.liveFunctions.viewers&&(window.liveFunctions.viewers.innerText=n.toLocaleString());liveFunctions.controlStats=liveFunctions.controlStats||document.querySelector(".live-video-stats");window.liveFunctions.controlStats&&(window.liveFunctions.controlStats.style="display: inline-block !important")}catch(t){console.log("liveViewersCallback error:",n,t)}},statusCallback:function(n){if(player.classList.remove("is-error"),n.statusId===1){if(window.liveFunctions.lastStatusId===3&&player.classList.contains("player-interruptions")){player.classList.remove("is-inactive");player.classList.remove("player-interruptions");document.querySelector("#video-page__state-error-message").textContent="";window.liveFunctions.lastStatusId=n.statusId;return}if(player.classList.contains("is-inactive")){if(window.liveFunctions.lastStatusId=n.statusId,vpspc.object.LiveDetails.Prelive){setTimeout(function(){window.location.reload()},6e3);window.liveFunctions.lastStatusId=n.statusId;return}player.classList.remove("is-inactive");player.classList.remove("player-prelive");player.classList.add("is-live");vpPlayer.player.hls.loadSource(n.source);vpPlayer.player.hls.attachMedia(vpPlayer.player.video);vpPlayer.player.hls.on(Hls.Events.MANIFEST_PARSED,function(){vpPlayer.player.video.play()})}}else n.statusId==2?(player.classList.add("is-inactive"),player.classList.add("player-prelive"),player.classList.remove("is-live"),document.querySelector("#video-page__state-error-message").textContent=n.message,vpPlayer.player.hls.destroy(),vpPlayer.player.hls=new Hls(vpPlayer.player.hls.config)):n.statusId==3&&console.log("Player is having interruptions");window.liveFunctions.lastStatusId=n.statusId},rklCallback:function(n){n.Success&&window.adPlatformEvents&&(n.typeId===1?adPlatformEvents.banner.triggerBanner():n.typeId===2?adPlatformEvents.video.triggerVideo():n.typeId===3&&adPlatformEvents.chatAd())}};signalR.liveHubMethods.init(window.liveFunctions)