_play={config:{constants:{SDK_VERSION:1078,LIB_VERSION:1021,CLIENT_VERSION:1138,CANVAS_VERSION:0,PLAYERVERSION:"6.0.30",STATICSESSION:999,COOKIEDURATION:31,CACHINGMINUTES:30,EXITDISPLAY_MIN_HEIGHT:320,BANNER_MIN_WIDTH:480,TIMES_MIN_WIDTH:600,TOOLTIP_MIN_WIDTH:560,VOLUME_MIN_WIDTH:480,MICROPLAYER_MAX_HEIGHT:70,THRESHOLD_HQ:640,MIDROLL_SEEKBACK:5,ADMINCLIENT:103,CASTPROTOCOL:"urn:x-cast:cast.nexx.cloud",DATAMODE_STATIC:"static",DATAMODE_API:"api",CAMERA_FRONT:"portrait",CAMERA_BACK:"environment",
EVENTHUB:"https://nexxtv-{region}-events.servicebus.windows.net/samaritan",THUMBROOT:"https://nx-i.akamaized.net/",ARCROOT:"https://arc.nexx.cloud/",EMBEDROOT:"https://embed.nexx.cloud/",SERVICEROOT:"https://services.nexx.cloud/",DOWNLOADROOT:"https://download.nexx.cloud/",APIROOT:"https://api.nexx.cloud/v3/",SHARINGOPTIONS:{"facebook":"Facebook","twitter":"Twitter","plus":"Google+","tumblr":"Tumblr","reddit":"Reddit","digg":"Digg","whatsapp":"WhatsApp","messenger":"Facebook Messenger","xing":"Xing",
"linkedin":"LinkedIn","wykop":"wykop.pl"},COLORCODES:{"ARC":"0D4D4D","FACTORY":"8903FF","HALCYON":"567714","APP":"FF9900","TV":"FF6699","OMNIA":"099","SAMARITAN":"FF3399"}},events:{PLAYER_ADDED:"playeradded",PLAYER_READY:"playerready",CHANGE_MEDIA:"changemedia",METADATA:"metadata",SESSION_START:"startsession",START:"start",START_PLAY:"startplay",START_PLAYBACK:"startplayback",MAIN_INTERACTION:"maininteraction",PAUSE:"pause",PLAY:"play",AD_CALLED:"adcalled",AD_STARTED:"adstarted",AD_ENDED:"adended",
AD_RESUMED:"adresumed",AD_ERROR:"aderror",AD_CLICKED:"adclicked",UI_SHOW:"showui",UI_HIDE:"hideui",REPLAY:"replay",SECOND:"second",QUARTER:"quarter",PROGRESS_25:"progress25",PROGRESS_50:"progress50",PROGRESS_75:"progress75",PROGRESS_95:"progress95",INTERSECTION:"intersection",ENTER_PIP:"enterpip",EXIT_PIP:"exitpip",ENTER_REMOTE:"enterremote",EXIT_REMOTE:"exitremote",ENTER_FULLSCREEN:"enterfullscreen",EXIT_FULLSCREEN:"exitfullscreen",LIGHTS_OUT:"lightsout",LIGHTS_ON:"lightson",MUTE:"mute",UNMUTE:"unmute",
ENDED:"ended",ERROR:"error",PAY_PREVIEW_ENDED:"paypreviewended",CAMERA_READY:"cameraready",CAPTURE_READY:"captureready",UPLOAD_PREPARE:"prepareupload",UPLOAD_STARTED:"uploadstarted",UPLOAD_READY:"uploadready",UPLOAD_PROGRESS:"uploadprogress",UPLOAD_POSTPARE:"uploadpostpare",DOWNLOAD_STARTED:"downloadstarted",DOWNLOAD_READY:"downloadready",DOWNLOAD_PROGRESS:"downloadprogress",PRESENCE:"presence",REALTIME:"realtime",CHAT:"chat"},templates:{},listeners:{network:[],pageVisibility:[],playstate:[],broadcast:[],
geo:[],addons:{svm:[]}},client:{id:747,hash:"",chromecastID:"",backgroundColor:"000000",playerSkin:"minimalwithright",loaderSkin:"doublebounce",dataMode:"api",useFormalSpeech:0,streamingFilter:"nxp-bitrate-1000",isPrepared:false,useLiveTransmux:0,useSessionStorage:1,sessionStorageExceptions:""},user:{id:0,payType:"",status:"",hash:"",name:"",thumb:"",cover:""},enableStage:function(dataDomain){if(!_play.session.isStage&&dataDomain){_play.session.isStage=
true;_play.session.dataDomain=dataDomain;_play.config.constants.APIROOT=_play.config.constants.APIROOT.replace("https://api","https://api"+dataDomain);_play.config.constants.SERVICEROOT=_play.config.constants.SERVICEROOT.replace("https://services","https://services"+dataDomain);_play.config.constants.DOWNLOADROOT=_play.config.constants.DOWNLOADROOT.replace("https://download","https://download"+dataDomain);_play.config.constants.EMBEDROOT=_play.config.constants.EMBEDROOT.replace("https://embed","https://embed"+
dataDomain);_play.config.enableDebug()}},enableDebug:function(filter){_play.session.isDebug=true;if(filter){if(typeof filter=="string")filter=[filter];for(var i=0;i<filter.length;i++)filter[i]=filter[i].toUpperCase();_play.session.debugFilters=filter}},setCid:function(i){_play.session.cid=i;_samaritan.setCid(i);_play.session.monitor.update()},setUser:function(id,hash,name,thumb,cover,payType,userStatus){if(id)_play.config.user.id=id;if(hash)_play.config.user.hash=hash;if(name)_play.config.user.name=
name;if(thumb)_play.config.user.thumb=thumb;if(cover)_play.config.user.cover=cover;if(payType)_play.config.user.payType=payType;if(userStatus)_play.config.user.status=userStatus},clearUser:function(){_play.config.user={id:0,payType:"",status:"",hash:"",name:"",thumb:"",cover:""}},setPlatform:function(p){_play.system.device.platform=p;if(_play.system.isTV())_play.system.device.type="tv";else if(_play.system.isSmartDisplay())_play.system.device.type="smart";else if(p=="amp")_play.system.device.type=
"mobile";else if(p=="chromecast"){_play.system.device.type="tv";_play.system.environment.isCasted=true}},setLanguage:function(l){if(l&&l!=""){_play.session.language=l;_play.system.storage.set("nxp_language",l);if(_play.system.environment.isApp)_app.session.language=l}},setPlayLicensePartner:function(l,h,a){_play.session.playLicense=l;if(h){_play.session.playLicenseHash=h;if(a)_play.session.playLicenseAdref=a}},setAffiliatePartner:function(i){_play.session.affiliatePartner=i},setSSL:function(b){_play.system.environment.isSSL=
b},addPageVisibilityListener:function(f){if(typeof f=="function")_play.config.listeners.pageVisibility.push(f)},addNetworkListener:function(f){if(typeof f=="function")_play.config.listeners.network.push(f)},addPlaystateListener:function(f){if(typeof f=="function")_play.config.listeners.playstate.push(f)},addBroadcastListener:function(f){if(typeof f=="function")_play.config.listeners.broadcast.push(f)},addGeoListener:function(f){if(typeof f=="function")_play.config.listeners.geo.push(f)},addAddonListener:function(f,
c){if(typeof f=="function")_play.config.listeners.addons[c].push(f)}},addons:{reco:{provider:"",token:"",suggestgrid:{data:{},init:function(){var p=_play.addons.reco.token.replace("https://","").split("/");var q=p[0].split("@");var r=q[0].split(":");_play.addons.reco.suggestgrid.data={username:r[0],password:r[1],url:"https://"+q[1]+"/"+p[1]}},onAction:function(id,streamtype,type,rating){type=type||"view";var o={type:type,item_id:streamtype.toUpperCase().substr(0,3)+id,user_id:_play.config.user.id>
0?"U"+_play.config.user.id:"D"+_play.system.device.id};if(rating)o.rating=rating;_play.tools.log("SENDING "+type+" TO SUGGESTGRID","ARC");_play.system.connection.postData(_play.addons.reco.suggestgrid.data.url+"/v1/actions",JSON.stringify(o),true,false,{"Authorization":"Basic "+btoa(_play.addons.reco.suggestgrid.data.username+":"+_play.addons.reco.suggestgrid.data.password)},false,true).then(function(r){if(r.data)_play.tools.log("SUGGESTGRID REPLY: "+r.data.message,"ARC")})}},iristv:{init:function(){},
onAction:function(id,streamtype,type,rating){}}},push:{init:function(pwp,title,icon,skipAutoRegister){if(_play.system.capabilities.hasWebPush&&!_play.system.isSafari()&&!_play.system.environment.isApp)_play.tools.addScript("libs/pushwoosh.js",true).then(function(){if(typeof Pushwoosh=="object"){_play.tools.log("STARTING HTML5 PUSHWOOSH","ARC");Pushwoosh.push(["init",{logLevel:_play.session.isDebug?"info":"error",applicationCode:pwp,defaultNotificationTitle:title,defaultNotificationImage:icon,autoSubscribe:skipAutoRegister?
false:true,userId:_play.config.user.hash}]);Pushwoosh.push(["onRegister",function(){_play.tools.log("HTML5 PUSH REGISTERED","ARC")}]);Pushwoosh.push(["onSubscribe",function(){_play.tools.log("HTML5 PUSH ENABLED","ARC");Pushwoosh.getPushToken().then(function(pt){_play.system.connection.callAPI("/user/registerdeviceforpush","token="+pt,null)})}]);Pushwoosh.push(["onUnsubscribe",function(){_play.tools.log("HTML5 PUSH DISABLED","ARC")}]);Pushwoosh.push(["onNotificationClick",function(api,payload){_play.tools.log("NOTIFICATION CLICKED",
"ARC")}])}else _play.tools.log("PUSHWOOSH NOT AVAILABLE","ARC")});else _play.tools.log("HTML5 PUSH NOT AVAILABLE","ARC")}},svm:{queue:[],currentEvent:null,inited:false,onReady:function(){_play.tools.log("HOMAD ADDON IS READY","ARC");_play.addons.svm.inited=true},onEvent:function(e){_play.tools.log("HOMAD EVENT RECEIVED: "+e.detail.type,"ARC");switch(e.detail.type){case "adStart":_play._factory.control.sendCommand(_play.addons.svm.currentEvent.playerContainer,"homadadstarted",_play.addons.svm.currentEvent.adType);
break;case "emptyVast":_play.tools.log("HOMAD HAS NO ADS","ARC");_play.control.interact.play(_play.addons.svm.currentEvent.playerContainer);break;case "clickthrough":_play._factory.control.sendCommand(_play.addons.svm.currentEvent.playerContainer,"homadadclicked",_play.addons.svm.currentEvent.adType);break;case "adComplete":_play._factory.control.sendCommand(_play.addons.svm.currentEvent.playerContainer,"homadadended",_play.addons.svm.currentEvent.adType);break}},onAdError:function(div,url,context){_play.tools.log("HOMAD IS INFORMED OF AD ERROR",
"ARC");var e={event:_play.config.events.AD_ERROR,playerContainer:div,adURL:url,adType:context};_play.addons.svm.currentEvent=e;if(_play.config.listeners.addons.svm.length>0)_play.config.listeners.addons.svm.forEach(function(j){j.call(null,e)});else _play.addons.svm.queue.push(e)},getConfig:function(){var cfg="despiegeldessmartclipnet::hgc-cf-cache-1.svonm.com/www.spiegel.de/config.json::spiegel.de";var config=null;if(cfg.indexOf("::")>-1){var cfp=cfg.split("::");_play.tools.log("HOMAD IS INITING","ARC");if(_play.config.client.id==571)cfp[2]="schneevonmorgen.com";var srv=["http://[hash].1.damoh."+
cfp[2]+"/","http://[hash].2.damoh."+cfp[2]+"/","http://[hash].3.damoh."+cfp[2]+"/"];if(_play.system.environment.isSSL||[748].indexOf(_play.config.client.id)>-1)srv=["https://ssl.1.damoh."+cfp[2]+"/[hash]/","https://ssl.2.damoh."+cfp[2]+"/[hash]/","https://ssl.3.damoh."+cfp[2]+"/[hash]/"];config={"enabled":true,"server":srv,"alias":cfp[0],"adpath":"","config":"https://"+cfp[1]}}return config},getQueue:function(){_play.tools.log("HOMAD IS ASKING FOR QUEUE","ARC");var a=_play.addons.svm.queue;_play.addons.svm.queue=
[];return a}}},system:{device:{id:"",type:"pc",model:"",manufacturer:"",platform:"",adtype:"",processors:1,ram:2,width:0,height:0,pixelRatio:0,details:[],cameraCount:0,lightLevel:-1,hasNotch:false,notchPosition:null,isWeak:false,isHeadsetConnected:false,isPortrait:false,init:function(){var t=_play.system.device.id;_play.system.device.width=screen.width>0?screen.width:window.innerWidth;_play.system.device.height=screen.height>0?screen.height:window.innerHeight;_play.system.device.pixelRatio=window.devicePixelRatio||
1;if(typeof window.navigator.hardwareConcurrency=="number"){_play.system.device.processors=window.navigator.hardwareConcurrency;if(_play.system.device.processors<4)_play.system.device.isWeak=true}if(typeof window.navigator.deviceMemory=="number"){_play.system.device.ram=window.navigator.deviceMemory;if(_play.system.device.ram<2)_play.system.device.isWeak=true}if(_play.session.language=="auto"){var l=_play.system.storage.get("nxp_language");if(l&&l.length==2)_play.session.language=l;else if("language"in
navigator)_play.session.language=navigator.language.split("-")[0];else if("browserLanguage"in navigator)_play.session.language=navigator.browserLanguage.split("-")[0];else _play.session.language="de"}if(typeof device=="object"){if(device.model)_play.system.device.model=device.model;if(device.manufacturer)_play.system.device.manufacturer=device.manufacturer}if(!t||t==""||(isNaN(_play.tools.parseInt(t.substr(0,1)))||isNaN(_play.tools.parseInt(t.substr(-1))))){t=_play.system.storage.get("nxp_devh");
if(!t||t=="")_play.system.cookies.get("nxp_devh");if(!t||t==""){_play.tools.log("CREATING NEW DEVICE ID","ARC");if(typeof device=="object")t=device.uuid;if(!t||t=="")t=_play.session.getTime()+":"+_play.tools.getRandom(1E4,09)}else _play.tools.log("FOUND DEVICE ID","ARC");_play.system.device.id=t;_play.system.storage.set("nxp_devh",t);_play.system.cookies.set("nxp_devh",t)}if(_play.system.environment.isApp&&typeof _app["native"].headset=="object"){_app["native"].headset.isConnected(function(status){_play.system.device.isHeadsetConnected=
_play.tools.parseInt(status)==1});_app["native"].headset.registerCallback(function(status){_play.system.device.isHeadsetConnected=_play.tools.parseInt(status)==1;_play.session.onHeadsetEvent()})}},update:function(t,manufacturer,model){if(manufacturer&&manufacturer!=""&&_play.system.device.manufacturer==""){_play.system.device.manufacturer=manufacturer;if(model&&model!=""){_play.system.device.model=model;if(_play.system.device.model=="iPhone"&&_play.system.device.width*_play.system.device.pixelRatio==
1125&&_play.system.device.height*_play.system.device.pixelRatio==2436)_play.system.device.model="iPhone10,3";if(["iPhone10,3","iPhone10,6"].indexOf(_play.system.device.model)>-1){_play.system.device.hasNotch=true;_play.system.device.updateOrientation()}}}if(t=="tablet"&&_play.system.device.type!="tablet"){_play.system.device.type="tablet";if(_play.system.device.platform=="mobile")_play.system.device.platform="tablet"}},updateOrientation:function(){if(screen.orientation){_play.system.device.isPortrait=
screen.orientation.type.indexOf("portrait")>-1;if(_play.system.device.isPortrait)_play.system.device.notchPosition=screen.orientation.type.indexOf("primary")>-1?"top":"bottom";else _play.system.device.notchPosition=screen.orientation.type.indexOf("primary")>-1?"left":"right"}else if(typeof window.orientation=="number"){_play.system.device.isPortrait=[0,180].indexOf(window.orientation)>-1;if(_play.system.device.isPortrait)_play.system.device.notchPosition=window.orientation==0?"top":"bottom";else _play.system.device.notchPosition=
window.orientation==90?"left":"right"}},updateInputDevice:function(e){var dev="";if(e)if(e.pointerType){dev=e.pointerType.toUpperCase();if(e.pointerType=="mouse"){_play.system.capabilities.hasMouse=true;_play.system.capabilities.hasTouch=false;if(typeof jQuery=="object")_play._factory.ui.tooltip.init()}else if(e.pointerType=="pen"){_play.system.capabilities.hasTouch=false;_play.system.capabilities.hasPen=true}document.removeEventListener("pointermove",_play.system.device.updateInputDevice)}else{_play.system.capabilities.hasMouse=
true;_play.system.capabilities.hasTouch=false;if(typeof jQuery=="object")_play._factory.ui.tooltip.init();document.removeEventListener("mouseover",_play.system.device.updateInputDevice)}_play.tools.log("DETECTED INPUT DEVICE: "+dev,"ARC");return true},lockOrientation:function(v){if(screen.orientation)if(typeof screen.orientation.lock=="function")screen.orientation.lock(v).then(function(){_play.tools.log("LOCKED SCREEN IN "+v,"ARC")},function(){_play.tools.log("LOCKING SCREEN IN "+v+" FAILED","ARC")})},
history:{data:null,init:function(){if(!_play.system.device.history.data){_play.tools.log("INITING LOCAL HISTORY","ARC");var p=_play.system.storage.get("nxp_watched");if(p)_play.system.device.history.data=JSON.parse(p);else _play.system.device.history.data={}}},startMerge:function(){if(_play.config.user.id>0)_play.system.connection.callAPI("/user/historyformerge","streamtype=video&includeProgress=1&excludeCompleted=0").then(function(e){if(e){jQuery.each(e,function(i,j){if(!_play.system.device.history.hasPlayed(i,
"video"))_play.system.device.history.data["VID"+i]={count:1,lastPos:j,maxPos:j,lastDate:-1,firstDate:-1};else if(_play.system.device.history.data["VID"+i].maxPos<j)_play.system.device.history.data["VID"+i].maxPos=j});_play.system.storage.set("nxp_watched",JSON.stringify(_play.system.device.history.data));if(_play.system.environment.isONE)_client.onUserHistoryUpdate()}})["catch"](function(e){_play.tools.log("NO HISTORY FOR MERGE FOUND","PLAY")})},update:function(id,streamtype,position,isPlay){position=
position||0;streamtype=streamtype||"video";if(["audio","video","live","scene"].indexOf(streamtype)>-1){_play.tools.log("UPDATING LOCAL HISTORY OF "+id+"/"+streamtype,"ARC");_play.system.device.history.init();var s=streamtype.substr(0,3).toUpperCase()+id;if(!_play.system.device.history.hasPlayed(id,streamtype))_play.system.device.history.data[s]={count:isPlay?0:1,lastPos:0,maxPos:0,lastDate:_play.session.getTime(),firstDate:_play.session.getTime()};if(isPlay){_play.system.device.history.data[s].count+=
1;_play.system.device.history.data[s].lastDate=_play.session.getTime()}if(_play.system.device.history.data[s].lastPos<position)_play.system.device.history.data[s].maxPos=position;_play.system.device.history.data[s].lastPos=position;_play.system.storage.set("nxp_watched",JSON.stringify(_play.system.device.history.data))}},remove:function(id,streamtype){if(_play.system.device.history.hasPlayed(id,streamtype)){var d=[];jQuery.each(_play.system.device.history.data,function(i,j){if(i!=s)d.push(j)});_play.system.device.history.data=
d;_play.system.storage.set("nxp_watched",JSON.stringify(_play.system.device.history.data));if(_play.system.environment.isONE)_client.onUserHistoryUpdate()}},hasPlayed:function(id,streamtype){streamtype=streamtype||"video";_play.system.device.history.init();return Object.keys(_play.system.device.history.data).indexOf(streamtype.substr(0,3).toUpperCase()+id)>-1}}},environment:{isSupported:true,isApp:false,isONE:false,isOMNIA:false,isEmbedded:false,isFullscreen:false,isPIP:false,isPopOut:false,isLightsOut:false,
isSecureOrigin:false,isWebView:false,isWebApp:false,isVisible:true,isSSL:false,isCasted:false,isBackgroundCasting:false,isUnloading:false,isUploading:false,isDownloading:false,isAdBlocking:false},capabilities:{hasCookies:true,hasStorage:true,hasStorageManager:false,hasCam:false,hasCamRecord:false,hasCaptions:false,hasCORS:false,hasDASH:false,hasHLS:false,hasDRM:false,hasGeo:false,hasWebGL:false,hasBeacon:false,hasBroadcast:false,hasClipboard:false,hasDragDrop:false,hasFullscreen:false,hasPageVisibility:false,
hasWebPush:false,hasPerformance:false,hasNotification:false,hasPerformanceResource:false,hasNetworkInformation:false,hasMutedAutoPlay:false,hasFileUpload:true,hasFileDownload:true,hasFetch:false,hasFetchAbort:false,hasWebP:false,hasMP4:false,hasWebM:false,hasVP9:false,hasMP3:false,hasOpus:false,hasTouch:false,hasMouse:false,hasPen:false,hasInlineVideo:true,hasPostMessage:false,hasPIP:false,hasAirPlay:false,hasCast:false,hasMediaSession:false,hasComputedStyle:false,hasDebugColor:true,hasIntersectionOberserver:false,
hasResizeObserver:false,hasQuerySelector:false,hasNativeShare:false},isMobile:function(){return["mobile","tablet","ios","android","fbia","amp"].indexOf(_play.system.device.platform)>-1},isTV:function(){return["atv","hyve","xbox","playstation"].indexOf(_play.system.device.platform)>-1},isSmartDisplay:function(){return["smart"].indexOf(_play.system.device.platform)>-1},isWinApp:function(){return["win8"].indexOf(_play.system.device.platform)>-1},isFirefox:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>
-1},isIE:function(){return navigator.userAgent.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident")>-1||_play.system.isEdge()},isOpera:function(){return navigator.userAgent.indexOf(" OPR")>-1},isEdge:function(){return navigator.userAgent.indexOf(" Edge")>-1},isSafari:function(){return navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Windows")==-1},isChrome:function(){return navigator.userAgent.indexOf("Chrome")>-1&&!_play.system.isSafari()&&
!_play.system.isEdge()&&!_play.system.isOpera()&&!_play.system.isSamsungBrowser()},isSamsungBrowser:function(){return navigator.userAgent.indexOf("SamsungBrowser")>-1},isChromeOnIOS:function(){return _play.system.isIOS()&&navigator.userAgent.toLowerCase().indexOf(" crios")>-1},isFirefoxOnIOS:function(){return _play.system.isIOS()&&navigator.userAgent.toLowerCase().indexOf(" fxios")>-1},isIOS:function(){var ios=false;if(navigator.userAgent.toLowerCase().indexOf("windows")==-1&&/(iphone|ipod|ipad)/i.test(navigator.userAgent.toLowerCase()))ios=
true;return ios},isAndroid:function(){var t=false;if(!_play.system.isXBox()&&!_play.system.isWinPhone())t=navigator.userAgent.toLowerCase().indexOf("android")>-1;return t},isMac:function(){return navigator.platform.toUpperCase().indexOf("MAC")>-1},isTizen:function(){return navigator.userAgent.toLowerCase().indexOf("tizen")>-1},isWinPhone:function(){var t=false;if(!_play.system.isXBox())t=navigator.userAgent.toLowerCase().indexOf("windows phone")>-1;return t},isXBox:function(){return navigator.userAgent.toLowerCase().indexOf("xbox")>
-1},isTizenApp:function(){return typeof window.tizen!="undefined"},isWebOSApp:function(){return typeof window.webOS!="undefined"},isAmazonFire:function(){var t=false;if(_play.system.environment.isApp)if(_app.session.portal.indexOf("amazon")>-1)t=true;return t},isAndroidStockBrowser:function(){var t=false;if(!_play.system.environment.isWebView&&_play.system.isAndroid()&&!_play.system.isFirefox()){var u=navigator.userAgent.toLowerCase();if(u.indexOf("chrome")==-1||u.indexOf("version/")>-1)t=true;else{var a=
/chrome\/(\d+)/i.exec(u);if(a[1]<35)t=true}}return t},getAndroidVersion:function(withSub){var a=/android ([\d\.]+)/i.exec(navigator.userAgent.toLowerCase());a=a||[0,0];var t=_play.tools.parseInt(a[1]);if(withSub){var x=a[1].toString().split(".");t=parseFloat(x[0]+"."+x[1])}return t},getIOSVersion:function(withSub){var a=/[iphone|ipod|ipad].*?os (\d{1,2})_(\d?)/i.exec(navigator.userAgent.toLowerCase());a=a||[0,0];var t=_play.tools.parseInt(a[1]);if(withSub)if(a[2])t=parseFloat(t+"."+a[2]);else t=parseFloat(t+
".0");return t},getWinPhoneVersion:function(){var a=/windows phone (\d{1,2}\.\d)/i.exec(navigator.userAgent.toLowerCase());a=a||[0,0];return parseFloat(a[1])},getChromeVersion:function(){return _play.tools.parseInt(navigator.userAgent.split("Chrome/")[1].substr(0,2))},getIEVersion:function(){var v=0;try{if(_play.system.isEdge())v=12;else if(navigator.userAgent.indexOf("MSIE ")>-1)v=_play.tools.parseInt(navigator.userAgent.split("MSIE ")[1].substr(0,2));else if(navigator.userAgent.indexOf("Trident")>
-1)v=_play.tools.parseInt(navigator.userAgent.split("; rv:")[1].substr(0,2))}catch(e){}return v},getEdgeVersion:function(){return _play.tools.parseInt(navigator.userAgent.split("Edge/")[1].substr(0,2))},getSafariVersion:function(){var v=navigator.userAgent.split("Version/");if(!v||!v.length||v.length==1)v=navigator.userAgent.split("iPhone OS ");try{if(v&&v.length&&v.length>1){v=v[1].split(".");if(v&&v.length&&v.length>0)v=_play.tools.parseInt(v[0]);else{v=uv[1].split("_");if(v&&v.length&&v.length>
0)v=_play.tools.parseInt(v[0]);else v=0}}else v=0}catch(e){v=0}return v},storage:{get:function(el){var t;if(_play.system.capabilities.hasStorage)t=localStorage.getItem(el);return t},set:function(el,val){if(_play.system.capabilities.hasStorage)try{localStorage.setItem(el,val);if(_play.system.environment.isApp)_app["native"].storage.set(el,val)}catch(e){}},remove:function(el){if(_play.system.capabilities.hasStorage)try{localStorage.removeItem(el);if(_play.system.environment.isApp)_app["native"].storage.remove(el)}catch(e){}},
clear:function(forceAll){_play.tools.log("CLEARING STORAGE","ARC");try{if(_play.system.capabilities.hasStorage){if(forceAll)localStorage.clear();else for(var i=0;i<localStorage.length;i++){var key=localStorage.key(i);if(key.indexOf("nxp_")!=0&&key.indexOf("omnia")!=0)if(key.indexOf("http")==0||key.indexOf("//")==0||key.indexOf("nexx")==0)localStorage.removeItem(key)}if(_play.system.environment.isApp&&typeof _app["native"].storage=="object"){_play.tools.log("CLEARING WEBVIEW STORAGE","ARC");_app["native"].storage.clear()}}}catch(e){_play.tools.log("ERROR WHILE CLEARING CACHE",
"ARC")}},clearAll:function(){_play.system.storage.clear(true);_play.system.cache.clear();_play.system.cookies.clear()},requestPersistent:function(){if(_play.system.capabilities.hasStorageManager)navigator.storage.persisted().then(function(i){if(!i)navigator.storage.persist()})}},cache:{get:function(el){var t;if(_play.system.capabilities.hasStorage){var ts=sessionStorage.getItem(el+"_time");if(ts)if(_play.tools.parseInt(ts)>=_play.session.getTime(false)-_play.config.constants.CACHINGMINUTES*60)t=sessionStorage.getItem(el);
else{_play.tools.log("ITEM TOO OLD, REMOVING","ARC");_play.system.cache.remove(el)}}return t},set:function(el,val){if(_play.system.capabilities.hasStorage&&_play.config.client.useSessionStorage==1)try{var doStore=true;if(el.substr(0,4)=="_one"){var elm=el.split("_")[3];if(elm&&elm!=""&&_play.config.client.sessionStorageExceptions.split(",").indexOf(elm)>-1){_play.tools.log("DO NOT STORE IN CACHE DUE TO EXCEPTION RULE","ARC");doStore=false}}if(doStore){_play.tools.log("STORING "+el+" IN CACHE","ARC");
sessionStorage.setItem(el+"_time",_play.session.getTime(false));sessionStorage.setItem(el,val)}}catch(e){}},remove:function(el){if(_play.system.capabilities.hasStorage)try{_play.tools.log("REMOVING "+el+" FROM CACHE","ARC");sessionStorage.removeItem(el+"_time");sessionStorage.removeItem(el)}catch(e){}},clear:function(){_play.tools.log("CLEARING CACHE","ARC");if(_play.system.capabilities.hasStorage)sessionStorage.clear()}},cookies:{get:function(el){var t=null;if(_play.system.capabilities.hasCookies)t=
Cookies.get(el);return t},set:function(el,val){if(_play.system.capabilities.hasCookies)Cookies.set(el,val,{path:"/",expires:_play.config.constants.COOKIEDURATION})},remove:function(el){if(_play.system.capabilities.hasCookies)Cookies.remove(el,{path:"/"})},clear:function(){_play.tools.log("CLEARING COOKIES","ARC");if(_play.system.capabilities.hasCookies)jQuery.each(Cookies.get(),function(i,j){Cookies.remove(i,{path:"/"})})}},notification:{icon:null,requestPermission:function(){if(_play.system.capabilities.hasNotification)Notification.requestPermission().then(function(p){if(p==
"granted")_play.tools.log("NOTIFICATION PERMISSION GRATED","ARC");else if(p=="denied")_play.tools.log("NOTIFICATION PERMISSION DENIED","ARC")})},setIcon:function(i){_play.system.notification.icon=i},show:function(title,body,cb){if(_play.system.capabilities.hasNotification&&Notification.permission=="granted"){var opts={};if(_play.system.notification.icon)opts.icon=_play.system.notification.icon;if(body)opts.body=body;var note=new window.Notification(title,opts);if(cb)note.onclick=cb}}},geo:{city:"",
country:"",code:"",lat:0,lng:0,alt:0,heading:0,highAccuracy:true,coordsMaxAge:3E4,updateInterval:null,init:function(startHeading){if(_play.system.capabilities.hasGeo){navigator.geolocation.getCurrentPosition(_play.session.onGeoPosition,null,{enableHighAccuracy:_play.system.geo.highAccuracy,maximumAge:_play.system.geo.coordsMaxAge});if(startHeading&&_play.system.environment.isSecureOrigin){window.addEventListener("deviceorientation",_play.system.geo.updateHeading,true);window.addEventListener("deviceorientationabsolute",
_play.system.geo.updateHeading,true)}}},startMonitoring:function(){_play.system.geo.updateInterval=navigator.geolocation.watchPosition(_play.session.onGeoPosition,null,{enableHighAccuracy:_play.system.geo.highAccuracy,timeout:2500,maximumAge:0})},stopMonitoring:function(){if(_play.system.geo.updateInterval)navigator.geolocation.clearWatch(_play.system.geo.updateInterval);if(_play.system.environment.isSecureOrigin){window.removeEventListener("deviceorientation",_play.system.geo.updateHeading);window.removeEventListener("deviceorientationabsolute",
_play.system.geo.updateHeading)}},updateHeading:function(e){if(e&&e.alpha&&e.absolute===true){var alphaRad=e.alpha*(Math.PI/180);var betaRad=e.beta*(Math.PI/180);var gammaRad=e.gamma*(Math.PI/180);var cA=Math.cos(alphaRad);var sA=Math.sin(alphaRad);var cB=Math.cos(betaRad);var sB=Math.sin(betaRad);var cG=Math.cos(gammaRad);var sG=Math.sin(gammaRad);var rA=-cA*sG-sA*sB*cG;var rB=-sA*sG+cA*sB*cG;var rC=-cB*cG;var compassHeading=Math.atan(rA/rB);if(rB<0)compassHeading+=Math.PI;else if(rA<0)compassHeading+=
2*Math.PI;compassHeading*=180/Math.PI;_play.session.onGeoPosition({heading:compassHeading})}},getCurrentPosition:function(){return{lat:_play.system.geo.lat,lng:_play.system.geo.lng,alt:_play.system.geo.alt,heading:_play.system.geo.heading,code:_play.system.geo.code,country:_play.system.geo.country,city:_play.system.geo.city}},getString:function(){return _play.system.geo.city?_play.system.geo.city+(_play.system.geo.country?", "+_play.system.geo.country:""):_play.system.geo.country}},connection:{type:"",
"class":"",isSlow:false,isFast:false,isOnline:true,init:function(){if(_play.system.capabilities.hasNetworkInformation)_play.system.connection.getDetails()},getDetails:function(){var hasUpdate=false;if(navigator.connection.effectiveType){hasUpdate=true;_play.system.connection["class"]=navigator.connection.effectiveType;if(["2g","slow-2g"].indexOf(navigator.connection.effectiveType)>-1){_play.system.connection.isSlow=true;_play.system.connection.isFast=false;_play.tools.log("CONNECTION IS VERY SLOW",
"ARC")}else if(navigator.connection.effectiveType=="4g"){_play.system.connection.isFast=true;_play.system.connection.isSlow=false;_play.tools.log("CONNECTION IS VERY FAST","ARC")}else{_play.tools.log("CONNECTION IS OK","ARC");_play.system.connection.isFast=false;_play.system.connection.isSlow=false}}var n=navigator.connection.type;if(n&&["other","mixed","unknown",""].indexOf(n)>-1){hasUpdate=true;_play.system.connection.type=n}if(hasUpdate)_play.session.onNetworkInformation()},getFile:function(url,
asJSON,asBlob,withCredentials,forceXHR,disableFetchCORS){return new Promise(function(resolve,reject){_play._factory.data._connect(forceXHR,url,"GET",null,asJSON,asBlob,null,withCredentials,disableFetchCORS).then(function(r){if(r.status<400)resolve(r);else resolve({status:500,data:null})})})},postData:function(url,data,asJSON,withCredentials,headerdata,sendJSON,sendText,usePUT,forceXHR){return new Promise(function(resolve,reject){_play._factory.data._connect(forceXHR,url,usePUT?"PUT":"POST",data,asJSON,
false,headerdata,withCredentials,false,sendJSON,sendText).then(function(r){if(r.status<400)resolve(r);else resolve({status:500,data:null})})})},callAPI:function(path,data){return new Promise(function(resolve,reject){var headers={};if(path!="/session/init"){headers["X-Request-CID"]=_play.session.cid;headers["X-Request-Token"]=md5(path.split("/")[2]+_play.config.client.id+_play.config.client.hash)}else{headers["X-Request-Enable-Auth-Fallback"]="1";data={nxp_devh:_play.system.device.id,nxp_userh:_play.config.user.hash,
precid:_play.session.cid==_play.config.constants.STATICSESSION?0:_play.session.cid,playlicense:_play.session.playLicense,gateway:_play.system.device.platform,adGateway:_play.system.device.adtype,explicitlanguage:_play.session.language,supportsAdStreamtypes:1,addTextTemplates:1,addDomainData:1,addAdModel:1}}_play._factory.data._connect(false,_play.config.constants.APIROOT+_play.config.client.id+path,"POST",data,true,false,headers,false).then(function(r){if(r.status<400){_play.session.monitor.api(path,
r.data.metadata);resolve(r.data.result)}else{_play.session.monitor.api(path,{status:r.status,calledwith:path,processingtime:0},data);reject(null)}})})},cancelRequest:function(){_play._factory.data.cancelRequest()}},fullscreen:{lastElement:"",useLegacy:false,init:function(){_play.system.capabilities.hasFullscreen=false;_play.system.fullscreen.useLegacy=false;if(!_play.system.isIOS()&&!_play.system.isAndroidStockBrowser())_play.system.capabilities.hasFullscreen=typeof document.exitFullscreen=="function";
else{_play.system.capabilities.hasFullscreen=true;_play.system.fullscreen.useLegacy=true}if(!_play.system.fullscreen.useLegacy&&_play.system.capabilities.hasFullscreen&&!document.fullscreenEnabled)_play.system.capabilities.hasFullscreen=false;if(_play.system.environment.isApp)_play.system.capabilities.hasFullscreen=true},enter:function(s){if(!_play.system.fullscreen.useLegacy){el=document.getElementById(s);try{if(_play.system.environment.isApp)_app["native"].screen.fullscreen.enter(s);el.requestFullscreen()}catch(e){}}else{el=
document.getElementById(s.replace("sector","player"));try{el.webkitEnterFullscreen()}catch(e$0){}}},exit:function(){if(_play.system.environment.isFullscreen)if(!_play.system.fullscreen.useLegacy){if(_play.system.environment.isApp)_app["native"].screen.fullscreen.exit();document.exitFullscreen()}else{var el=document.getElementById(_play.system.fullscreen.lastElement.replace("sector","player"));try{el.webkitExitFullscreen()}catch(e){}}}},broadcast:{channel:null,startMonitoring:function(){if(_play.system.capabilities.hasBroadcast){_play.system.broadcast.channel=
new BroadcastChannel("nexxPLAY");_play.system.broadcast.channel.onmessage=_play.session.onBroadcast}},sendMessage:function(cmd,param){if(_play.system.broadcast.channel)_play.system.broadcast.channel.postMessage({cmd:cmd,param:param,cid:_play.session.cid,client:_play.config.client.id})},stopMonitoring:function(){_play.system.broadcast.channel.close()}},verifyMinimalCapabilities:function(){var a=true;if(!"forEach"in new Array||typeof Object.keys!="function"||typeof document.addEventListener!="function"){_play.tools.log("PLATFORM IS NOT SUPPORTED",
"ARC");a=false}_play.system.environment.isSupported=a},checkFor:{platform:function(){_play.tools.log("COMPUTING INITIAL PLATFORM","ARC");if(_play.system.device.platform=="")if(_play.session.context=="tvapp"){_play.system.device.platform="atv";_play.system.device.type="tv"}else if(/\[FBIA|\[FBAN/i.test(navigator.userAgent)){_play.system.device.platform="fbia";_play.system.device.type="mobile"}else if(/Android|webOS|iPhone|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(navigator.userAgent)){_play.system.device.platform=
"mobile";_play.system.device.type="mobile"}else if(/iPad/i.test(navigator.userAgent)){_play.system.device.platform="tablet";_play.system.device.type="tablet"}else _play.system.device.platform="html5";if(_play.system.isMobile()){var adde=_play.system.isIOS()?"ios":_play.system.isAndroid()?"android":"";if(adde!=""){adde+=_play.system.device.type=="tablet"?"tablet":"phone";if(_play.system.environment.isApp)adde="app"+adde;_play.system.device.adtype=adde}}},inputDevice:function(){if(_play.system.isTV()){_play.system.capabilities.hasPen=
true;_play.tools.log("DETECTED INPUT DEVICE: PEN","ARC")}else if("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0||navigator.userAgent.toLowerCase().indexOf("touch")>-1){_play.system.capabilities.hasTouch=true;if(typeof window.PointerEvent=="function")document.addEventListener("pointermove",_play.system.device.updateInputDevice);else if(!_play.system.isIOS())document.addEventListener("mouseover",_play.system.device.updateInputDevice)}else{_play.system.capabilities.hasMouse=
true;_play.tools.log("DETECTED INPUT DEVICE: MOUSE","ARC")}},cookies:function(){try{document.cookie="nxp_validate=1"}catch(e){_play.system.capabilities.hasCookies=false}},localStorage:function(){try{if("localStorage"in window&&window["localStorage"]!==null)try{localStorage.setItem("nxp_isprivate","1");localStorage.removeItem("nxp_isprivate")}catch(e$1){if(e$1&&e$1.code==22)try{_play.tools.log("STORAGE QUOTA EXCEEDED","ARC");_play.system.storage.clear();localStorage.setItem("nxp_isprivate","1");localStorage.removeItem("nxp_isprivate")}catch(e){_play.system.capabilities.hasStorage=
false}else _play.system.capabilities.hasStorage=false}else _play.system.capabilities.hasStorage=false}catch(e$2){_play.system.capabilities.hasStorage=false}if(_play.system.capabilities.hasStorage){_play.system.capabilities.hasStorageManager=_play.system.environment.isSecureOrigin&&typeof navigator.storage=="object"&&typeof navigator.storage.estimate=="function"&&typeof navigator.storage.persisted=="function";if(_play.system.capabilities.hasStorageManager)navigator.storage.estimate().then(function(i){var v=
i.usage/i.quota;_play.tools.log("USED CACHE: "+(v*100).toFixed(2)+"%","ARC");if(v>.75)_play.system.capabilities.hasStorage=false})}},mobileFeatures:function(){if(_play.system.isWinPhone()&&_play.system.getWinPhoneVersion()<8.1)_play.system.capabilities.hasInlineVideo=false;else if(_play.system.isIOS()&&!/(ipad)/i.test(navigator.userAgent.toLowerCase()))if(_play.system.getIOSVersion()<10)_play.system.capabilities.hasInlineVideo=false;if(!_play.system.environment.isWebView)if(["mobile","tablet"].indexOf(_play.system.device.type)>
-1)if(_play.system.isIOS()&&_play.system.getIOSVersion()>=10)_play.system.capabilities.hasMutedAutoPlay=true;else{if(_play.system.isAndroid())if(_play.system.isChrome()&&_play.system.getChromeVersion()>=53)_play.system.capabilities.hasMutedAutoPlay=true;else if(_play.system.isFirefox())_play.system.capabilities.hasMutedAutoPlay=true}else if(!_play.system.isTV()&&_play.system.isSafari()&&_play.system.getSafariVersion()>=11)_play.system.capabilities.hasMutedAutoPlay=true},codecs:function(){try{var v=
document.createElement("video");var a=document.createElement("audio");if(v.webkitSupportsPresentationMode&&typeof v.webkitSetPresentationMode=="function")_play.system.capabilities.hasPIP=true;if("setMediaKeys"in v)_play.system.capabilities.hasDRM=_play.system.environment.isSecureOrigin;var m=v.canPlayType("video/mp4");if(m&&m!=""&&m!="no")_play.system.capabilities.hasMP4=true;m=v.canPlayType('video/webm; codecs="vp8"');if(m&&m!=""&&m!="no"){_play.system.capabilities.hasWebM=true;m=v.canPlayType('video/webm; codecs="vp9"');
if(m&&m!=""&&m!="no")_play.system.capabilities.hasVP9=true}m=v.canPlayType("application/vnd.apple.mpegURL");if(m&&m!=""&&m!="no")_play.system.capabilities.hasHLS=true;m=a.canPlayType("audio/mp3");if(m&&m!=""&&m!="no")_play.system.capabilities.hasMP3=true;m=a.canPlayType('audio/webm; codecs="opus"');if(m&&m!=""&&m!="no")_play.system.capabilities.hasOpus=true}catch(e){}},webp:function(){if(!_play.system.isWinApp()){var w=new Image;w.onload=w.onerror=function(){if(w.height==2)_play.system.capabilities.hasWebP=
true};try{w.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}catch(e){}}},webgl:function(){if(!!window.WebGLRenderingContext){var cv=document.createElement("canvas");try{var cx=cv.getContext("webgl");if(cx&&typeof cx.getParameter=="function"){_play.system.capabilities.hasWebGL=true;if(!_play.system.capabilities.hasInlineVideo)_play.system.capabilities.hasWebGL=false}}catch(e){}}},webview:function(){if(!_play.system.environment.isWebView){var t=
false;if(navigator.userAgent.indexOf("FBAN")>-1||navigator.userAgent.indexOf("FBAV")>-1)t=true;else if(["fbia"].indexOf(_play.system.device.platform)>-1)t=true;else if(!_play.system.environment.isApp){if(_play.tools.getURLPart(document.referrer,"hostname")=="a.spiegel.de")t=true;if(_play.system.isIOS()){if(!_play.system.isChromeOnIOS()&&!_play.system.isFirefoxOnIOS())if(navigator.userAgent.toLowerCase().indexOf("safari")==-1&&!window.navigator.standalone)t=true}else if(_play.system.isAndroid())if(navigator.userAgent.indexOf("; wv)")>
-1)t=true}if(t)_play.system.environment.isWebView=t;else if("matchMedia"in window){if(window.matchMedia("(display-mode: standalone)").matches)_play.system.environment.isWebApp=true}else if(window.navigator.standalone)_play.system.environment.isWebApp=true;else if(parseInt(_play.tools.getQueryParam("isWebApp"))==1)_play.system.environment.isWebApp=true}},cam:function(){if(_play.system.environment.isApp&&navigator.camera)_play.system.capabilities.hasCam=_play.system.capabilities.hasCamRecord=true;else if(_play.system.environment.isSecureOrigin)if(typeof navigator.mediaDevices==
"object"&&typeof FormData!="undefined"&&!_play.system.isTV())if(typeof navigator.mediaDevices=="object"&&typeof navigator.mediaDevices.enumerateDevices=="function")if(_play.system.isMobile()){_play.system.device.cameraCount=2;_play.system.capabilities.hasCam=true;if(typeof MediaRecorder=="function")_play.system.capabilities.hasCamRecord=true}else{var cc=0;navigator.mediaDevices.enumerateDevices().then(function(e){if(e&&e.length&&e.length>0){for(var i=0;i<e.length;i++)if(e[i].kind=="videoinput"){cc++;
_play.system.capabilities.hasCam=true;if(typeof MediaRecorder=="function")_play.system.capabilities.hasCamRecord=true}_play.system.device.cameraCount=cc}})}},adBlocker:function(){jQuery.getScript("https://pagead2.googlesyndication.com/pagead/show_ads.js").done(function(s){_play.system.environment.isAdBlocking=false}).fail(function(r){_play.tools.log("AD BLOCKER DETECTED","ARC");_play.system.environment.isAdBlocking=true})}},analyze:function(){_play.tools.log("ANALYZING SYSTEM","ARC");_play.system.capabilities.hasDebugColor=
!_play.system.isIE()||_play.system.isEdge()&&_play.system.getEdgeVersion()>=16;_play.system.capabilities.hasCORS=typeof JSON=="object"&&typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest;_play.system.environment.isSecureOrigin=typeof window.isSecureContext=="boolean"?window.isSecureContext:["https","file"].indexOf(document.location.protocol.replace(":",""))>-1;_play.system.environment.isEmbedded=window.self!==window.top;_play.system.environment.isApp=typeof _app=="object"&&
typeof _app.session.onPlayReady=="function";_play.system.environment.isONE=_play.session.context!="play"&&_play.config.client.id!=_play.config.constants.ADMINCLIENT;_play.system.environment.isOMNIA=_play.session.context!="play"&&_play.config.client.id==_play.config.constants.ADMINCLIENT;_play.system.environment.isSSL=document.location.protocol=="https:";_play.system.capabilities.hasBeacon="sendBeacon"in navigator;_play.system.capabilities.hasWebPush="serviceWorker"in navigator&&"PushManager"in window&&
"ServiceWorkerRegistration"in window&&"showNotification"in ServiceWorkerRegistration.prototype;_play.system.capabilities.hasFetch="fetch"in window;_play.system.capabilities.hasFetchAbort=typeof AbortController=="function";_play.system.capabilities.hasComputedStyle=typeof window.getComputedStyle=="function";_play.system.capabilities.hasAirPlay="WebKitPlaybackTargetAvailabilityEvent"in window;_play.system.capabilities.hasCaptions=typeof document.createElement("video").addTextTrack=="function"&&(typeof TextTrackCue==
"function"||typeof VTTCue=="function"||typeof VTTCue=="object");_play.system.capabilities.hasGeo=_play.system.environment.isApp||typeof navigator.geolocation=="object"&&_play.system.environment.isSecureOrigin;_play.system.capabilities.hasBroadcast="BroadcastChannel"in window;_play.system.capabilities.hasPerformance=typeof performance=="object"&&typeof performance.timing=="object"&&typeof performance.now=="function";_play.system.capabilities.hasPerformanceResource=_play.system.capabilities.hasPerformance&&
typeof window.PerformanceResourceTiming=="function"&&typeof window.performance.getEntriesByName=="function";_play.system.capabilities.hasIntersectionOberserver=typeof IntersectionObserver=="function";_play.system.capabilities.hasResizeObserver=typeof ResizeObserver=="function";_play.system.capabilities.hasPostMessage="postMessage"in window;_play.system.capabilities.hasHistory=typeof history.pushState!=="undefined";_play.system.capabilities.hasMediaSession="mediaSession"in navigator;_play.system.capabilities.hasPageVisibility=
typeof document.visibilityState!="undefined";_play.system.capabilities.hasClipboard=(typeof document.execCommand=="function"||typeof Selection=="function")&&typeof Clipboard=="function";_play.system.capabilities.hasNetworkInformation=typeof navigator.connection=="object";_play.system.capabilities.hasQuerySelector="querySelector"in document;_play.system.capabilities.hasDASH=typeof window.MediaSource=="function"&&!_play.system.isIOS();_play.system.capabilities.hasNativeShare=_play.system.environment.isApp||
_play.system.environment.isSecureOrigin&&typeof navigator.share=="function";_play.system.capabilities.hasNotification=_play.system.environment.isSecureOrigin&&"Notification"in window;_play.system.capabilities.hasDragDrop=typeof FormData!="undefined"&&typeof FileReader!="undefined"&&"draggable"in document.createElement("div");_play.system.fullscreen.init();for(var i in _play.system.checkFor)if(i!="adBlocker")_play.system.checkFor[i]();if(!_play.system.capabilities.hasCORS){_play.tools.log("PLATFORM IS NOT SUPPORTED",
"ARC");_play.system.environment.isSupported=false}else if(_play.system.isWinPhone()&&_play.system.getWinPhoneVersion()<8||_play.system.isAndroid()&&!_play.system.isFirefox()&&_play.system.getAndroidVersion(true)<4.2){_play.tools.log("PLATFORM IS NOT SUPPORTED","ARC");_play.system.environment.isSupported=false}}},tools:{popup:null,log:function(txt,orig){if(_play.session.isDebug&&(_play.session.debugFilters.length==0||_play.session.debugFilters.indexOf(orig)>-1))if(_play.system.capabilities.hasDebugColor){var cm=
_play.config.constants.COLORCODES[orig];cm=cm||"102133";console.log("%c"+orig+" "+"%c"+txt,"color:#FFF;padding-left:6px;margin-right:6px;background:#"+cm,"color:#111")}else console.log(orig+": "+txt)},getRandom:function(min,max){return Math.floor(Math.random()*(max-min+1)+min)},getVersionString:function(i){var t="1.0.00";i=i.toString();if(i&&i.length==4)t=i.substr(0,1)+"."+i.substr(1,1)+"."+i.substr(2,2);return t},strPad:function(v,length){length=length||2;var str=""+v;while(str.length<length)str=
"0"+str;return str},strip:function(html){return html.replace(/<\/?(?!!)[^>]*>/gi,"")},reverse:function(str){return str.split("").reverse().join("")},parseInt:function(i){return parseInt(i,10)},getUniqueID:function(t){_play.session.counter++;t=t||_play.session.getTime();return t+"_"+_play.tools.getRandom(1E3,0)+"_"+_play.session.counter},getURL:function(getCanonical){var t="";if(_play.system.environment.isApp)t=_app.tools.getURL();else if(_play.system.environment.isEmbedded){if(document.referrer!=
"")t=document.referrer}else{t=document.location.href;if(getCanonical&&_play.system.capabilities.hasQuerySelector){var l=document.querySelector("link[rel='canonical']");if(l&&l.href&&l.href!="")t=l.href}}return t},getURLPart:function(u,p){var ur;if(u&&u!="")if(typeof URL=="function")try{ur=new URL(u)}catch(e){}else{ur=document.createElement("a");ur.href=u}return ur&&ur[p]?ur[p]:""},getURLHost:function(){return _play.tools.getURLPart(_play.system.environment.isEmbedded?document.referrer:_play.tools.getURL(),
"hostname")},getURLPath:function(){return _play.tools.getURLPart(_play.system.environment.isEmbedded?document.referrer:_play.tools.getURL(),"pathname")},getQueryParam:function(a){var t="";var q=window.location.search.substring(1);var v=q.split("&");for(var i=0;i<v.length;i++){var p=v[i].split("=");if(p[0]==a)t=p[1]}return t},getFileName:function(url){url=url.split("?")[0];url=url.substr(url.lastIndexOf("/")+1);return url},getCacheBuster:function(skipMinutes){var d=new Date;var t=""+d.getUTCFullYear();
t+=_play.tools.strPad(d.getUTCMonth()+1+"");t+=_play.tools.strPad(d.getUTCDate()+"");t+=_play.tools.strPad(d.getUTCHours()+"");if(!skipMinutes)t+=_play.tools.strPad(d.getUTCMinutes()+"");return t},getImageVersion:function(t,m){m=m||2;t=t.replace("x2.","").replace("x3.","");if(t.indexOf("nodata")==-1){t=t.replace("xL.",".");var ts=t.split("/");var p=ts.pop();t=ts.join("/")+"/"+p.replace(".","x"+m+".")}if(_play.system.capabilities.hasWebP)t=t.replace(/\.jpg|\.png/,".webp");return t},getMaxImage:function(id){var t=
id.thumb;if(id.thumb_hasX3==1)t=_play.tools.getImageVersion(t,3);else if(id.thumb_hasX2)t=_play.tools.getImageVersion(t,2);else if(_play.system.capabilities.hasWebP)t=t.replace(/\.jpg|\.png/,".webp");return t},getFilterImage:function(streamtype,id,actions,modifier,format){actions=actions?"/"+actions:"";modifier=modifier?"/"+modifier:"";format=format?"."+format:"";return"https://images"+_play.session.dataDomain+".nexx.cloud/"+streamtype+"/"+id+actions+modifier+format},getEmbedLink:function(clid,playParam,
playMode,delay,autoPlay,dataMode,playLicense,disableAds,streamFilter){var l=_play.config.constants.EMBEDROOT;if(_play.config.client.ownembedurl&&_play.config.client.ownembedurl!="")l="https://"+_play.config.client.ownembedurl+"/";if(!_play.system.environment.isSSL||_play.system.environment.isOMNIA)l=l.replace("https:","http:");l+=(!playLicense||playLicense==""?clid:playLicense)+"/";l+=playMode+"/"+playParam;if([0,1].indexOf(autoPlay)>-1)l+="?autoPlay="+autoPlay;if(delay)l+=(l.indexOf("?")==-1?"?":
"&")+"delay="+delay;if(dataMode)l+=(l.indexOf("?")==-1?"?":"&")+"dataMode="+dataMode;if(disableAds)l+=(l.indexOf("?")==-1?"?":"&")+"disableAds=1";if(streamFilter)l+=(l.indexOf("?")==-1?"?":"&")+"streamingFilter="+streamFilter;return l},getEmbedCode:function(clid,playParam,playMode,delay,w,h,autoPlay,dataMode,playLicense,disableAds,streamFilter){w=w||640;h=h||360;return"<iframe width='"+w+"' height='"+h+"' src='"+_play.tools.getEmbedLink(clid,playParam,playMode,delay,autoPlay,dataMode,playLicense,
disableAds,streamFilter)+"' frameborder='0' allow='autoplay; encrypted-media; fullscreen' allowfullscreen></iframe>"},preloadImages:function(e){for(var i=0;i<e.length;i++)if(e[i]&&e[i]!=""){if(e[i].substr(0,2)=="//")e[i]="http"+(_play.system.environment.isSSL?"s":"")+":"+e[i];_play.tools.log("PRELOAD IMAGE: "+e[i],"PLAY");var img=new Image;img.src=e[i]}},shuffleArray:function(d){for(var c=d.length-1;c>0;c--){var b=Math.floor(Math.random()*(c+1));var a=d[c];d[c]=d[b];d[b]=a}return d},uniqueArray:function(arr){var u=
arr.filter(function(itm,i,a){return i==a.indexOf(itm)});return u},sanitizeString:function(i){var allowed="";var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;var commentsAndPhpTags=/\x3c!--[\s\S]*?--\x3e|<\?(?:php)?[\s\S]*?\?>/gi;return i.replace(commentsAndPhpTags,"").replace(tags,function($0,$1){return allowed.indexOf("y"+$1.toLowerCase()+">")>-1?$0:""}).trim()},encodeValue:function(i){return encodeURIComponent(_play.tools.sanitizeString(i))},getClientText:function(t){var txt=t;if(_play.config.client.useFormalSpeech==
1)if(_play.config.templates[t+"_formal"])if(_play.config.templates[t+"_formal"]!="")txt=_play.config.templates[t+"_formal"];if(txt==t)if(_play.config.templates[t])txt=_play.config.templates[t];return txt},addScript:function(url,andStore){return new Promise(function(resolve,reject){var id=_play.tools.getUniqueID();var mustDownload=true;if(url.substr(0,4)!="http")if(_play.system.environment.isApp&&url.substr(0,4)=="libs"){_app.tools.addJS(url);andStore=false;mustDownload=false}else if(!_play.session.isStage)url=
_play.config.constants.ARCROOT+url.replace("js/","sdk/").replace(".js","")+(url.indexOf("libs")>-1?"_"+_play.config.constants.LIB_VERSION:"")+".js";else url="https://arc"+_play.session.dataDomain+".nexx.cloud/"+url+"?v="+Math.random();if(andStore){var data=_play.system.storage.get(url);if(data)try{data=JSON.parse(data);if(data&&data.v&&data.v==_play.config.constants.SDK_VERSION){_play.tools.log("GETTING FROM LOCAL CACHE: "+url,"ARC");_play.tools.appendScript(id,data.t);mustDownload=false}}catch(e){}}if(mustDownload)_play.system.connection.getFile(url,
false,false,false,false).then(function(r){if(r.status<400){if(andStore&&r.data.length<=5E5)_play.system.storage.set(url,JSON.stringify({t:r.data,v:_play.config.constants.SDK_VERSION}));var s=document.createElement("script");s.text=r.data;s.setAttribute("id","nxps-"+id);s.setAttribute("type","text/javascript");s.setAttribute("charset","utf-8");s.setAttribute("crossorigin","anonymous");try{document.getElementsByTagName("head")[0].appendChild(s)}catch(e$3){}resolve()}else reject()});else resolve()})},
addStyle:function(u,h){if(!u){h=h||_play.config.client.id;if(_play.session.isStage)u="https://arc"+_play.session.dataDomain+".nexx.cloud/css/play/"+h+(h!=_play.config.client.id?".php":"");else u=_play.config.constants.ARCROOT+"css/play/"+h+"_"+(h==_play.config.client.id?_play.config.constants.CLIENT_VERSION:_play.config.constants.SDK_VERSION)+".css";_play.tools.log("ADDING STYLE FROM "+u,"ARC")}var a=document.createElement("link");a.setAttribute("href",u);a.setAttribute("type","text/css");a.setAttribute("media",
"all");a.setAttribute("rel","stylesheet");document.getElementsByTagName("head")[0].appendChild(a)},openWindow:function(u){_play.tools.log("OPENING NEW WINDOW "+u,"ARC");if(_play.system.environment.isApp)_app["native"].browser.openWindow(u);else{var w=window.open(u);if(w){w.opener=null;w.focus()}else if(_play.system.environment.isONE){if(typeof _client.noPopup=="function")_client.noPopup()}else if(_play.system.environment.isOMNIA)_omnia.messaging.addWarning("popupblocker")}},openPopup:function(u,w,
h,sc){_play.tools.log("OPENING NEW POPUP "+u,"ARC");if(_play.system.environment.isApp)_app["native"].browser.openPopup(u);else if(_play.system.environment.isWebView){if(_play.system.environment.isONE)if(typeof _client.noPopup=="function")_client.noPopup(true)}else{sc=!sc?0:1;w=w||800;h=h||400;_play.tools.popup=window.open(u,"_popup","width="+w+",height="+h+",toolbar=0,resizable=yes,left="+Math.floor((screen.width-w)/2)+",top=100,screenX="+Math.floor((screen.width-w)/2)+",screenY=100,location=0,status=0,menubar=0,scrollbars="+
sc);if(_play.tools.popup)_play.tools.popup.focus();else if(_play.system.environment.isONE){if(typeof _client.noPopup=="function")_client.noPopup()}else if(_play.system.environment.isOMNIA)_omnia.messaging.addWarning("popupblocker")}},closePopup:function(){if(_play.system.environment.isApp)_app["native"].browser.close();else if(_play.tools.popup)try{_play.tools.popup.close();_play.tools.popup=null}catch(e){}},share:function(g,i,mt,otherURL){var sm=g;var tp="";var t="";switch(g){case "facebook":g="http://www.facebook.com/sharer.php?u=";
tp="&t=";break;case "plus":g="https://plus.google.com/share?url=";break;case "twitter":g="https://twitter.com/intent/tweet?url=";tp="&text=";break;case "wykop":g="http://www.wykop.pl/dodaj/link/?url=";tp="&title=";break;case "reddit":g="http://www.reddit.com/submit?url=";tp="&title=";break;case "tumblr":g="https://www.tumblr.com/share/video?embed="+encodeURIComponent(i)+"&url=";break;case "digg":g="http://www.digg.com/tools/diggthis/confirm?url=";break;case "whatsapp":g="whatsapp://send?text=";break;
case "linkedin":g="https://www.linkedin.com/shareArticle?url=";tp="&title=";break;case "xing":g="https://www.xing.com/spi/shares/new?url=";break;case "messenger":g="fb-messenger://share?link=";break}if(otherURL)t=otherURL;else t=_play.tools.getURL(true);_play.tools.log("SHARING "+t+" VIA "+sm,"ARC");if(sm=="native"){if(!mt&&_play.system.capabilities.hasQuerySelector){var ti=document.querySelector("title");if(ti)mt=ti.innerText}if(_play.system.environment.isApp)_app["native"].share(t,mt);else navigator.share({title:mt,
url:t})}else if(sm=="facebook"&&!_play.system.environment.isEmbedded&&typeof FB=="object"&&typeof FB.ui=="function")FB.ui({method:"share",href:t});else{t=encodeURIComponent(t);if(mt&&tp!="")t+=tp+encodeURIComponent(mt);_play.tools.openPopup(g+t,820,410,1)}}},session:{cid:0,index:0,counter:1E3,context:"play",language:"de",isStage:false,isDebug:false,usesReco:false,isSVM:true,dataDomain:"",debugFilters:[],affiliatePartner:0,playLicense:0,playLicenseHash:"",playLicenseAdref:"",styleLoaded:false,
monitor:{initTime:0,startTime:0,displayTime:0,sessionTimer:null,keepAliveTimer:null,lastActive:0,activeSeconds:0,passiveSeconds:0,init:function(){window.addEventListener("beforeunload",_play.session.onUnload,false);window.addEventListener("resize",_play.session.onResize,false);window.addEventListener("devicelight",_play.session.onLightChange,false);window.addEventListener("hdEvent",_play.addons.svm.onEvent,false);if(screen.orientation&&_play.system.environment.isSecureOrigin){screen.orientation.addEventListener("change",
_play.session.onOrientationChange,false);_play.system.device.updateOrientation()}else if(typeof window.orientation=="number"){window.addEventListener("orientationchange",_play.session.onOrientationChange,false);_play.system.device.updateOrientation()}if(!window.onerror&&!_play.session.isDebug)window.onerror=_play.session.onError;if(_play.system.capabilities.hasPageVisibility)document.addEventListener("visibilitychange",_play.session.onPageVisiblityChange,false);if(_play.system.capabilities.hasFullscreen)document.addEventListener("fullscreenchange",
_play.session.onFullscreenEvent,false);if(_play.system.capabilities.hasNetworkInformation){_play.system.connection.init();if("onchange"in navigator.connection)navigator.connection.addEventListener("change",_play.system.connection.getDetails,false)}if(_play.system.environment.isEmbedded)window.addEventListener("message",_play.session.onPostMessage,false);if(_play.system.capabilities.hasHistory&&"scrollRestoration"in history&&_play.system.environment.isONE)history.scrollRestoration="manual";if(!_play.system.environment.isApp){window.addEventListener("online",
_play.session.onOnline,false);window.addEventListener("offline",_play.session.onOffline,false)}_play.session.monitor.sessionTimer=window.setInterval(function(){if(_play.system.environment.isVisible)_play.session.monitor.activeSeconds++;else _play.session.monitor.passiveSeconds++},1E3);if(_play.system.environment.isONE||_play.system.environment.isOMNIA){_play.tools.log("ENABLING HEARTBEAT","ARC");window.setInterval(function(){if(!_play.system.environment.isUnloading)_samaritan.emitSessionEvent(_samaritan.events.SESSIONTIME,
{duration:_play.session.monitor.activeSeconds+_play.session.monitor.passiveSeconds,active:_play.session.monitor.activeSeconds,passive:_play.session.monitor.passiveSeconds},_play.session.cid,true)},6E4);window.addEventListener("beforeinstallprompt",function(e){e.userChoice.then(function(cr){if(cr.outcome!="dismissed")_play.tools.log("WEBAPP INSTALLED","ARC")})})}},update:function(){_play.session.monitor.lastActive=_play.session.getTime();if(_play.session.cid&&_play.session.cid!=""&&_play.session.cid!=
_play.config.constants.STATICSESSION){_play.system.storage.set("nxp_cid",_play.session.cid);_play.system.cookies.set("nxp_cid",_play.session.cid);_play.system.storage.set("nxp_time",_play.session.monitor.lastActive);_play.system.cookies.set("nxp_time",_play.session.monitor.lastActive);if(!_play.session.monitor.keepAliveTimer&&_play.system.capabilities.hasCORS){_play.tools.log("ENABLING KEEPALIVE","ARC");_play.session.monitor.keepAliveTimer=window.setInterval(function(){if(!_play.system.environment.isUnloading){_play.tools.log("EXTENDING SESSION DURATION",
"ARC");_play.system.connection.callAPI("/session/keepalive")}},15*60*1E3)}}},restore:function(){if(_play.session.cid==0){var c=_play.system.storage.get("nxp_cid");var t=_play.system.storage.get("nxp_time");if(t&&c&&t!=""&&c!="")if(_play.session.getTime()-_play.tools.parseInt(t)<30*60){_play.tools.log("RESTORING CID TO "+c,"ARC");_play.session.cid=c}}},api:function(e,m,p){if(_play.system.capabilities.hasPerformanceResource){var o=window.performance.getEntriesByName(_play.config.constants.APIROOT+_play.config.client.id+
e);if(o&&o.length)for(var i=o.length-1;i>=0;i--)if(o[i].duration&&o[i].duration>0){var oo={method:m.calledwith,duration:o[i].duration,processing:m.processingtime,precisionMode:"request",code:m.status};if(m.status&&p)oo.parameters=p;_samaritan.emitSessionEvent(_samaritan.events.PERFORMANCE,oo);break}}}},onUnload:function(){_play.system.environment.isUnloading=true;if(_play.system.capabilities.hasBeacon){var a="";var o={cid:_play.session.cid,client:_play.config.client.id,emitter:_play.system.device.id,
at:_play.session.monitor.activeSeconds,pt:_play.session.monitor.passiveSeconds,page:_play.tools.getURLPart(_play.system.environment.isEmbedded?document.referrer:_play.tools.getURL(),"pathname"),host:_play.tools.getURLPart(_play.system.environment.isEmbedded?document.referrer:_play.tools.getURL(),"hostname")};var pd=[];Object.keys(_play._factory.control.players).forEach(function(i){if(_play._factory.control.players[i].type=="player"){var p=_play.control.getMediaData(i);if(p){_play.system.device.history.update(p.mediaID,
p.streamtype,p.currentTime);pd.push(p)}}});a+="&playerdata="+JSON.stringify(pd);if(_play.system.environment.isONE)a+="&pagedata="+JSON.stringify(_one.tools.getPIData());var succ=navigator.sendBeacon(_play.config.constants.SERVICEROOT+"play/beacon.omnia","monitordata="+JSON.stringify(o)+a);_play.tools.log("BEACON PREPARED "+(!succ?"UN":"")+"SUCCESSFULLY","ARC")}},onReady:function(){if(document.readyState!="loading"){if(_play.session.monitor.startTime==0){_play.session.monitor.init();if(_play.system.environment.isSupported){_play._factory.ui.tooltip.init();
if(typeof jQuery.halcyon!="function")_play._factory.registerPlugin();if(typeof _play._factory.registerCapturePlugin=="function")_play._factory.registerCapturePlugin();if(_play.addons.reco.provider!=""){_play.session.usesReco=true;_play.addons.reco[_play.addons.reco.provider].init()}_play._factory.data.init();_play._factory.control.init()}_play.session.monitor.startTime=_play.session.monitor.lastActive=_play.session.getTime(true);_play.session.monitor.restore();_play.tools.log("nexxPLAY IS READY IN "+
(_play.session.monitor.startTime-_play.session.monitor.initTime)/1E3,"ARC");if(_play.system.environment.isApp)_app.session.onPlayReady();else{window.nexxPLAYReady=true;if(typeof jQuery!="undefined")jQuery(window).trigger("nexxplay.ready");if(typeof window.onPlayReady=="function")window.onPlayReady()}}}else{_play.tools.log("DEFERRING READY DUE TO READYSTATE","ARC");document.addEventListener("readystatechange",function(){_play.tools.log("DOCUMENT READY","ARC");_play.session.onReady()})}},onFrontendReady:function(){if(_play.system.capabilities.hasPerformance){var n=
_play.session.getTime();_samaritan.emitSessionEvent(_samaritan.events.PAGEPERFORMANCE,{technology:_play.system.environment.isApp?"app":"page",scriptTime:_play.session.monitor.initTime/1E3-window.performance.timing.requestStart/1E3,initTime:n-_play.session.monitor.initTime/1E3,totalTime:n-window.performance.timing.requestStart/1E3})}},onError:function(msg,url,line,col,eo){if(msg&&msg!=""&&msg.toLowerCase()!="script error."){_play.tools.log("ERROR EVENT RECEIVED","ARC");if(url.indexOf("ima3")==-1)_samaritan.emitSessionEvent(_samaritan.events.JSERROR,
{message:"jserror",error:msg,url:url,line:line,stack:JSON.stringify(eo),appversion:_play.system.environment.isApp?_app.config.constants.VERSION:0,frameworkversion:_play.config.constants.SDK_VERSION})}return true},onResize:function(){if(_play.session.monitor.startTime>0){_play.tools.log("RESIZE EVENT RECEIVED","ARC");_play._factory.ui.tooltip.mw=jQuery(window).width();if(!_play.system.capabilities.hasResizeObserver)_play._factory.control.sendEvent("resize")}},onLightChange:function(e){if(e.value!=
_play.system.device.lightLevel){_play.tools.log("LIGHT CHANGE EVENT RECEIVED","ARC");_play.system.device.lightLevel=e.value}},onOrientationChange:function(){_play.tools.log("ORIENTATION CHANGE EVENT RECEIVED","ARC");_play.system.device.updateOrientation();_play._factory.control.sendEvent("orientationChange")},onOnline:function(){_play.tools.log("ONLINE EVENT RECEIVED","ARC");_play.system.connection.isOnline=true;_play._factory.control.sendEvent("networkstateChange");_play.config.listeners.network.forEach(function(i){i.call(null)})},
onOffline:function(){_play.tools.log("OFFLINE EVENT RECEIVED","ARC");_play.system.connection.isOnline=false;_play._factory.control.sendEvent("networkstateChange");_play.config.listeners.network.forEach(function(i){i.call(null)})},onNativeEvent:function(type,data,div){div=div||"videoplayer";var o=_play.control.getMediaData();var f=_play._factory.control.players[div].config;_play.tools.log("NATIVE EVENT RECEIVED: "+type+": "+JSON.stringify(data),"ARC");_play._factory.control.processNotification(type,
data,"video",0,div,o.mediaID,f.dataMode,false)},onPostMessage:function(e){if(e&&e.data&&e.data.cmd){_play.tools.log("POSTMESSAGE EVENT RECEIVED: "+JSON.stringify(e.data),"ARC");var param=e.data.param||null;switch(e.data.cmd){case "getMediaData":case "getCurrentTime":case "getCaptionData":var o=_play.control[e.data.cmd]();o.event="getMediaData";e.source.postMessage(o,e.origin);break;default:_play.control.interact[e.data.cmd.toLowerCase()](param);break}}},onBroadcast:function(e){_play.tools.log("BROADCAST MESSAGE RECEIVED",
"ARC");_play.config.listeners.broadcast.forEach(function(i){i.call(null,e)})},onNetworkInformation:function(){_play.tools.log("NETWORK UPDATE RECEIVED","ARC")},onGeoPosition:function(e){if(e){_play.tools.log("GEO UPDATE RECEIVED","ARC");if(e.code)_play.system.geo.code=e.code;if(e.country)_play.system.geo.country=e.country;if(e.city)_play.system.geo.city=e.city;if(e.heading)_play.system.geo.heading=parseFloat(e.heading);if(e.coords){_play.system.geo.lat=parseFloat(e.coords.latitude);_play.system.geo.lng=
parseFloat(e.coords.longitude);if(e.coords.altitude)_play.system.geo.altitude=parseFloat(e.coords.altitude)}_play.config.listeners.geo.forEach(function(i){i.call(null,e)})}},onPageVisiblityChange:function(fromApp){if(typeof fromApp!="string")_play.system.environment.isVisible=document.visibilityState=="visible";else _play.system.environment.isVisible=fromApp=="visible";_play.tools.log("PAGE VISIBILITY EVENT RECEIVED: "+(_play.system.environment.isVisible?"VISIBLE":"HIDDEN"),"ARC");_play._factory.control.sendEvent("pageVisibilityChange");
_play.config.listeners.pageVisibility.forEach(function(i){i.call(null)})},onFullscreenEvent:function(){if(typeof document.webkitCurrentFullScreenElement=="object")document.fullscreenElement=document.webkitCurrentFullScreenElement;_play.system.environment.isFullscreen=document.fullscreenElement!=null;_play.tools.log("FULLSCREEN EVENT RECEIVED: "+(_play.system.environment.isFullscreen?"FULLSCREEN":"INLINE"),"ARC");if(document.fullscreenElement)_play.system.fullscreen.lastElement=document.fullscreenElement.parentElement.getAttribute("id");
_play._factory.control.sendCommand(_play.system.fullscreen.lastElement,"","","fullscreenChange")},onHeadsetEvent:function(){_play.tools.log("HEADSET EVENT RECEIVED: "+(_play.system.device.isHeadsetConnected?"CONNECTED":"REMOVED"),"ARC");Object.keys(_play._factory.control.players).forEach(function(i){_play._factory.control.sendCommand(i,"","","headsetChange")})},getTime:function(getMS,getMSbutRound){var t=!_play.system.capabilities.hasPerformance?(new Date).getTime():performance.timing.navigationStart+
performance.now();if(!getMS)t=Math.floor(t/1E3);else if(getMSbutRound)t=Math.round(t,0);return t},addScripts:function(){var sis=[];var init=[];var todo=[];if(typeof jQuery!="function")init.push(_play.tools.addScript("libs/jquery_"+(_play.session.context=="play"?"min":"full")+".js",true));if(_play.system.capabilities.hasDASH&&!_play.system.isIOS()&&_play.system.capabilities.hasMP4&&typeof shaka!="object"&&_play.config.client.id!=548)init.push(_play.tools.addScript("libs/shaka"+(_play.config.client.useLiveTransmux==
1?"-mux":"")+".js",true));if(_play.system.device.platform=="chromecast"||_play.config.client.chromecastID!=""&&!_play.system.isTV()&&!_play.system.environment.isApp&&(_play.system.isChrome()||_play.system.isChromeOnIOS()))_play.system.capabilities.hasCast=true;return new Promise(function(resolve,reject){Promise.all(init).then(function(){sis.forEach(function(i){todo.push(_play.tools.addScript(i,true))});Promise.all(todo).then(function(){resolve()})["catch"](function(e){if(_play.session.isDebug)console.log(e);
_play.session.onError("addScripts todo Error","arc.js",0,"",e);reject()})})["catch"](function(e){if(_play.session.isDebug)console.log(e);_play.session.onError("addScripts init Error","arc.js",0,"",e);reject()})})},init:function(){_play.session.monitor.initTime=(new Date).getTime();_play.system.verifyMinimalCapabilities();if(_play.system.environment.isSupported){_play.system.analyze();if(_play.system.environment.isSupported){_play.system.device.init();if(_play.session.isStage){_play.system.storage.clear();
_play.system.cache.clear()}if(!_play.session.styleLoaded){_play.session.styleLoaded=true;_play.tools.addStyle()}_play.session.addScripts().then(function(){_play.session.onReady()})["catch"](function(e){if(_play.session.isDebug)console.log(e);_play.session.onError("addScripts init Error","arc.js",0,"",e)})}else _play.session.onReady()}else _play.session.onReady()}},control:{sdkIsReady:function(){return _play.session.monitor.startTime>0},getInstances:function(){return Object.keys(_play._factory.control.players)},
hasActiveInstances:function(){return _play.control.getInstances().length>0},instanceExists:function(div){return _play._factory.control.players[div]!=null},instanceIsReady:function(div){return _play._factory.control.players[div].isReady},instanceIsPlaying:function(div){return _play._factory.control.getFromPlayer(div,"isPlaying")},instanceIsShowingUI:function(div){return _play._factory.control.getFromPlayer(div,"isShowingUI")},getMediaData:function(div){return _play._factory.control.getFromPlayer(div,
"getMediaData")},getCaptionData:function(div,lang){return _play._factory.control.getFromPlayer(div,"getCaptionData",lang)},getCurrentTime:function(div){return _play._factory.control.getFromPlayer(div,"getCurrentTime")},pauseAll:function(except,canBeResumed){_play.tools.log("PAUSING ALL PLAYERS ("+except+")","ARC");Object.keys(_play._factory.control.players).forEach(function(i){if(i!=except)_play.control.interact.pause(i,canBeResumed)})},continueAll:function(except){Object.keys(_play._factory.control.players).forEach(function(i){if(i!=
except)_play.control.interact["continue"](i)})},interact:{play:function(div,reason){_play._factory.control.sendCommand(div,"play",reason)},pause:function(div,canBeResumed){_play._factory.control.sendCommand(div,"pause",canBeResumed)},"continue":function(div){_play._factory.control.sendCommand(div,"continue")},mute:function(div){_play._factory.control.sendCommand(div,"mute")},unmute:function(div){_play._factory.control.sendCommand(div,"unmute")},next:function(div){_play._factory.control.sendCommand(div,
"next")},previous:function(div){_play._factory.control.sendCommand(div,"prev")},swapToPosition:function(div,pos){_play._factory.control.sendCommand(div,"swaptopos",pos)},swapToMediaItem:function(div,mediaID,streamType,startPosition,delay){_play._factory.control.sendCommand(div,"swapComplex",mediaID,"swapComplex",streamType,startPosition,delay)},seekTo:function(div,pos){_play._factory.control.sendCommand(div,"seek",pos)},seekBy:function(div,pos){_play._factory.control.sendCommand(div,"seek"+(pos>0?
"right":"left"),pos)},enterFullscreen:function(div){_play._factory.control.sendCommand(div,"fullscreen")},exitFullscreen:function(div){_play._factory.control.sendCommand(div,"nofullscreen")},updateUser:function(div){_play._factory.control.sendCommand(div,"updateuser")},showUI:function(div,persistent){_play._factory.control.sendCommand(div,"showui",persistent?1:0)},hideUI:function(div){_play._factory.control.sendCommand(div,"hideui")},lightsOut:function(div){_play._factory.control.sendCommand(div,
"lightsout")},lightsOn:function(div){_play._factory.control.sendCommand(div,"lightson")},updateConfig:function(div,key,val){_play._factory.control.sendCommand(div,"updateconfig",key+"::"+val)},exitPIP:function(div){_play._factory.control.sendCommand(div,"exitpip")},captureImage:function(div,delay){_play._factory.control.sendPluginCommand(div,"captureManager","captureImage",delay)},captureVideo:function(div,delay){_play._factory.control.sendPluginCommand(div,"captureManager","captureVideo",delay)}},
addPlayer:function(div,param,mode,config){var o=null;if(document.getElementById(div))if(_play.system.environment.isSupported){mode=mode||"video";config=config||new _play.PlayerConfiguration;if(_play.tools.getQueryParam("nxp_sbpc")!="")config.addOverride("startContext",_play.tools.getQueryParam("nxp_sbpc"));_play._factory.control.players[div]={index:_play._factory.config.getIndex(),playmode:mode,param:param,type:"player",isReady:false,listeners:[],observer:null,config:config.build()};o=_play._factory.addPlayer(div)}else _play._factory.ui.renderError(div,
"compatible");else if(document.readyState!="complete"){_play.tools.log("DEFERRING ADD-PLAYER DUE TO READYSTATE","ARC");document.addEventListener("readystatechange",function(){_play.tools.log("DOCUMENT READY","ARC");_play.control.addPlayer(div,param,mode,config)})}return o},removePlayer:function(div){_play._factory.removePlayer(div)}}};
_samaritan={events:{DISPLAY:"p_display",PLAY:"p_play",FULLSCREEN:"p_fullscreen",CASTING:"p_casting",PIP:"p_pip",POPOUT:"p_popout",HEADSET:"p_headset",LIGHTSOUT:"p_lightsout",AUDIO:"p_audio",AD:"p_ad",AD_CALL:"p_adcall",AD_CLICK:"p_adclick",AD_ERROR:"p_aderror",PROGRESS:"p_progress",TIME:"p_time",QUALITY:"p_quality",CAPTION:"p_caption",CLICK:"p_click",ENGAGE:"p_engage",ERROR:"p_error",TRICKPLAY:"p_trickplay",PERFORMANCE:"o_apiperformance",PLAYERPERFORMANCE:"o_playerperformance",SESSIONTIME:"o_time",
JSERROR:"o_error",SESSION:"o_session",PAGEVIEW:"o_pageview",SEARCH:"o_search",WIDGET:"o_widget",PAGEPERFORMANCE:"o_pageperformance"},token:"",host:"",queue:[],currentObj:null,counter:0,lastNotBusy:0,i:null,isBusy:false,didRetry:false,cid:0,configure:function(r,t){_play.tools.log("INITING IN REGION "+r,"SAMARITAN");_samaritan.host=_play.config.constants.EVENTHUB.replace("{region}",r)+"/messages";_samaritan.token="sr="+encodeURIComponent(_play.config.constants.EVENTHUB.replace("{region}",r)).toLowerCase()+
"&sig="+t+"&skn=emitter";if(!_samaritan.i)_samaritan.i=window.setInterval(_samaritan.emitFromQueue,5E3)},setCid:function(c){_play.tools.log("SETTING CID TO "+c,"SAMARITAN");if(c.toString()==_play.config.constants.STATICSESSION.toString())c=_play.tools.getUniqueID();_samaritan.cid=c},emitEvent:function(type,item,streamtype,channel,license,pl,ms,forONE,playerIndex,xpc,isAutoPlay,pc,pp,mt,wi,he,clid){if(pl){var t=_play.session.getTime();channel=_play.tools.parseInt(channel)||0;license=_play.tools.parseInt(license)||
0;clid=_play.tools.parseInt(clid)||_play.config.client.id;if(!clid||clid==0||clid=="")clid=_play.config.client.id;if(typeof isAutoPlay=="undefined"||isAutoPlay==null)isAutoPlay=1;var eb={"event":type,"id":_play.tools.getUniqueID(t),"emitter":_play.system.device.id,"time":t,"partition":_play.tools.getRandom(1,4),"slot":_play.tools.getCacheBuster(true),"isOnline":1,"isSSL":_play.system.environment.isSSL?1:0,"version":"1.0.02","environment":{"cl":clid,"pd":_play.config.client.id,"ci":_samaritan.cid,
"la":_play.session.language,"ai":_play.system.environment.isApp?_app.config.constants.ID:0,"ca":0,"af":_play.session.affiliatePartner,"pl":_play.session.playLicense,"lo":_play.system.environment.isApp?_app.session.startOrigin:"","lc":"","ui":_play.tools.parseInt(_play.config.user.id),"up":_play.config.user.payType,"gc":_play.system.geo.code,"lt":_play.system.geo.lat,"ln":_play.system.geo.lng,"gw":_play.system.device.platform,"de":_play.system.device.type,"mo":_play.system.device.model.replace(/('|")/ig,
"").trim(),"ma":_play.system.device.manufacturer.replace(/('|")/ig,"").trim(),"si":_play.session.index,"po":_play.system.environment.isApp?_app.session.portal:"","em":(_play.system.environment.isEmbedded?"embed":"js")+(_play.system.environment.isWebView?"-webview":_play.system.environment.isWebApp?"-webapp":""),"co":_play.system.connection.type,"os":_play.system.device.details[0]||"","ov":_play.system.device.details[1]||"","br":_play.system.device.details[2]||"","bv":_play.system.device.details[3]||
"","sx":_play.system.device.width,"sy":_play.system.device.height,"fl":0},"payload":pl};if(!forONE){streamtype=streamtype||"video";ms=ms||_play.tools.getUniqueID(t);mt=mt||0;pc=pc||["",0];pp=pp||"";eb.contexts={"do":_play.tools.getURLHost(),"pg":_play.tools.getURLPath(),"it":_play.tools.parseInt(item),"ap":isAutoPlay,"st":streamtype,"ms":ms,"pa":pp,"pc":pc[0],"pi":_play.tools.parseInt(pc[1]),"mt":mt,"ml":0,"px":wi?_play.tools.parseInt(wi):_play.system.device.width,"py":he?_play.tools.parseInt(he):
_play.system.device.height,"ch":channel,"li":license}}_samaritan.emit(eb);_samaritan.counter++}else _play.tools.log("EVENT SKIPPED - NO DATA SENT","SAMARITAN")},emitSessionEvent:function(type,payload){_samaritan.emitEvent(type,0,"",0,0,payload,null)},emitPlayEvent:function(fileID,streamType,channel,licenseBy,mediaSession){_samaritan.emitEvent(_samaritan.events.PLAY,fileID,streamType,channel,licenseBy,{playReason:"start",payReason:"",playIndex:0,isBumper:0,isPreview:0,protocol:"http",codec:"",datamode:_play.config.constants.DATAMODE_API,
startedMuted:0,protection:""},mediaSession)},emit:function(obj,fromQueue){if(_samaritan.token&&_samaritan.token!="")if(!_samaritan.isBusy&&_play.system.connection.isOnline)if(obj.event!="o_apiperformance"||fromQueue){_play.tools.log("EMITTING EVENT "+obj.event+(fromQueue?" VIA QUEUE":""),"SAMARITAN");_samaritan.lastNotBusy=_play.session.getTime();_samaritan.counter++;_samaritan.isBusy=true;_samaritan.currentObj=obj;_play.system.connection.postData(_samaritan.host,obj,false,true,{"Authorization":"SharedAccessSignature "+
_samaritan.token,"Content-Type":"application/atom+xml;type=entry;charset=utf8"},true).then(function(r){_samaritan.currentObj=null;_samaritan.isBusy=false;_samaritan.emitFromQueue()})["catch"](function(){if(!_play.system.environment.isUnloading)window.setTimeout(function(){if(!_samaritan.didRetry&&_play.system.connection.isOnline){_samaritan.didRetry=true;_play.system.connection.callAPI("/session/reporttoken").then(function(data){if(data){_samaritan.configure(data.result.reportregion,data.result.reporttoken);
_samaritan.isBusy=false;_samaritan.didRetry=false}})["catch"](function(e){_play.session.onError("Samaritan ReportToken Refresh Error","samaritan.js",0,"",e)})}else{_samaritan.isBusy=false;_samaritan.queue.push(_samaritan.currentObj)}},1500)})}else _samaritan.queue.push(obj);else _samaritan.queue.push(obj);else _samaritan.queue.push(obj)},emitFromQueue:function(){if(_play.system.connection.isOnline)if(_samaritan.queue.length>0){var obj=_samaritan.queue.shift();if(_samaritan.isBusy&&_play.session.getTime()-
_samaritan.lastNotBusy>10)_samaritan.isBusy=false;_samaritan.emit(obj,true)}}};
_play.PlayerConfiguration=function(o){this.overrides=o||{};this.config={adjustContainerDimensions:1,allowOnlyOnePlayerPlaying:1,aspectRatio:.5625,dataMode:"",backgroundColor:"000000",playerSkin:"classic",loaderSkin:"default",hidePrevNext:0,autoPlay:-1,autoPlayIfMutedPossible:-1,autoPlayMutedAlways:-1,autoNext:-1,titleMode:-1,menuMode:-1,scrollingMode:-1,mobileAutoFullscreen:-1,pauseOnPageVisibility:-1,exitMode:"",captionMode:"",disableAds:0,disablePrerolls:0,disableMidrolls:0,disablePostrolls:0,disableBanners:0,
disableBreakAds:0,disableRemoteTarget:0,enableLightsOut:-1,enableLightsOutAutomaticAfter:0,webViewRestrictionsDisabled:0,bumperMode:-1,watermarkMode:-1,streamingFilter:null,delay:0,startPosition:0,sharingData:{},adProvider:"",adType:"",adPrerollURL:"",adMidrollURL:"",adPostrollURL:"",adBannerURL:"",adBreakURL:"",adBumperURL:"",adMidrollInterval:-1,adBannerInterval:-1,adMinimalDistance:-1,adBumperThreshold:-1,paymentReference:"",useMiniPlayer:0,playstateListeners:[]};this.getDefault=function(){return this.config};
this.addOverride=function(key,value){this.overrides[key]=value};this.removeOverride=function(key){delete this.overrides[key]};this.build=function(){this.config.loaderSkin=_play.config.client.loaderSkin;this.config.backgroundColor=_play.config.client.backgroundColor;this.config.playerSkin=_play.config.client.playerSkin;this.config.dataMode=_play.config.client.dataMode;this.config.streamingFilter=_play.config.client.streamingFilter;for(var key in this.overrides)if(this.config.hasOwnProperty(key)||["xMode",
"reportParent","reportParentProtocol","startContext"].indexOf(key)>-1)this.config[key]=this.overrides[key];return this.config}};
_play.PlayerInstance=function(div){this.div=div;_play._factory.control.players[this.div].listeners=_play._factory.control.players[this.div].config.playstateListeners;_play._factory.control.players[this.div].config.playstateListeners=[];this.isReady=function(){return _play.control.instanceIsReady(this.div)};this.isPlaying=function(){return _play.control.instanceIsPlaying(this.div)};this.isShowingUI=function(){return _play.control.instanceIsShowingUI(this.div)};this.getCurrentTime=function(){return _play.control.getCurrentTime(this.div)};
this.getMediaData=function(){return _play.control.getMediaData(this.div)};this.getCaptionData=function(forLanguage){return _play.control.getCaptionData(this.div,forLanguage)};this.play=function(reason){_play.control.interact.play(this.div,reason)};this.pause=function(canBeResumed){_play.control.interact.pause(this.div,canBeResumed)};this.mute=function(){_play.control.interact.mute(this.div)};this.unmute=function(){_play.control.interact.unmute(this.div)};this.next=function(){_play.control.interact.next(this.div)};
this.previous=function(){_play.control.interact.previous(this.div)};this.enterFullscreen=function(){_play.control.interact.enterFullscreen(this.div)};this.exitFullscreen=function(){_play.control.interact.exitFullscreen(this.div)};this.updateUser=function(){_play.control.interact.updateUser(this.div)};this.lightsOut=function(){_play.control.interact.lightsOut(this.div)};this.lightsOn=function(){_play.control.interact.lightsOn(this.div)};this.swapToPosition=function(pos){_play.control.interact.swapToPosition(this.div,
pos)};this.swapToMediaItem=function(mediaID,streamType,startPosition,delay){_play.control.interact.swapToMediaItem(this.div,mediaID,streamType,startPosition,delay)};this.hideUI=function(){_play.control.interact.hideUI(this.div)};this.showUI=function(){_play.control.interact.showUI(this.div)};this.seekTo=function(pos){_play.control.interact.seekTo(this.div,pos)};this.seekBy=function(pos){_play.control.interact.seekBy(this.div,pos)};this.remove=function(){_play.control.removePlayer(this.div)};this.updateConfig=
function(key,val){_play.control.interact.updateConfig(this.div,key,val)};this.exitPIP=function(){_play.control.interact.exitPIP(this.div)};this.addPlaystateListener=function(f){if(typeof f=="function")_play._factory.control.players[this.div].listeners.push(f)}};
_play._factory={config:{currentIndex:-1,getIndex:function(){_play._factory.config.currentIndex++;return _play._factory.config.currentIndex},get:function(div,a,fromMain){var r=null;var t=_play._factory.control.players[div];if(t)if(fromMain)r=t[a];else if(t.config)r=t.config[a];return r},update:function(div,k,v){var t=_play._factory.control.players[div];if(t)_play._factory.control.players[div][k]=v}},data:{aborter:null,signal:null,lastStatus:0,init:function(){if(_play.system.capabilities.hasFetchAbort){_play._factory.data.aborter=
new AbortController;_play._factory.data.signal=_play._factory.data.aborter.signal}},cancelRequest:function(){if(_play._factory.data.aborter){_play.tools.log("ABORTING REQUEST","FACTORY");_play._factory.data.aborter.abort();_play._factory.data.init()}},_connect:function(forceXHR,url,method,data,asJSON,asBlob,headerdata,withCredentials,disableFetchCors,sendJSON,sendText){var body=null;if(data)if(!sendJSON){headerdata=headerdata||{};headerdata["Content-Type"]="application/x-www-form-urlencoded";if(!sendText)if(typeof data==
"object")body=Object.keys(data).map(function(key){return key+"="+encodeURIComponent(data[key])}).join("&");else body=data;else{body=data;headerdata["Content-Length"]=body.length.toString()}}else if(!sendText)body=JSON.stringify(data);return new Promise(function(resolve,reject){if(!forceXHR&&_play.system.capabilities.hasFetch){_play.tools.log("CALLING URL "+url+" VIA "+method.toUpperCase()+"/FETCH","FACTORY");var headers=new Headers;for(var i in headerdata)try{headers.append(i,headerdata[i])}catch(e){}var params=
{method:method,headers:headers,mode:!disableFetchCors?"cors":"no-cors"};if(withCredentials)params.credentials="include";if(data)params.body=body;if(_play._factory.data.signal)params.signal=_play._factory.data.signal;fetch(url,params).then(function(res){if(!res.ok)throw Error(res.statusText);else _play._factory.data.lastStatus=res.status;return asJSON?res.json():asBlob?res.blob():res.text()}).then(function(r){resolve({status:_play._factory.data.lastStatus,data:r})})["catch"](function(e){if(e&&e.name&&
e.name=="AbortError")resolve({status:-1,data:null});else if(e&&e.message&&e.message.toLowerCase().indexOf("not found")>-1)resolve({status:404,data:null});else resolve({status:500,data:null})})}else{_play.tools.log("ACCESSING URL "+url+" VIA "+method.toUpperCase()+"/XHR","FACTORY");var xhr=new XMLHttpRequest;xhr.addEventListener("load",function(){resolve({status:xhr.status,data:asJSON?JSON.parse(xhr.responseText):xhr.responseText})});xhr.addEventListener("error",function(e){resolve({status:500,data:null})});
xhr.open(method,url);for(var j in headerdata)try{xhr.setRequestHeader(j,headerdata[j])}catch(e$4){}if(withCredentials)xhr.withCredentials=true;xhr.send(body)}})},initStaticAdMode:function(rad){if(rad){var plpadd="";if(_play.session.playLicense>0)plpadd="-"+_play.session.playLicense;if(_play.system.environment.isCasted){if(rad["chromecast"+plpadd])_play.config.client.admodel=rad["chromecast"+plpadd]}else if(_play.system.isTV()){if(rad["hyve"+plpadd])_play.config.client.admodel=rad["hyve"+plpadd];if(_play.system.isAmazonFire()&&
rad["hyvefire"+plpadd])_play.config.client.admodel=rad["hyvefire"+plpadd];else if(_play.system.isAndroid()&&rad["hyveplaytv"+plpadd])_play.config.client.admodel=rad["hyveplaytv"+plpadd]}else if(_play.system.device.platform=="html5"||_play.system.device.platform=="html"){if(rad["ssc"+plpadd])_play.config.client.admodel=rad["ssc"+plpadd]}else{var tos=_play.system.device.platform;if(["tablet","fbia","amp"].indexOf(tos)>-1)tos="mobile";var atos=tos+_play.system.device.adtype;if(rad[tos+plpadd])_play.config.client.admodel=
rad[tos+plpadd];if(rad[atos+plpadd])_play.config.client.admodel=rad[atos+plpadd]}}},getClientData:function(dataMode){return new Promise(function(resolve,reject){var askData=true;var d=_play.system.cache.get("clientdata_"+_play.config.client.id);if(d){var dd=JSON.parse(d);if(dd.hasOwnProperty("domaindata")&&dd.domaindata.hash&&dd.domaindata.hash!=""){askData=false;_play.config.client.hash=dd.domaindata.hash;resolve(dd)}}if(askData)if(dataMode==_play.config.constants.DATAMODE_STATIC)_play.system.connection.getFile(_play.config.constants.ARCROOT+
"api/domain/"+_play.config.client.id+".json?v="+_play.tools.getCacheBuster(),true).then(function(i){_play.system.cache.set("clientdata_"+_play.config.client.id,JSON.stringify(i.data.result));resolve(i.data.result)})["catch"](function(){reject()});else _play.system.connection.callAPI("/session/init").then(function(r){if(!_play.config.client.hash||_play.config.client.hash==""){var h=r.device.id;var hash=r.device.clienttoken.substr(_play.tools.parseInt(h.substr(0,1)));_play.config.client.hash=hash.substr(0,
hash.length-_play.tools.parseInt(h.substr(-1)))}r.domaindata.hash=_play.config.client.hash;_play.system.cache.set("clientdata_"+_play.config.client.id,JSON.stringify(r));resolve(r)})["catch"](function(e){reject()})})},checkSession:function(){return new Promise(function(resolve,reject){_play.system.connection.callAPI("/session/init").then(function(r){if(r){_play.config.setCid(r.general.cid);_samaritan.configure(r.system.reportregion,r.system.reporttoken);r.domaindata.hash=_play.config.client.hash;
_play.system.cache.set("clientdata_"+_play.config.client.id,JSON.stringify(r))}resolve()})["catch"](function(e){resolve()})})},getMedia:function(id,streamtype,dataMode){return new Promise(function(resolve,reject){var d=_play.system.cache.get("mediadata_"+id+"_"+streamtype);if(d)resolve(JSON.parse(d));else if(dataMode==_play.config.constants.DATAMODE_STATIC&&["video","audio","live","scene","panorama"].indexOf(streamtype)>-1)_play.system.connection.getFile(_play.config.constants.ARCROOT+"api/"+streamtype+
"/"+id+".json?v="+_play.tools.getCacheBuster(),true).then(function(i){if(!i||!i.data)reject();else resolve(i.data.result)})["catch"](function(){reject()});else{var plm=streamtype;var method="byid";var params={additionalfields:"language,channel,actors,studio,licenseby,slug,fileversion",addInteractionOptions:1,addStatusDetails:1,addStreamDetails:1,addFeatures:1,addCaptions:1,addScenes:1,addHotSpots:1,addBumpers:1,captionFormat:"data"};switch(plm){case "video":case "scene":case "panorama":plm=plm.replace("panorama",
"image")+"s";break;case "variant":plm="videos";method="byvariant";break;case "playlist":plm="playlists";params.addItemData=1;break;case "collection":plm="collections";params.addItemData=1;params.selectedStreamtypes="audio,video";params.addDetailsForItems=1;break;case "videolist":case "audiolist":plm=plm.replace("list","")+(plm=="videolist"?"s":"");method="byitemlist";break;case "audioalbum":plm="audioalbums";params.addItemData=1;break}if(_play.tools.parseInt(_play.config.client.allowdescription)==
1)params.additionalfields+=",subtitle,teaser,description,releasedate";_play.system.connection.callAPI("/"+plm+"/"+method+"/"+id,params).then(function(r){resolve(r)})["catch"](function(e){reject()})}})},initClient:function(div,targetDataMode){return new Promise(function(resolve,reject){if(_play.config.client.isPrepared&&targetDataMode==_play.config.constants.DATAMODE_API)if(!_play.config.client.hash||_play.config.client.hash=="")_play.config.client.isPrepared=false;if(_play.config.client.isPrepared){_play.tools.log("CLIENT IS PREPARED, SKIPPING INIT",
"FACTORY");resolve()}else{_play.tools.log("INIT CLIENT","FACTORY");var dm=_play._factory.config.get(div,"dataMode");_play._factory.data.getClientData(dm).then(function(r){if(r.system.clientstatus!="online")_play._factory.renderError(div,"client");else if(!_play._factory.tools.checkDomain(r.domaindata.allowexternalplay,r.domaindata.domain))_play._factory.renderError(div,"fraud");else{_play.config.client.isPrepared=true;_play.config.templates=r.texttemplates;_play.config.setCid(r.general.cid);_samaritan.configure(r.system.reportregion,
r.system.reporttoken);if(_play.config.client.hash&&_play.config.client.hash!="")r.domaindata.hash=_play.config.client.hash;_play.config.client=Object.assign(_play.config.client,r.domaindata);Object.freeze(_play.config.constants);if(dm==_play.config.constants.DATAMODE_STATIC){_play.config.client.admodel={provider:""};_play._factory.data.initStaticAdMode(r.admodels);var rad=r.admodels;_play.system.connection.callAPI("/session/staticdetails",{gateway:_play.system.device.platform,devh:_play.system.device.id,
playlicense:_play.session.playLicense}).then(function(r){_play.session.playLicenseAdref=r.general.playlicenseAdref;_play.session.onGeoPosition({coords:{latitude:r.general.latitude,longitude:r.general.longitude},code:r.general.geocode});_play.system.device.details=[r.general.os,r.general.os_version,r.general.browser,r.general.browser_version];_play.system.device.update(r.general.device,r.general.manufacturer,r.general.model);if(r.general.sessionIndex)_play.session.index=r.general.sessionIndex;if(r.general.webViewOrigin!=
"")_play.system.environment.isWebView=true;_play._factory.data.initStaticAdMode(rad)})}else{_play._factory.control.processNotification(_play.config.events.SESSION_START,{id:_play.session.cid});_play.config.client.admodel=r.admodel;_play.config.setLanguage(r.general.language);_play.config.setAffiliatePartner(r.general.affiliatePartner);_play.session.playLicenseAdref=r.general.playlicenseAdref;_play.session.onGeoPosition({coords:{latitude:r.general.latitude,longitude:r.general.longitude},code:r.general.geocode});
_play.system.device.details=[r.device.os,r.device.os_version,r.device.browser,r.device.browser_version];_play.session.index=r.device.sessionIndex;_play.system.device.update(r.general.device,r.device.manufacturer,r.device.model);if(r.general.webViewOrigin!="")_play.system.environment.isWebView=true;if(_play.system.environment.isCasted||_play.system.isTV()){_play.config.client.playerSkin="centered";_play.config.client.allowtitle=1;_play.config.client.titlestyle="top";if(_play.system.environment.isApp){if(parseInt(_play.config.client.allowseekbuttons)==
0)_play.config.client.allowseekbuttons=30;_app.addons.tv.setRemoteSeekerInterval(_play.config.client.allowseekbuttons)}}if(!_play.system.environment.isOMNIA)Object.freeze(_play.config.client)}resolve()}})["catch"](function(e){_play._factory.ui.renderError(div,"json");reject()})}})}},ui:{tooltip:{el:null,id:"nxp_tt",cx:0,cy:0,yp:-15,mw:0,cw:"",enabled:false,init:function(){_play._factory.ui.tooltip.mw=jQuery(window).width();if(jQuery("#"+_play._factory.ui.tooltip.id).length==0&&!_play.system.capabilities.hasTouch){_play.tools.log("INITING TOOLTIP",
"FACTORY");var b=jQuery("body");b.append("<div id='"+_play._factory.ui.tooltip.id+"' class='nxp_tt'></div>");b.on("mouseenter","*[data-tooltip]",function(e){_play._factory.ui.tooltip.cx=e.pageX;_play._factory.ui.tooltip.cy=e.pageY;_play._factory.ui.tooltip.update(jQuery(this).attr("data-tooltip"))});b.on("mousemove","*[data-tooltip]",function(e){_play._factory.ui.tooltip.cx=e.pageX;_play._factory.ui.tooltip.cy=e.pageY;_play._factory.ui.tooltip.show()});b.on("mouseleave","*[data-tooltip]",function(){_play._factory.ui.tooltip.hide()});
_play._factory.ui.tooltip.el=jQuery("#"+_play._factory.ui.tooltip.id);_play._factory.ui.tooltip.enabled=true}},setYPos:function(i){_play._factory.ui.tooltip.yp=i?i:-20},show:function(){if(_play._factory.ui.tooltip.enabled&&_play._factory.ui.tooltip.cw!=""){var px=_play._factory.ui.tooltip.cx+15;var py=Math.max(0,_play._factory.ui.tooltip.cy+_play._factory.ui.tooltip.yp);if(px+120>_play._factory.ui.tooltip.mw)px=_play._factory.ui.tooltip.cx-_play._factory.ui.tooltip.el.width()-30;_play._factory.ui.tooltip.el.css({top:py,
left:px}).show()}},hide:function(){if(_play._factory.ui.tooltip.el){_play._factory.ui.tooltip.cw="";_play._factory.ui.tooltip.el.html("").hide()}},update:function(s,p){_play._factory.ui.tooltip.cw=s||"";if(s&&s!=""){if(s.indexOf("::")>-1){var a=s.split("::");var j=jQuery("#"+a[1]);switch(a[0]){case "fieldval":s=j.val();break;case "fieldlength":s=j.val().length;if(a.length>3&&_play.tools.parseInt(a[3])>0)s+=" / "+a[3];s+=" "+a[2];break}}if(_play._factory.ui.tooltip.enabled){if(p){_play._factory.ui.tooltip.cx=
p.x;_play._factory.ui.tooltip.cy=p.y}_play._factory.ui.tooltip.el.html(s);_play._factory.ui.tooltip.show()}}else _play._factory.ui.tooltip.hide()},trigger:function(ns){if(_play._factory.ui.tooltip.enabled){ns=ns||_play._factory.ui.tooltip.cw;_play._factory.ui.tooltip.update(ns)}},triggerTouch:function(x,y,ns){if(!_play._factory.ui.tooltip.el){jQuery("body").append("<div id='"+_play._factory.ui.tooltip.id+"' class='nxp_tt'></div>");_play._factory.ui.tooltip.el=jQuery("#"+_play._factory.ui.tooltip.id)}_play._factory.ui.tooltip.el.html(ns);
_play._factory.ui.tooltip.el.css({top:y,left:x}).show()},updateId:function(i){if(i!=_play._factory.ui.tooltip.id){_play._factory.ui.tooltip.hide();_play.tools.log("UPDATING TOOLTIP CONTAINER TO "+i,"FACTORY");_play._factory.ui.tooltip.id=i;_play._factory.ui.tooltip.el=jQuery("#"+_play._factory.ui.tooltip.id)}}},renderContainer:function(div,index,ar,adjustContainerSize,bgc,loaderSkin){_play.tools.log("PREPARING CONTAINER","FACTORY");var el=document.getElementById(div);if(el){if(adjustContainerSize==
0)_play.tools.log("DONT CHANGE CONTAINER DIMENSIONS","FACTORY");else if(el.style.width&&el.style.height)_play.tools.log("CONTAINER HAS INLINE STYLING, DONT MODIFY DIMENSIONS","FACTORY");else{var cs;var d={width:0,height:0};if(_play.system.capabilities.hasComputedStyle){cs=window.getComputedStyle(el,null);d.width=_play.tools.parseInt(cs.width);d.height=_play.tools.parseInt(cs.height)}if(_play.system.environment.isEmbedded){el.style.width="100%";el.style.height="100%";cs=window.getComputedStyle(el,
null);if(parseInt(cs.width)==0)el.style.width=jQuery(window).width()+"px";if(parseInt(cs.height)==0)el.style.height=jQuery(window).height()+"px"}else if(d.width>0&&d.height>0)if(d.height/d.width!=ar){_play.tools.log("CONTAINER HEIGHT DOES NOT MATCH DIMENSIONS","FACTORY");d.height=d.width*ar;el.style.height=d.height+"px"}else _play.tools.log("CONTAINER HAS EXPLICIT STYLING, DONT MODIFY DIMENSIONS","FACTORY");else{_play.tools.log("CONTAINER WIDTH/HEIGHT NOT SET!","FACTORY");if(d.height==0){d.height=
d.width*ar;el.style.height=d.height+"px"}else if(d.width==0){d.width=d.height/ar;el.style.width=d.width+"px"}else{el.style.width="100%";el.style.height="100%"}}}var c="background-color:#"+bgc+";height:100%;outline:none !important;position:relative;";var lh="";var ass="";switch(loaderSkin){case "material":lh="<svg class='nxp_material' xmlns='http://www.w3.org/2000/svg' width='48px' height='48px' viewBox='0 0 66 66'><circle class='nxp-material-path' fill='none' stroke-width='6' stroke-linecap='round' cx='33' cy='33' r='30'></circle></svg>";
ass=" style='width:48px;height:48px;'";break;case "metro":lh="<div class='progress-ring'><div class='progress-ring__wrap'><div class='progress-ring__circle'></div></div><div class='progress-ring__wrap'><div class='progress-ring__circle'></div></div><div class='progress-ring__wrap'><div class='progress-ring__circle'></div></div><div class='progress-ring__wrap'><div class='progress-ring__circle'></div></div><div class='progress-ring__wrap'><div class='progress-ring__circle'></div></div></div>";ass=
" style='width:48px;height:48px;'";break;case "doublebounce":lh="<div class='nxp-doublebounce1'></div><div class='nxp-doublebounce2'></div>";ass=" style='width:48px;height:48px;'";break;case "lines":lh="<div class='nxp_lines'><div class='nxp_rect1'></div><div class='nxp_rect2'></div><div class='nxp_rect3'></div><div class='nxp_rect4'></div><div class='nxp_rect5'></div></div>";ass=" style='width:50px;height:48px;'";break;default:lh="<div class='nxp_loadingcircle'></div><div class='nxp_loadingcircle1'></div>";
break}lh="<div class='cl_nxp_loadingholder'"+ass+">"+lh+"</div>";jQuery("#"+div).css({"backgroundColor":"#"+bgc}).html("<div style='"+c+"' class='cl_nxp_sector' tabindex='1' id='nxp_sector"+index+"'><div style='height:100%;overflow:hidden;' class='cl_nxp_area'></div><div class='cl_nxp_overlay'>"+lh+"</div><div class='cl_nxp_menu'  id='nxp_menu'></div></div></div>");if(jQuery("#"+div).height()<=_play.config.constants.MICROPLAYER_MAX_HEIGHT)jQuery("#"+div+" .cl_nxp_loadingholder").hide()}},renderError:function(div,
t,streamType){t=t||"json";if(streamType)t=_play._factory.tools.getMimeClientText(streamType,"error_"+t);else t=_play.tools.getClientText("error_"+t);_play._factory.removePlayer(div);var el=document.getElementById(div);if(el){el.style.position="relative";var x="<div style='position:absolute;width:100%;height:100%;text-align:center;background-color:#000000;color:#FFF;font-size:13px;overflow:hidden;'>";x+="<img src='"+_play.config.constants.ARCROOT+"static/structure/error_back.png' style='position:absolute;height:80%;margin:auto;left:-500px;right:-500px;top:-500px;bottom:-500px;' />";
x+="<img src='"+_play.config.constants.ARCROOT+"static/structure/error_front.png' style='position:absolute;margin:auto;left:0;right:0;top:0;bottom:0;height:auto;' />";if(document.getElementById(div).clientHeight>=180)x+="<div style='position:absolute;bottom:0;top:116px;width:88%;margin:auto;left:0;right:0;font-weight:bold;height:20px'>"+t+"</div>";x+="</div>";el.innerHTML=x;_play._factory.ui.tooltip.hide()}},preparePanorama:function(){if(typeof pannellum=="undefined"){_play.tools.log("DOWNLOADING PANELLUM",
"FACTORY");_play.tools.addStyle(null,"panorama");_play.tools.addScript("libs/pannellum.js")}}},stream:{constants:{LIVE_3Q_ROOT:"http://sdn-global-live-http-cache.3qsdn.com/",GLOBAL_STATIC_ROOT:"http://nx-d.akamaized.net/",GLOBAL_DYNAMIC_ROOT:"http://nx-p{account}.akamaized.net/"},addFilters:function(t){t=t||"";if(t!="")t=",filter="+t;return t},getInitialBitrate:function(isBig){var t=_play.system.connection.isSlow||_play.system.isMobile()?655:955;if(isBig&&!_play.system.connection.isSlow)t=1500;return t},
handleMediaStatic:function(vid,ps,dist,isAzureStructure,isBig,prov){var n=[0,0];var t=_play._factory.stream.getInitialBitrate(isBig);var fd=dist.split(",");fd.forEach(function(i){var p=i.split(":");if(_play.tools.parseInt(p[0])<=t)if(_play.tools.parseInt(p[0])>n[0])n=[_play.tools.parseInt(p[0]),p[1]]});if(prov!="azure"&&isAzureStructure==1){var k=ps.split("/");var h=k.pop();ps=k.join("/")+"/";n[1]=h+n[1]}return ps+n[1]+(prov=="azure"||isAzureStructure==1?"_"+n[0]:"")},getFreeCDNURL:function(vid,ps,
streamtype,root,protocol,filters,alldetails){if(!filters||filters==""||filters==0)filters=5E4;else filters=_play.tools.parseInt(filters.replace("nxp-bitrate-",""));var t="http://"+root+ps;var fd=alldetails.azureFileDistribution.split(",");switch(alldetails.cdnProvider){case "ak":t+=",";fd.forEach(function(i){var p=i.split(":");if(_play.tools.parseInt(p[0])<=filters)t+=p[1]+(alldetails.applyAzureStructure==1?"_"+_play.tools.parseInt(p[0]):"")+","});t+=".mp4.csmil/master.m3u8";if(streamtype=="scene")t+=
"?start="+Math.ceil(alldetails.validfrom_raw)+"&end="+Math.ceil(alldetails.validto_raw);break;case "ce":var k=t.split("/");var h=k.pop();t=k.join("/");t+="/asset.ism/manifest."+(protocol=="hls"?"m3u8":"mpd")+"?dcp_ver=aos4&videostream=";var a="";fd.forEach(function(i){var p=i.split(":");if(_play.tools.parseInt(p[0])<=filters){a=h+p[1]+(alldetails.applyAzureStructure==1?"_"+_play.tools.parseInt(p[0]):"")+".mp4:"+_play.tools.parseInt(p[0])*1E3;t+=a+","}});t=t.slice(0,-1)+"&audiostream="+a.split(":")[0];
if(streamtype=="scene")t+="&vbegin="+Math.ceil(alldetails.validfrom_raw)+"&vend="+Math.ceil(alldetails.validto_raw);break}return t},getStreamingRoot:function(details,streamtype,override){var u;if(override)details.cdnType=override;if(details.cdnType=="3q"&&streamtype=="live")u=_play._factory.stream.constants.LIVE_3Q_ROOT;else{u=_play._factory.stream.constants.GLOBAL_DYNAMIC_ROOT.replace("{account}",_play.tools.strPad(_play.tools.parseInt(details.azureAccount.replace("nexxplayplus","").replace("nexxplayfb",
""))));if(details.azureAccount.indexOf("fb")>-1)u=u.replace("nx-p","nx-f")}if(details["cdnShieldHTTP"+(_play.system.environment.isSSL?"S":"")]&&details["cdnShieldHTTP"+(_play.system.environment.isSSL?"S":"")]!="")u="http://"+details["cdnShieldHTTP"+(_play.system.environment.isSSL?"S":"")];return u},getMediaURL:function(id,otherID,hash,streamtype,details,filters,isDRM,playerIsBig,hasDASH,fileVersion,protData,forceCodec,forceProtocol){var p="dash";var u="";var use3Q=details.cdnType=="3q"||details.cdnProvider==
"3q";var ps=details.originalDomain;if(_play.tools.parseInt(details.applyFolderHierarchy)==1){var s=_play.tools.reverse(_play.tools.strPad(id.toString(),4));ps+="/"+s.substr(0,2)+"/"+s.substr(2,2)}ps+="/"+id+"/"+hash+"_";var codec=_play.system.capabilities.hasMP4?"mp4":"webm";var globalstatic="";if(details.cdnType=="azure"){globalstatic=details["cdnShieldProgHTTP"+(_play.system.environment.isSSL?"S":"")];if(globalstatic&&globalstatic!="")globalstatic="http://"+globalstatic;else{globalstatic=_play._factory.stream.constants.GLOBAL_DYNAMIC_ROOT.replace("{account}",
_play.tools.strPad(_play.tools.parseInt(details.azureAccount.replace("nexxplayplus","").replace("nexxplayfb","")))).replace("-p","-d");if(details.azureAccount.indexOf("fb")>-1)globalstatic=globalstatic.replace("nx-d","nx-df")}}switch(streamtype){case "audio":p="http";codec=forceCodec&&forceCodec!=""?forceCodec:_play.system.capabilities.hasOpus?"opus":"mp3";if(details.cdnType=="azure")u=globalstatic+details.azureStaticLocator+"/"+hash+"_";else u="http://"+details.cdnPathHTTP+ps;u+="192_audio."+codec;
break;case "live":if(hasDASH&&forceProtocol!="hls"){p="dash";if(details.cdnType=="azure")u=_play._factory.stream.getStreamingRoot(details,streamtype)+details.streamID+"/"+details.streamPath+".ism/Manifest(format=mpd-time-csf"+_play._factory.stream.addFilters(filters)+(isDRM?",encryption=cenc":"")+")";else if(use3Q)u=_play._factory.stream.getStreamingRoot(details,streamtype,"3q")+(details.streamID>3E3?details.isDVR==0?"live":"dvr":details.streamID)+"/_definst_/"+(details.isMBR?"smil:"+details.streamID+
"-mbr.smil":details.streamPath)+"/manifest.mpd";else u="http://"+details.cdnPathDASH}else{p="hls";if(details.cdnType=="azure")u=_play._factory.stream.getStreamingRoot(details,streamtype)+details.streamID+"/"+details.streamPath+".ism/Manifest(format=m3u8-aapl"+_play._factory.stream.addFilters(filters)+(isDRM?",encryption=cbcs-aapl":"")+")";else if(use3Q)u=_play._factory.stream.getStreamingRoot(details,streamtype,"3q")+(details.streamID>3E3?details.isDVR==0?"live":"dvr":details.streamID)+"/_definst_/"+
(details.isMBR?"smil:"+details.streamID+"-mbr.smil":details.streamPath)+"/playlist.m3u8";else u="http://"+details.cdnPathHLS}break;case "radio":u="http://"+details.cdnPathMP3;p="ice";break;case "variant":p="http";codec="mp4";if(details.cdnType=="azure")u=globalstatic+details.azureLocator+"/"+hash+"_";else u="http://"+details.cdnPathHTTP+ps;u+="2500_var.mp4";break;default:if(hasDASH&&forceProtocol==""){codec="mp4";if(details.cdnType=="azure"){u=_play._factory.stream.getStreamingRoot(details,streamtype);
u+=details.azureLocator+"/"+id+"_src.ism/Manifest(format=mpd-time-csf"+_play._factory.stream.addFilters(filters)+(isDRM?",encryption=cenc":"")+(streamtype=="scene"?",filter=nxp-scid-"+otherID:"")+")"}else u=_play._factory.stream.getFreeCDNURL(id,ps,streamtype,details.cdnPathDASH,"dash",filters,details)}else if((_play.system.capabilities.hasHLS||hasDASH&&forceProtocol=="hls")&&_play.system.capabilities.hasMP4&&forceProtocol!="http"){p="hls";if(details.cdnType=="azure"){u=_play._factory.stream.getStreamingRoot(details,
streamtype);u+=details.azureLocator+"/"+id+"_src.ism/Manifest(format=m3u8-aapl"+_play._factory.stream.addFilters(filters)+(isDRM?",encryption=cbcs-aapl":"")+(streamtype=="scene"?",filter=nxp-scid-"+otherID:"")+")"}else u=_play._factory.stream.getFreeCDNURL(id,ps,streamtype,details.cdnPathHLS,"hls",filters,details)}else{p="http";if(!_play.system.capabilities.hasMP4||forceCodec=="webm"){codec="webm";if(details.cdnType=="azure")u+=globalstatic+details.azureStaticLocator+"/"+hash+"_";else u="http://"+
details.cdnPathHTTP+ps;if(_play.tools.parseInt(details.encodedVP9)==1)if(_play.system.capabilities.hasVP9)codec="vp9";else if(_play.tools.parseInt(details.encodedWEBM)==0)codec="vp9";if(codec=="webm")u+="900_html5.webm";else u+="900_vp9.webm"}else if(details.cdnType=="azure"){var ss=_play._factory.stream.handleMediaStatic(id,"",details.azureFileDistribution,details.applyAzureStructure,playerIsBig,"azure");u+=globalstatic+details.azureLocator+"/"+id+"_src_"+ss+".mp4"}else u="http://"+details.cdnPathHTTP+
_play._factory.stream.handleMediaStatic(id,ps,details.azureFileDistribution,details.applyAzureStructure,playerIsBig)+".mp4"}}if(_play.system.environment.isSSL)if(details.cdnProvider!="ak"||p=="http")u=u.replace("http:","https:");if(p=="http")u+=(u.indexOf("?")>-1?"&":"?")+"fv="+fileVersion;else if(protData)u+=(u.indexOf("?")>-1?"&":"?")+protData["ref"]+"="+protData[p];_play.tools.log("COMPUTED STREAM LOCATION: "+u+" / "+p,"FACTORY");return[u,p,codec]},rewriteAdURL:function(u,provider,vid,title,channel,
adchannel,studio,w,h){u=u.trim();u=u.replace("{all.random}",_play.tools.getRandom(1E7,00));u=u.replace("{all.width}",_play.tools.parseInt(w.toString()));u=u.replace("{all.height}",_play.tools.parseInt(h.toString()));u=u.replace("{all.unique}",_play.session.cid);if(adchannel&&adchannel!="")u=u.replace("{all.adchannel}",encodeURIComponent(adchannel));else u=u.replace("{all.adchannel}",encodeURIComponent(channel));u=u.replace(/\{page\.host\}/ig,encodeURIComponent(_play.tools.getURL()));u=u.replace("{video.id}",
vid);u=u.replace("{video.title}",encodeURIComponent(title));u=u.replace("{video.channel}",encodeURIComponent(channel));u=u.replace("{video.studio}",encodeURIComponent(studio));u=u.replace("{domain.adchannel}",encodeURIComponent(adchannel));u=u.replace("{session.playlicense}",encodeURIComponent(_play.session.playLicenseAdref));u=u.replace("{user.loggedin}",_play.tools.parseInt(_play.config.user.id)>0?"user":"non_user");if(_play.system.environment.isApp)u=u.replace("{app.adidentifier}",_app.adIdentifier);
else u=u.replace("{app.adidentifier}","");if(_play.system.environment.isSSL)u=u.replace("http:","https:");_play.tools.log("COMPUTED VAST URL: "+u,"FACTORY");return u}},tools:{checkDomain:function(allowExternalPlay,domain){var t=true;domain=domain||_play.tools.getURL();if(_play.tools.parseInt(allowExternalPlay)==0){t=false;if(document.location.href.indexOf(domain)==-1||document.location.href.indexOf("nexx.cloud")==-1)t=true;else if(_play.system.isTV()||_play.system.environment.isCasted||_play.system.environment.isApp)t=
true;else if(_play.system.environment.isEmbedded)try{if(document.referrer.indexOf(domain)>-1)t=true}catch(e){}}return t},getStreamtype:function(m){var t="video";switch(m){case "audio":case "radio":case "collection":case "live":case "image":case "scene":case "variant":t=m;break;case "audioalbum":case "audiolist":t="audio";break;case "panorama":t="image";break}return t},getMimetype:function(m){var t="video";switch(m){case "audio":case "radio":case "audioalbum":case "audiolist":t="audio";break;case "panorama":t=
"image";break}return t},translateVideoQuality:function(h,b){var t=a="";if(b>2E4)b=b/1E3;if(h>1440){t="2304p";a="4K"}else if(h>1080){t="1440p";a="2K"}else if(h==1080){t="1080p";a="HD";if(b>=5E3)a="Full HD"}else t=h+"p";return[t,a]},formatTime:function(d,sh,showMilli){var t="";var s=Math.round(d);var m=0;if(s>0){while(s>59){m++;s-=60}t=_play.tools.strPad(m,2)+":"+_play.tools.strPad(s,2);if(sh){var p=t.split(":");if(_play.tools.parseInt(p[0])>=60){var h=Math.floor(_play.tools.parseInt(p[0])/60);var n=
p[0]-h*60;t=_play.tools.strPad(h,2)+":"+_play.tools.strPad(n,2)+":"+_play.tools.strPad(p[1],2)}else t="00:"+t}}else t="00:00";if(showMilli){var ms=d.toString().split(".")[1];if(ms)t+="."+ms}return t},formatSeconds:function(h){var t=0;h=h.toString().split(":");if(h.length==3)t=_play.tools.parseInt(h[2])+60*_play.tools.parseInt(h[1])+3600*_play.tools.parseInt(h[0]);return t},formatDate:function(u){var s="";if(u>0){var d=new Date(u*1E3);switch(_play.session.language){case "de":s=_play.tools.strPad(d.getDate())+
"."+_play.tools.strPad(d.getMonth()+1)+"."+d.getFullYear();break;default:s=_play.tools.strPad(d.getMonth()+1)+"/"+_play.tools.strPad(d.getDate())+"/"+d.getFullYear();break}}return s},getMimeClientText:function(plm,s){var u=null;var t=["Dieses Video","Dieses","dieses","n\u00e4chstes","vorheriges","kein g\u00fcltiges","Das Video","des Videos","Video","video"];switch(plm){case "audio":case "audiolist":u=["Dieser Song","Dieser","diesen","n\u00e4chster","vorheriger","kein g\u00fcltiger","Der Song","des Songs",
"Song","song"];break;case "live":case "radio":u=["Dieser LiveStream","Dieser","diesen","n\u00e4chster","vorheriger","kein g\u00fcltiger","Der LiveStream","des LiveStreams","LiveStream","livestream"];break;case "scene":u=["Diese Szene","Diese","diese","n\u00e4chste","vorherige","keine g\u00fcltige","Die Szene","der Szene","Szene","scene"];break}s=_play.tools.getClientText(s);if(u!=null)for(var v=0;v<t.length;v++)s=s.replace(t[v],u[v]);return s}},control:{resizer:null,players:{},playerqueue:[],canAddNextPlayer:true,
init:function(){if(_play.system.capabilities.hasResizeObserver)_play._factory.control.resizer=new ResizeObserver(function(els){els.forEach(function(e){_play._factory.control.sendCommand(e.target.id,e.contentRect.width,"","resize")})})},processNotification:function(event,data,streamtype,index,div,mediaID,dataMode,fromRemote,mediaIndex){data=data||{};var doEmit=true;var obj={event:event,data:data,mediaID:mediaID,mediaIndex:mediaIndex||0,streamtype:streamtype,playerIndex:index,playerContainer:div,remoteDevice:fromRemote?
"chromecast":""};switch(event){case _play.config.events.METADATA:if(_play._factory.control.players[div])_play._factory.control.players[div].isReady=true;break;case _play.config.events.PLAYER_READY:if(!fromRemote){_play._factory.control.checkQueuedPlayer();if(_play.system.capabilities.hasResizeObserver)_play._factory.control.resizer.observe(document.getElementById(div));if(_play.system.capabilities.hasCast&&_play.system.device.platform!="chromecast"&&!_play.addons.cast.inited)_play.addons.cast.sender.init()}break;
case _play.config.events.START_PLAY:_play.system.device.history.update(mediaID,streamtype,0,true);if(_play.system.environment.isCasted)_play.addons.cast.receiver.checkMetadata();if(_play.session.usesReco)_play.addons.reco[_play.addons.reco.provider].onAction(mediaID,streamtype);break;case _play.config.events.QUARTER:_play.system.device.history.update(mediaID,streamtype,_play.control.getCurrentTime(div));if(_play.system.environment.isCasted)_play.addons.cast.receiver.checkMetadata();break;case _play.config.events.AD_ERROR:if(_play.session.isSVM&&
!_play.system.environment.isCasted&&!_play.system.isTV()&&!_play.system.isMobile()&&!_play.system.environment.isApp&&!_play.system.environment.isWebView&&["break","banner"].indexOf(data.adType)==-1)_play.addons.svm.onAdError(div,data.adURL,data.adType);break;case _play.config.events.ERROR:_play._factory.control.checkQueuedPlayer();if(_play.system.environment.isApp&&_app["native"].media.systemMedia.isAvailable)_app["native"].media.systemMedia.updatePlayState(_play.config.events.ERROR);break;case _play.config.events.PLAY:case _play.config.events.PAUSE:if(data.byUserAction==
1&&_play.system.environment.isApp&&_app["native"].media.systemMedia.isAvailable)_app["native"].media.systemMedia.updatePlayState(event);break;case _play.config.events.ENDED:_play.system.device.history.update(mediaID,streamtype,_play.control.getCurrentTime(div));break}if(_play.system.environment.isCasted)doEmit=false;if(doEmit){if(_play.system.environment.isEmbedded&&_play.system.capabilities.hasPostMessage)try{parent.postMessage(obj,"*")}catch(e){}var o=streamtype!="capture"?"playstate":"capture";
if(_play.config.listeners[o]&&_play.config.listeners[o].length)_play.config.listeners[o].forEach(function(i){i.call(null,obj)});if(_play._factory.control.players[div]&&_play._factory.control.players[div].listeners&&_play._factory.control.players[div].listeners.length)_play._factory.control.players[div].listeners.forEach(function(i){i.call(null,obj)})}},mediaReady:function(dataMode){if(_play.session.monitor.displayTime==0){_play.session.monitor.displayTime=_play.session.getTime(true);var it=(_play.session.monitor.startTime-
_play.session.monitor.initTime)/1E3;var pt=(_play.session.monitor.displayTime-_play.session.monitor.startTime)/1E3;_play.session.monitor.performanceSent=true;_samaritan.emitSessionEvent(_samaritan.events.PLAYERPERFORMANCE,{technology:"arc",dataMode:dataMode,playerTime:Math.min(5,pt),initTime:Math.max(.01,it),totalTime:Math.min(5,it+pt)});_play.tools.log("MEDIA READY IN "+pt,"FACTORY")}},checkQueuedPlayer:function(){_play.tools.log("CHECKING FOR QUEUED PLAYER","FACTORY");if(_play._factory.control.playerqueue.length>
0){var obj=_play._factory.control.playerqueue.shift();if(obj&&_play._factory.control.players[obj]){_play._factory.control.canAddNextPlayer=true;_play._factory.addPlayer(obj)}else _play._factory.control.canAddNexPlayer=true}else _play._factory.control.canAddNextPlayer=true},detachObservers:function(div){if(_play.system.capabilities.hasResizeObserver){_play.tools.log("DETACHING RESIZE OBSERVER ON "+div,"FACTORY");_play._factory.control.resizer.unobserve(document.getElementById(div))}if(_play._factory.control.players[div]&&
_play._factory.control.players[div].observer){_play.tools.log("DETACHING INTERSECTION OBSERVER ON "+div,"FACTORY");try{_play._factory.control.players[div].observer.disconnect()}catch(e){}_play._factory.control.players[div].observer=null}},getFromPlayer:function(div,cmd,param){var toreturn=null;div=div||Object.keys(_play._factory.control.players)[0];if(Object.keys(_play._factory.control.players).indexOf(div)>-1)if(_play._factory.control.players[div].isReady)toreturn=jQuery("#nxp_sector"+_play._factory.control.players[div].index).data("halcyon")[cmd](param);
return toreturn},sendCommand:function(div,cmd,param,func){func=func||"interact";if(cmd)cmd=cmd.toString().toLowerCase();if(!param&&jQuery.isNumeric(div)){param=div;div=null}div=div||Object.keys(_play._factory.control.players)[0];if(Object.keys(_play._factory.control.players).indexOf(div)>-1)if(_play._factory.control.players[div].isReady)if(func!="swapComplex")jQuery("#nxp_sector"+_play._factory.control.players[div].index).data("halcyon")[func](cmd,param);else jQuery("#nxp_sector"+_play._factory.control.players[div].index).data("halcyon")[func](param,
arguments[4],arguments[5],arguments[6])},sendEvent:function(e){Object.keys(_play._factory.control.players).forEach(function(i){_play._factory.control.sendCommand(i,"","",e)})},sendPluginCommand:function(div,plugin,cmd,param){div=div||Object.keys(_play._factory.control.players)[0];if(Object.keys(_play._factory.control.players).indexOf(div)>-1)jQuery("#nxp_sector"+_play._factory.control.players[div].index).data(plugin)[cmd](param)}},addPlayer:function(div){if(!_play._factory.control.canAddNextPlayer)_play._factory.control.playerqueue.push(div);
else{var c=_play._factory.control.players[div];_play._factory.control.canAddNextPlayer=false;_play._factory.ui.renderContainer(div,c.index,c.config.aspectRatio,c.config.useMiniPlayer==0?c.config.adjustContainerDimensions:0,c.config.backgroundColor,c.config.loaderSkin);_play._factory.control.processNotification(_play.config.events.PLAYER_ADDED,null,_play._factory.tools.getStreamtype(c.playmode),c.index,div,c.param,c.config.dataMode);_play._factory.data.initClient(div,c.config.dataMode).then(function(){jQuery("#nxp_sector"+
c.index).halcyon({param:c.param,playmode:c.playmode,index:c.index,config:c.config})})["catch"](function(e){if(_play.session.isDebug)console.log(e);_play.session.onError("Client Init Error","factory.js",0,"",e)})}return new _play.PlayerInstance(div)},removePlayer:function(div){div=div||Object.keys(_play._factory.control.players)[0];if(Object.keys(_play._factory.control.players).indexOf(div)>-1)if(_play._factory.control.players[div].type=="player"){var p=_play.control.getMediaData(div);if(p&&p.currentDuration&&
p.currentDuration>1){_samaritan.emitEvent(_samaritan.events.TIME,p.mediaID,p.streamtype,p.channel_id,p.licenseBy,{duration:p.currentDuration,position:p.currentTime,isMinute:0},p.mediasession,false,_play._factory.config.get(div,"index",true));_play.system.device.history.update(p.mediaID,p.streamtype,p.currentTime)}_play._factory.control.detachObservers(div);_play._factory.control.sendCommand(div,"","","remove");delete _play._factory.control.players[div];document.getElementById(div).innerHTML=""}else _play.control.removeCaptureHandler(div)}};
_play._factory.registerPlugin=function(){_play.tools.log("REGISTERING HALCYON PLUGIN","ARC");jQuery.halcyon=function(element,options){var tgk=this;var _tcp={_div:"",_el:null,_width:0,_height:0,_isCasting:false,_visibilityRatio:1,_config:null,_admodel:null,_area:null,_overlay:null,_loader:null,_menu:null,_index:"",_ttid:"",_online:true,_masked:false,_playmode:"",_playparam:"",_notifiedOtherPlayer:false,_shakaInstalled:false,_playPauseByUser:false,_pausedByIntersection:false,_pauseOnPageVisibility:false,
_totalTimeMode:"fixed",_isCollection:false,_isDead:false,_xmode:"",_playlist:null,_useMiniPlayer:false,_useMicroPlayer:false,_useAutoMediaLoad:true,_originalplaylist:null,_playpos:0,_autoplay:0,_autofullscreen:0,_isRebuild:false,_initiallyMuted:false,_autonext:0,_exitmode:"",_ended:false,_usePPM:false,_useSpots:false,_useVolume:false,_useAds:false,_useAdFallback:false,_usePreview:false,_previewDuration:0,_useMidRolls:false,_useBanners:false,_useFullPlayer:true,_useWatermark:false,_useVideoAudio:false,
_willUseSHAKA:false,_shakaProtocol:"dash",_fixedMenu:false,_hiddenMenu:false,_startMode:false,_menuActive:true,_captionMode:"",_menuMode:-1,_titleMode:-1,_intersectionMode:-1,_firstRun:true,_useRevolver:false,_isPseudoLive:false,_protocol:"",_codec:"",_forceCodec:"",_forceProtocol:"",_tokenUpdateNeeded:false,_pendingPause:false,_pauseCanBeResumed:false,_mediasession:"",_mime:"video",_streamtype:"video",_template:"default",_fullscreenreportmode:"manual",_usesForcedTemplate:false,_lastVolume:1,_desiredQuality:-1,
_desiredSpeed:1,_desiredCaptionLanguage:"",_currentCaptionLanguage:"",_cmurl:"",_adIsBumper:false,_playingAd:false,_playingAdPaused:false,_previewPaused:false,_orderMode:"straight",_playIndex:-1,_playedVia:"start",_live:false,_waitForLive:false,_dvr:false,_muted:false,_hasCaptions:false,_captionIndex:0,_dashobj:null,_dashurl:"",_videoMetaLoaded:false,_allowWatermark:true,_isBumper:false,_isPanorama:false,_bumperPaused:false,_hasAirPlay:false,_isHeadset:false,_isPlayingExternal:false,_fullscreenByRotate:false,
_userHasPay:0,_payReason:"",_hasMBR:false,_isIOSPause:false,_data:{currenturl:[],initConfig:function(){if(!_tcp._config.reportParent)_tcp._config.reportParent=_tcp._config.reportParentProtocol="";_tcp._masked=_tcp._config.hidePrevNext==1;_tcp._xmode=_tcp._config.xMode?_tcp._config.xMode:"";_tcp._playedVia=_tcp._config.startContext||"";_tcp._useMiniPlayer=_tcp._config.useMiniPlayer==1;if(_tcp._useMiniPlayer&&_tcp._height<=_play.config.constants.MICROPLAYER_MAX_HEIGHT){_tcp._useMicroPlayer=true;_tcp._useAutoMediaLoad=
false;_tcp._ui.hideLoader()}var decided=false;var mustBeMuted=false;var tryIfMuted=_play.tools.parseInt(_play.config.client.autoplayMobile)==1;if(_tcp._config.autoPlayIfMutedPossible!=-1)tryIfMuted=_tcp._config.autoPlayIfMutedPossible==1;var autoMute=_play.config.client.autoplayMute;if(_tcp._config.autoPlayMutedAlways!=-1)autoMute=_tcp._config.autoPlayMutedAlways;if(_play.system.environment.isCasted||_play.system.isTV())autoMute=0;if(autoMute==1){_tcp._autoplay=1;decided=true;mustBeMuted=true}else{if(_play.system.environment.isCasted||
_play.system.isTV()){_tcp._autoplay=1;decided=true}else if(_play.system.environment.isApp&&_app.config.useAppPlayer){_tcp._autoplay=0;decided=true}else if(["mobile","tablet","fbia","amp"].indexOf(_play.system.device.platform)>-1){_tcp._autoplay=0;decided=true;if(_tcp._mime=="video")if(_play.tools.parseInt(_play.system.cache.get("nxp_deniedmobileauto2"))!=1)if(_play.system.isAndroid()&&["mobile","tablet"].indexOf(_play.system.device.platform)>-1&&_play.system.isFirefox()){if(_play.tools.parseInt(_play.config.client.autoplayMobile)==
1)decided=false}else{if(_play.system.capabilities.hasMutedAutoPlay)if(tryIfMuted==1){decided=false;mustBeMuted=true}}else{decided=true;_tcp._autoplay=0;_play.tools.log("FOUND HISTORY DATA - MOBILE AUTOPLAY IS NOT POSSIBLE","HALCYON")}if(_tcp._config.webViewRestrictionsDisabled){decided=true;mustBeMuted=false;_tcp._autoplay=1}}else if(_play.system.capabilities.hasMutedAutoPlay)if(_play.tools.parseInt(_play.system.cache.get("nxp_deniedmobileauto2"))!=1)if(tryIfMuted==1){decided=false;mustBeMuted=true}if(_tcp._config.allowOnlyOnePlayerPlaying==
1&&_play._factory.control.players.length>1){decided=true;_tcp._autoplay=0}}if(_play.system.isMobile()){_tcp._autofullscreen=_play.config.client.allowautofullscreen;if(_tcp._config.mobileAutoFullscreen!=-1)_tcp._autofullscreen=_tcp._config.mobileAutoFullscreen}if(_tcp._mime=="image")_tcp._autoplay=1;if(_play.system.environment.isApp&&!_app.config.useAppPlayer&&!_play.system.isTV()){decided=false;mustBeMuted=false}if(!decided){_tcp._autoplay=_play.tools.parseInt(_play.config.client.autoplay);if(_tcp._config.autoPlay!=
-1)_tcp._autoplay=_tcp._config.autoPlay}if(_play.system.isTV())if(_play.tools.parseInt(_play.config.client.allowseekbuttons)<30)_play.config.client.allowseekbuttons=30;if(mustBeMuted&&_tcp._autoplay==0)mustBeMuted=false;_tcp._initiallyMuted=mustBeMuted;_play.tools.log("AUTOPLAY: "+_tcp._autoplay+(mustBeMuted?" (STARTING MUTED)":"")+(_tcp._autofullscreen==1?" (AUTO FULLSCREEN)":""),"HALCYON");if(_tcp._config.reportParent=="")_tcp._data.checkParent();_tcp._exitmode=_play.config.client.exitPlayMode;
_tcp._captionMode=_play.config.client.allowcaptions;_tcp._titleMode=_play.config.client.allowtitle;_tcp._menuMode=_play.tools.parseInt(_play.config.client.allowmenu);_tcp._intersectionMode=_play.tools.parseInt(_play.config.client.pauseOnIntersect);_tcp._pauseOnPageVisibility=_play.tools.parseInt(_play.config.client.allowvisibility);if(_tcp._config.exitMode!="")_tcp._exitmode=_tcp._config.exitMode;if(_tcp._config.captionMode!="")_tcp._captionMode=_tcp._config.captionMode;if(_tcp._config.menuMode!=
-1)_tcp._menuMode=_tcp._config.menuMode;if(_tcp._config.titleMode>-1)_tcp._titleMode=_tcp._config.titleMode;if(_play.system.environment.isCasted||_play.system.isTV())_tcp._titleMode=2;if(_tcp._config.scrollingMode>-1)_tcp._intersectionMode=_tcp._config.scrollingMode;_tcp._autonext=_play.config.client.autoPlayNext;if(_tcp._config.autoNext!=-1)_tcp._autonext=_tcp._config.autoNext;if(_play.tools.parseInt(_play.config.client.ads_enableOverlay)==0)_tcp._el.addClass("nxp_noadoverlay");if(_play.tools.parseInt(_play.config.client.allowmobileoverlays)==
0)_tcp._el.addClass("nxp_nomobileoverlay");if(_play.tools.parseInt(_play.config.client.allowProgPlay)==0)_tcp._useVideoAudio=true;else if(_play.tools.parseInt(_play.config.client.preferVideoAudio)==1)_tcp._useVideoAudio=true;_tcp._useVideoAudio=false;if(_tcp._exitmode!="replay"&&_tcp._exitmode!="playlist"&&_tcp._exitmode!="loop")if(_play.system.environment.isEmbedded)_tcp._exitmode="load";else if(_play.system.isTV())_tcp._exitmode="load";if(_tcp._playmode!="video"){_tcp._autonext=0;if(_tcp._exitmode!=
"loop")_tcp._exitmode="replay"}if(_play.system.environment.isCasted)if(_tcp._exitmode=="navigate")_tcp._exitmode="load";_play.tools.log("CHOSEN EXITMODE: "+_tcp._exitmode,"HALCYON");_play.tools.log("CHOSEN AUTONEXT: "+_tcp._autonext,"HALCYON");_tcp._ui.addLayout();if(_play.tools.parseInt(_play.config.client.allowShadowsAndGlow)==1)_tcp._el.addClass("nxp_glow");if(mustBeMuted)_tcp._muted=true;_tcp._useVolume=_play.tools.parseInt(_play.config.client.allowvolume)==1&&!_play.system.isMobile();if(_tcp._useVolume){_tcp._el.addClass("nxp_addedvolume");
if(_play.system.capabilities.hasStorage){var v=_play.system.storage.get("nxp_lastvolume");if(v&&_play.tools.parseInt(v)>0&&_play.tools.parseInt(v)<=1)_tcp._lastVolume=_play.tools.parseInt(v)}}else _tcp._el.addClass("nxp_novolume");_tcp._allowWatermark=_play.config.client.allowwatermark;if(_tcp._config.watermarkMode!=-1)_tcp._allowWatermark=_tcp._config.watermarkMode;if(_tcp._allowWatermark==2)_tcp._allowWatermark=_play._factory.tools.checkDomain(0);else _tcp._allowWatermark=_tcp._allowWatermark==
1;if(_tcp._config.pauseOnPageVisibility>-1)_tcp._pauseOnPageVisibility=_play.tools.parseInt(_tcp._config.pauseOnPageVisibility);if(_play.system.environment.isApp||_play.system.isMobile()||_play.system.isTV()||_play.system.environment.isWebView)_tcp._pauseOnPageVisibility=2;if(_tcp._config.enableLightsOut==-1)_tcp._config.enableLightsOut=_play.tools.parseInt(_play.config.client.uselightsout);if(_tcp._config.enableLightsOutAutomaticAfter>0){_play.tools.log("ENABLING AUTOMATIC LIGHTSOUT","HALCYON");
_tcp._stream.events.waitForLightsOut=true}if(_play.system.environment.isApp||_play.system.isMobile()||_play.system.isTV()){_play.tools.log("DISABLE LIGHTSOUT ON APP/MOBILE","HALCYON");_tcp._config.enableLightsOut=0;_tcp._stream.events.waitForLightsOut=false}if(_play.config.client.useLiveTransmux==1)_tcp._shakaProtocol="hls";_tcp._useAds=false;_tcp._useMidRolls=false;_tcp._data.updateAdModel();if(_tcp._admodel&&_tcp._admodel.provider!=""&&_tcp._config.disableAds!=1&&_play.tools.parseInt(_play.config.client.adsEnabled)==
1&&!_tcp._useMiniPlayer&&!_play.system.environment.isOMNIA){_play.tools.log("ENABLING ADS","HALCYON");_tcp._useAds=true;_tcp._useVideoAudio=true;_tcp._flow.ad.allowPre=_tcp._config.disablePrerolls==0;_tcp._flow.ad.allowMid=_tcp._config.disableMidrolls==0;_tcp._flow.ad.allowPost=_tcp._config.disablePostrolls==0;_tcp._flow.ad.allowBanner=_tcp._config.disableBanners==0;_tcp._flow.ad.allowBreakAds=_tcp._config.disableBreakAds==0;if(!_tcp._admodel.type)_tcp._admodel.type="vast";if(_tcp._admodel.type==
"ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.prepare()}if(_play.system.capabilities.hasIntersectionOberserver&&!_play.system.environment.isEmbedded&&_play.system.capabilities.hasInlineVideo&&(!_play.system.environment.isApp||!_app.config.useAppPlayer)){_play.tools.log("ATTACHING OBSERVER","HALCYON");var ob=new IntersectionObserver(function(entries,obs){jQuery.each(entries,function(i,j){if(!_play.system.environment.isFullscreen&&_tcp._mime=="video"&&!_play.system.environment.isPIP&&!_tcp._isCasting){_play.tools.log("INTERSECTION CHANGE TO "+
j.intersectionRatio,"HALCYON");_tcp._data.emitNotification(_play.config.events.INTERSECTION,{percentageVisible:j.intersectionRatio});if(_tcp._intersectionMode>0){_tcp._visibilityRatio=j.intersectionRatio;if(_tcp._stream.m)_tcp._ui.onIntersection();else if(_tcp._visibilityRatio<.5)_tcp._autoplay=0}}})},{threshold:[0,.1,.25,.5,.75,.9,1]});ob.observe(document.getElementById(_tcp._div));_play._factory.control.players[_tcp._div].observer=ob}},updateAdModel:function(){_play.tools.log("UPDATING AD MODEL",
"HALCYON");if(!_play.config.client.admodel.hasOwnProperty("provider")){_tcp._admodel={provider:"",vast_minimal_distance:30};var key="video";if(_tcp._live&&!_tcp._isPseudoLive)key="live";else if(_tcp._mime=="audio")key="audio";if(_play.config.client.admodel.hasOwnProperty(key)){_play.tools.log("USING AD MODEL FOR "+key,"HALCYON");if(_play.config.client.admodel[key].provider&&_play.config.client.admodel[key].provider!="")_tcp._admodel=_play.config.client.admodel["audio"];else if(_play.config.client.admodel.hasOwnProperty("all"))if(_play.config.client.admodel.all.provider&&
_play.config.client.admodel.all.provider!="")_tcp._admodel=_play.config.client.admodel["all"]}else if(_play.config.client.admodel.hasOwnProperty("all")){_play.tools.log("USING DEFAULT AD MODEL","HALCYON");if(_play.config.client.admodel.all.provider&&_play.config.client.admodel.all.provider!="")_tcp._admodel=_play.config.client.admodel["all"]}}else{_tcp._admodel=_play.config.client.admodel;if(!_tcp._admodel.provider)_tcp._admodel={provider:"",vast_minimal_distance:30}}if(_tcp._config.adProvider!="")_tcp._admodel.provider=
_tcp._config.adProvider;if(_tcp._admodel.provider&&_tcp._admodel.provider!=""){if(_tcp._config.adType!="")_tcp._admodel.type=_tcp._config.adType;if(_tcp._config.adPrerollURL!="")_tcp._admodel.vast_pre=_tcp._config.adPrerollURL;if(_tcp._config.adBumperURL!="")_tcp._admodel.vast_bumper=_tcp._config.adBumperURL;if(_tcp._config.adMidrollURL!="")_tcp._admodel.vast_mid=_tcp._config.adMidrollURL;if(_tcp._config.adPostrollURL!="")_tcp._admodel.vast_post=_tcp._config.adPostrollURL;if(_tcp._config.adBannerURL!=
"")_tcp._admodel.vast_banner=_tcp._config.adBannerURL;if(_tcp._config.adBreakURL!="")_tcp._admodel.vast_break=_tcp._config.adBreakURL;if(_tcp._config.adMidrollInterval!=-1)_tcp._admodel.vast_mid_interval=_tcp._config.adMidrollInterval;if(_tcp._config.adBannerInterval!=-1)_tcp._admodel.vast_banner_interval=_tcp._config.adBannerInterval;if(_tcp._config.adMinimalDistance!=-1)_tcp._admodel.vast_minimal_distance=_tcp._config.adMinimalDistance;if(_tcp._config.adBumperThreshold!=-1)_tcp._admodel.vast_bumper_threshold=
_tcp._config.adBumperThreshold}},getStoredString:function(){return"_nxp"+_tcp._playmode+"_"+_tcp._playparam},getCurrentURL:function(){return _tcp._data.currenturl+"::"+_tcp._protocol+"::"+_tcp._codec},getMedia:function(a,c){c=c||"general";var t="";if(_tcp._playlist&&_tcp._playlist[_tcp._playpos]&&_tcp._playlist[_tcp._playpos][c])if(!_tcp._playlist[_tcp._playpos][c].hasOwnProperty(a)){_play.tools.log("ASKING FOR UNKNOWN MEDIA ATTRIB "+c+"/"+a,"HALCYON");t=""}else t=_tcp._playlist[_tcp._playpos][c][a];
else _play.tools.log("ASKING FOR UNKNOWN MEDIA ATTRIB "+c+"/"+a,"HALCYON");return t},getMediaReal:function(a,c){c=c||"general";var t;if(!_tcp._isBumper)t=_tcp._data.getMedia(a,c);else{var m=_tcp._playlist[_tcp._playpos==0?1:_tcp._playpos-1];if(m&&m[c])if(!m[c].hasOwnProperty(a)){_play.tools.log("ASKING FOR UNKNOWN REAL MEDIA ATTRIB "+c+"/"+a,"HALCYON");t=""}else t=m[c][a];else _play.tools.log("ASKING FOR UNKNOWN REAL MEDIA ATTRIB "+c+"/"+a,"HALCYON")}return t},getMediaObject:function(a){var t=null;
if(_tcp._playlist&&_tcp._playlist[_tcp._playpos]&&_tcp._playlist[_tcp._playpos].hasOwnProperty(a))t=_tcp._playlist[_tcp._playpos][a];else;return t},getProtection:function(a,getDRMDetails){var t="";var d=_tcp._data.getMediaObject("protectiondata");if(d)t=d[a];if(t=="drm"&&getDRMDetails)if(_play.system.isIOS()||_play.system.isSafari())t="fairplay";else if(_tcp._willUseSHAKA&&_tcp._dashobj){var x=_tcp._dashobj.drmInfo();if(x.keySystem.indexOf("widevine")>-1)t="widevine";else t="playready"}return t},
getMediaData:function(){var t=null;if(_tcp._playlist&&_tcp._playlist[_tcp._playpos]){t={mediaID:_tcp._data.getMediaReal("ID"),mediaDomain:_tcp._data.getMediaReal("originalDomain","streamdata"),hash:_tcp._data.getMediaReal("hash"),title:_tcp._data.getMediaReal("title"),subtitle:_tcp._data.getMediaReal("subtitle"),orderhint:_tcp._data.getMediaReal("orderhint"),created:_tcp._data.getMediaReal("created"),uploaded:_tcp._data.getMediaReal("uploaded"),runtime:-1,actors:_tcp._data.getMediaReal("actors"),
channel:_tcp._data.getMediaReal("title","channeldata"),channel_id:_tcp._data.getMediaReal("ID","channeldata"),channel_adref:_tcp._data.getMediaReal("adref","channeldata"),studio:_tcp._data.getMediaReal("studio","general"),studio_adref:_tcp._data.getMediaReal("studio_adref","general"),licenseBy:_tcp._data.getMediaReal("licenseby"),thumb:_tcp._data.getMediaReal("thumb","imagedata"),mediaSession:_tcp._mediasession,mediaSessionParent:_tcp._config.reportParentProtocol,currentDuration:_tcp._stream.events.elapsedMinutes*
60+_tcp._stream.events.elapsedSeconds,currentTime:_tcp._stream.getCurrentTime(false,true),streamtype:_tcp._streamtype,isAutoPlay:_play.tools.parseInt(_tcp._autoplay)==1?1:0};if(_tcp._streamtype!="live")t.runtime=_tcp._data.getMediaReal("runtime")}return t},checkParent:function(){if(_tcp._config.reportParent=="")if(["audioalbum","collection","playlist"].indexOf(_tcp._playmode)>-1)_tcp._config.reportParent=_tcp._playmode+"-"+_tcp._playparam},isMultiLanguage:function(){return _tcp._data.getMediaReal("language").indexOf(",")>
-1},isTokenized:function(){var t=false;var tok=_tcp._data.getProtection("method",false);if(tok&&tok!=""&&tok=="token")t=true;return t},isDRM:function(){var t=false;var tok=_tcp._data.getProtection("method",false);if(tok&&tok!=""&&tok=="drm")t=true;return t},isAES:function(){var t=false;var tok=_tcp._data.getProtection("method",false);if(tok&&tok!=""&&tok=="aes")t=true;return t},isEpisode:function(){var t=false;var d=_tcp._playlist[_tcp._playpos];if(d&&d.hasOwnProperty("episodedata"))t=true;return t},
canUseHTTP:function(){var t=true;if((_play.tools.parseInt(_play.config.client.allowProgPlay)==0||_tcp._playmode=="scene"||_tcp._data.isTokenized()||_tcp._data.isDRM()||_tcp._data.isAES())&&["variant"].indexOf(_tcp._playmode)==-1)t=false;return t},emitEvent:function(type,o,id,streamtype,channel,license,skipParent){o=o||{};id=id||_play.tools.parseInt(_tcp._data.getMedia("ID"));streamtype=streamtype||_tcp._streamtype;channel=channel||_play.tools.parseInt(_tcp._data.getMedia("ID","channeldata"));license=
license||_play.tools.parseInt(_tcp._data.getMedia("licenseby"));if(type.indexOf("p_ad")==0)if(o.hasOwnProperty("type"))if(["pre","mid","post"].indexOf(o.type)>-1)o.type+="roll";else o.type=o.type.replace("roll","");var clid=_play.config.client.id;var pp=_tcp._config.reportParentProtocol;var pc=_tcp._config.reportParent.split("-");if(skipParent||pc.length<2){pp="";pc=["",0]}if(_play.tools.parseInt(_play.config.client.useOriginalForReport)==1)clid=_tcp._data.getMedia("originalDomain","streamdata");
_samaritan.emitEvent(type,id,streamtype,channel,license,o,_tcp._mediasession,false,_tcp._index,null,_play.tools.parseInt(_tcp._autoplay)==1?1:0,pc,pp,_tcp._stream.getCurrentTime(false,true),_tcp._width,_tcp._height,clid)},emitNotification:function(type,data,param){if(type.substr(0,2)=="ad"){var url=_tcp._flow.ad.currentURL;if(!url||url==""){var c=_tcp._flow.ad.mode;if(_tcp._adIsBumper)c="bumper";url=_play._factory.stream.rewriteAdURL(_tcp._admodel["vast_"+c],_tcp._admodel.provider,_tcp._data.getMedia("ID"),
_tcp._data.getMedia("title"),_tcp._data.getMedia("adref","channeldata"),_tcp._data.getMedia("originalAdChannel","streamdata"),_tcp._data.getMedia("studio_adref"),_tcp._width,_tcp._height)}data={adURL:url,adType:_tcp._flow.ad.mode+(["banner","break"].indexOf(_tcp._flow.ad.mode)==-1?"roll":""),adMode:param?param:_tcp._flow.ad.mode=="break"?"vast":_tcp._admodel.type.replace("js","")}}_play._factory.control.processNotification(type,data,_tcp._streamtype,_tcp._index,_tcp._div,_play.tools.parseInt(_tcp._data.getMedia("ID")),
_tcp._config.dataMode,false,_tcp._playIndex);if(_play.system.environment.isCasted){_play.addons.cast.receiver.sendMessage("notification",{type:type,data:data,streamtype:_tcp._streamtype,index:0,div:"nxpcastplayer",vid:_play.tools.parseInt(_tcp._data.getMedia("ID")),dataMode:_tcp._config.dataMode,mediaIndex:_tcp._playIndex});switch(type){case _play.config.events.METADATA:_play.addons.cast.receiver.sendUpdate(null,"IDLE");break;case _play.config.events.PLAY:_play.addons.cast.receiver.sendUpdate(null,
"PLAYING");break;case _play.config.events.PAUSE:_play.addons.cast.receiver.sendUpdate(null,"PAUSED");break;case _play.config.events.AD_ERROR:case _play.config.events.AD_ENDED:if(data.adType.indexOf("roll")>-1)_play.addons.cast.receiver.sendMessage("stopad");break;case _play.config.events.AD_STARTED:if(data.adType.indexOf("roll")>-1)_play.addons.cast.receiver.sendMessage("startad");break}}},reportDisplay:function(){_tcp._mediasession=_play.tools.getUniqueID();if(_tcp._mime!="image"){_play.tools.log("REPORTING DISPLAY",
"HALCYON");_tcp._flow.revolver.inited=false;_tcp._flow.revolver.items=null;_tcp._playIndex++;if(!_play.system.environment.isApp||!_app.config.useAppPlayer){if(_tcp._isPlayingExternal)_tcp._stream.events.hadCasted=true;if(_play.system.environment.isPIP)_tcp._stream.events.hadPIP=true;_tcp._data.emitEvent(_samaritan.events.DISPLAY,{isBumper:_tcp._isBumper?1:0});if(!_play.system.environment.isOMNIA&&!_play.system.environment.isONE)_play._factory.control.mediaReady(_tcp._config.dataMode)}else _samaritan.emitEvent(_samaritan.events.DISPLAY,
_tcp._data.getMedia("ID"),"video",_tcp._data.getMedia("ID","channeldata"),_tcp._data.getMedia("licenseby"),{isBumper:0},_tcp._mediasession,false,0)}_play.tools.log("MEDIA SESSION IS: "+_tcp._mediasession,"HALCYON")},reportPlay:function(){if(_tcp._mime=="image"||_tcp._stream.m&&!_tcp._playingAd&&_tcp._stream.isRunning()){_play.tools.log("REPORTING PLAY","HALCYON");if(!_tcp._notifiedOtherPlayer&&_tcp._config.allowOnlyOnePlayerPlaying==1){_tcp._notifiedOtherPlayer=true;_play.control.pauseAll(_tcp._div)}if(_tcp._initiallyMuted&&
_play.config.client.showOverlayIfMuted==1&&_play.tools.parseInt(_tcp._data.getMedia("hasAudio","features"))==1)_tcp._ui.addons.notice.build("<div class='nxp_icon-mute'></div>"+_play.tools.getClientText("initiallymuted"),true,"initiallymuted");_tcp._data.emitNotification(_play.config.events.START_PLAY);if(_tcp._config.reportParent!="")if(_tcp._config.reportParentProtocol==""){var p=_tcp._config.reportParent.split("-");_tcp._config.reportParentProtocol=_play.tools.getUniqueID();_tcp._data.emitEvent(_samaritan.events.PLAY,
{playReason:_tcp._playedVia,payReason:_tcp._payReason,playIndex:_tcp._playIndex,startedMuted:_tcp._muted||_tcp._initiallyMuted?1:0,isBumper:0,isPreview:0,protocol:_tcp._protocol,codec:_tcp._codec,datamode:_tcp._config.dataMode,protection:_tcp._data.getProtection("method",true)},p[1],p[0],0,0,true)}_tcp._data.emitEvent(_samaritan.events.PLAY,{playReason:_tcp._playedVia,payReason:_tcp._payReason,playIndex:_tcp._playIndex,startedMuted:_tcp._muted||_tcp._initiallyMuted?1:0,isBumper:_tcp._isBumper?1:0,
isPreview:_tcp._usePreview?1:0,protocol:_tcp._protocol,codec:_tcp._protocol,datamode:_tcp._config.dataMode,protection:_tcp._data.getProtection("method",true)});_tcp._playedVia="";if(_play.system.environment.isFullscreen){_tcp._stream.events.hadFS=true;_tcp._data.emitEvent(_samaritan.events.FULLSCREEN,{type:_tcp._fullscreenreportmode})}if(_play.system.environment.isPIP){_tcp._stream.events.hadPIP=true;_tcp._data.emitEvent(_samaritan.events.PIP)}if(_tcp._el.hasClass("nxp_lightson")){_tcp._stream.events.hadLightsout=
true;_tcp._data.emitEvent(_samaritan.events.LIGHTSOUT)}if(_play.system.environment.isHeadsetConnected){_tcp._stream.events.hadHeadset=true;_tcp._data.emitEvent(_samaritan.events.HEADSET,{})}if(_tcp._desiredSpeed!=1)_tcp._data.emitEvent(_samaritan.events.TRICKPLAY,{speed:_tcp._desiredSpeed});if(_tcp._isCasting){_tcp._stream.events.hadCasted=true;_tcp._data.emitEvent(_samaritan.events.CASTING,{device:"chromecast"});_tcp._data.emitNotification(_play.config.events.ENTER_REMOTE,{device:"chromecast"})}else if(_tcp._isPlayingExternal){_tcp._stream.events.hadCasted=
true;_tcp._data.emitEvent(_samaritan.events.CASTING,{device:"airplay"});_tcp._data.emitNotification(_play.config.events.ENTER_REMOTE,{device:"airplay"})}if(!_tcp._muted&&_tcp._playIndex>0){_play.tools.log("TRYING TO UNMUTE","HALCYON");_tcp._stream.unmute(true)}if(_play.config.user.id>0&&!_play.system.environment.isOMNIA){var pc=_tcp._config.reportParent;if(pc.length<2)pc=["",0];_play.system.connection.callAPI("/interactions/addtowatched",{item:_tcp._data.getMediaReal("ID"),streamtype:_tcp._streamtype,
mediasession:_tcp._mediasession,parentContext:pc[0],parentItem:pc[1],payContext:_tcp._payReason})}if(_tcp._xmode=="hotspot"){if(!_tcp._useSpots){_tcp._ui.addons.spots.init();_tcp._useSpots=true}var n={general:{ID:-999,isAuto:0,type:"text",autopos:0,validfrom:0,validto:_tcp._stream.dur,showthumb:0,posx:50,posy:50,text:"HotSpot",textadd:"",linkparam:""},imagedata:{icon:"info",thumb:"",thumb_alt:""}};_tcp._ui.addons.spots.spots.push(n)}}else if(_tcp._stream.m&&!_tcp._ended&&!_tcp._startMode){_play.tools.log("WAITING FOR PLAYTIME PROGRESS",
"HALCYON");if(_play.system.environment.isBackgroundCasting){_play.system.environment.isBackgroundCasting=false;_tcp._stream.m.pause();_play.addons.cast.setReference(_tcp);_play.addons.cast.sender.initMedia();_play.addons.cast.sender.sendMessage("changeplay",{vid:_tcp._playparam,mode:_tcp._playmode,delay:0});_tcp._isCasting=true;_tcp._ui.castdisplay.build()}else if(_tcp._isCasting)_tcp._stream.m.pause();else window.setTimeout(function(){_tcp._data.reportPlay()},50)}},reportError:function(ctxt,details){details=
details||"";_tcp._data.emitEvent(_samaritan.events.ERROR,{message:ctxt,details:details,technology:"html5",dataMode:_tcp._config.dataMode,playmode:_tcp._playmode,playparam:_tcp._playparam,playerversion:_play.config.constants.PLAYERVERSION,appversion:_play.system.environment.isApp?_app.config.constants.VERSION:0,frameworkversion:_play.config.constants.SDK_VERSION},_tcp._playparam,_tcp._playmode);_tcp._data.emitNotification(_play.config.events.ERROR)},reportAd:function(type,mode,isCall,isClick){if(!type||
type==""||type=="roll")type="preroll";if(type=="preroll"&&_tcp._adIsBumper)type="bumper";if(isClick){if(mode!="homad")_tcp._playingAdPaused=true;_tcp._data.emitNotification(_play.config.events.AD_CLICKED,null,mode=="homad"?"homad":null)}else if(!isCall){if(type!="break"&&type!="banner"){_tcp._playingAd=true;_tcp._playingAdPaused=false}_tcp._flow.ad.reportedStart=true;_tcp._el.removeClass("nxp_active");_tcp._data.emitNotification(_play.config.events.AD_STARTED,null,mode=="homad"?"homad":null);_tcp._flow.ad.four.sendEvent("AdVideoStart");
if(type=="midroll")_tcp._flow.ad.midRollPlayed=true}_tcp._data.emitEvent(isCall?_samaritan.events.AD_CALL:isClick?_samaritan.events.AD_CLICK:_samaritan.events.AD,{type:type,mode:mode,provider:_tcp._admodel.provider});if(isCall)_tcp._data.emitNotification(_play.config.events.AD_CALLED)},reportSpot:function(id,type){if(type==1)_tcp._data.emitEvent(_samaritan.events.CLICK,{item:_tcp._data.getMedia("ID")},id,"hotspot");else _tcp._data.emitEvent(_samaritan.events.PLAY,{isBumper:0,isPreview:0,playReason:"start",
payReason:"",playIndex:0,protocol:"",codec:"",datamode:_tcp._config.dataMode,protection:""},id,"hotspot",0,0)},vast:{index:0,redirects:0,verifications:[],listener:[],media:[],companions:[],banner:[],"break":[],_addListener:function(e,v){if(!_tcp._data.vast.listener[_tcp._data.vast.index].hasOwnProperty(e))_tcp._data.vast.listener[_tcp._data.vast.index][e]=[];_tcp._data.vast.listener[_tcp._data.vast.index][e].push(v)},parseListeners:function(n){var l=jQuery(n).find("Impression");jQuery.each(l,function(k,
m){_tcp._data.vast._addListener("impression",jQuery(m).text().trim())});l=jQuery(n).find("Error");jQuery.each(l,function(k,m){_tcp._data.vast._addListener("error",jQuery(m).text().trim())});l=jQuery(n).find("Tracking");jQuery.each(l,function(k,m){_tcp._data.vast._addListener(jQuery(m).attr("event"),jQuery(m).text().trim())});l=jQuery(n).find("ClickTracking");jQuery.each(l,function(k,m){_tcp._data.vast._addListener("click",jQuery(m).text().trim())});l=jQuery(n).find("NonLinearClickTracking");jQuery.each(l,
function(k,m){_tcp._data.vast._addListener("clicknonlinear",jQuery(m).text().trim())})},parseMedia:function(n){var c=jQuery(n).find("Creative");var codec=_play.system.capabilities.hasMP4?"mp4":"webm";jQuery.each(c,function(i,j){if(jQuery(j).find("Linear").length>0){var o={type:"vast",sequence:jQuery(j).parent().parent().parent().attr("sequence"),skip:0,duration:-1,url:"",target:jQuery(j).find("ClickThrough").first().text(),params:null};if(jQuery(j).find("Linear").attr("skipoffset"))o.skip=_play._factory.tools.formatSeconds(jQuery(j).find("Linear").attr("skipoffset"));
if(!o.sequence)o.sequence=-1;else o.sequence=_play.tools.parseInt(o.sequence);var d=jQuery(j).find("Duration");if(d.length==1){var a=d.first().text().split(":");o.duration=_play.tools.parseInt(a[1])*60+_play.tools.parseInt(a[2])}var m=jQuery(j).find("MediaFile");var adparams=null;var adc=jQuery(j).find("AdParameters");if(adc&&adc.length>0)adparams=adc.text();jQuery.each(m,function(k,l){if(!jQuery(l).attr("apiFramework")||jQuery(l).attr("apiFramework").toLowerCase()=="vast"){if(jQuery(l).attr("delivery")==
"progressive"&&jQuery(l).attr("type").indexOf(codec)>-1){o.url=jQuery(l).text().trim();o.type="vast";o.params=null}}else if(jQuery(l).attr("type").indexOf("shockwave")==-1){o.url=jQuery(l).text().trim();o.type="vpaid";o.params=adparams;_play.tools.log("VPAID FOUND","HALCYON")}else _play.tools.log("VPAID WAS FLASH, IGNORING","HALCYON")});_tcp._data.vast.media[_tcp._data.vast.index]=o}var ba=jQuery(j).find("NonLinear");if(ba.length>0)jQuery.each(ba,function(b,a){var d=jQuery(a).find("StaticResource");
jQuery.each(d,function(k,l){if(jQuery(l).attr("creativeType").split("/")[0]=="image"){var dur=jQuery(a).attr("minSuggestedDuration").split(":");var ob={target:jQuery(a).find("NonLinearClickThrough").first().text(),duration:_play.tools.parseInt(dur[1])*60+_play.tools.parseInt(dur[2]),url:jQuery(l).text().trim(),w:_play.tools.parseInt(jQuery(a).attr("width")),h:_play.tools.parseInt(jQuery(a).attr("height"))};if(_tcp._flow.ad.mode!="break")_tcp._data.vast.banner.push(ob);else _tcp._data.vast["break"].push(ob)}})})})},
onLoaded:function(xml){var x=jQuery(jQuery.parseXML(xml));if(x.find("VAST").length==1&&_play.tools.parseInt(x.find("VAST").first().attr("version"))>1&&x.find("Ad").length>0){var a=x.find("Ad");jQuery.each(a,function(i,j){if(jQuery(j).find("Wrapper").length>0)if(jQuery(j).find("Wrapper").attr("fallbackOnNoAd")!="true"){_tcp._data.vast.parseListeners(j);_tcp._data.vast.redirects++;if(_tcp._data.vast.redirects>_tcp._admodel.maxredirects){_play.tools.log("VAST IS WRAPPER, MAX REDIRECTS REACHED","HALCYON");
_tcp._flow.ad.onDone()}else{_play.tools.log("VAST IS WRAPPER, GETTING NEXT ONE","HALCYON");_tcp._data.vast.load(jQuery(j).find("VASTAdTagURI").text())}}else _play.tools.log("WRAPPER IS FALLBACK, SKIPPING","HALCYON");else{_tcp._data.vast.parseListeners(j);_tcp._data.vast.parseMedia(j);_tcp._flow.ad.four.check(j);_tcp._data.vast.index++;_tcp._data.vast.listener[_tcp._data.vast.index]={};if(i==a.length-1)_tcp._flow.ad.onLoaded()}})}else{_play.tools.log("EMPTY VAST","HALCYON");_tcp._flow.ad.four.sendEvent("AdError");
_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"vast",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._flow.ad.onLoaded()}},load:function(url){_tcp._flow.ad.currentURL=_play._factory.stream.rewriteAdURL(url,_tcp._admodel.provider,_tcp._data.getMedia("ID"),_tcp._data.getMedia("title"),_tcp._data.getMedia("adref","channeldata"),_tcp._data.getMedia("originalAdChannel","streamdata"),_tcp._data.getMedia("studio_adref"),_tcp._width,_tcp._height);_play.system.connection.getFile(_tcp._flow.ad.currentURL,
false,false,true,true).then(function(e){if(e&&e.data&&e.status<299)_tcp._data.vast.onLoaded(e.data);else _tcp._flow.ad.onError()})["catch"](function(e){if(_play.session.isDebug)console.log(e);_tcp._flow.ad.onError()})},init:function(url,ctxt){_tcp._data.vast.index=0;_tcp._data.vast.redirects=0;_tcp._data.vast.listener=[];_tcp._data.vast.listener[0]={};_tcp._data.vast.media=[];_tcp._data.vast.verifications=[];_tcp._data.vast.banner=[];_tcp._data.vast["break"]=[];_tcp._flow.ad.bannerStarted=false;_tcp._data.vast.load(url);
_tcp._data.reportAd(ctxt,"vast",true);return{media:_tcp._data.vast.media,listener:_tcp._data.vast.listener}}}},_flow:{prevVideo:0,prevDelay:0,ended:false,reset:function(){_play.tools.log("RESETTING PLAYER","HALCYON");_tcp._ui.hide();_tcp._autoplay=0;_tcp._isRebuild=true;_tcp._firstRun=true;_tcp._startMode=true;_tcp._notifiedOtherPlayer=false;_tcp._muted=false;_tcp._initiallyMuted=false;_tcp._el.addClass("nxp_startmode");_tcp._stream.clean();_tcp._ui.build();_tcp._ui.show();_tcp._stream.playPromiseError=
false;if(_tcp._stream.m)_tcp._stream.m.muted=false;_tcp._ui.addons.notice.remove();_tcp._ui.hideLoader()},startNative:function(aparams){var params={cid:_play.session.cid.toString(),client:_play.config.client.id.toString(),deviceID:_play.system.device.id.toString(),userhash:_play.config.user.hash,appid:_app.config.constants.ID.toString(),mediaid:_tcp._playparam.toString(),playmode:_tcp._playmode,forceSSL:_play.system.environment.isSSL?"1":"0",streamingFilter:_tcp._config.streamingFilter,playlicense:_play.session.playLicense.toString(),
startpos:_tcp._config.delay.toString(),startitem:_tcp._playpos.toString(),overrideAutoNext:_tcp._autonext.toString(),overrideExitMode:_tcp._exitmode.toString(),urlrepresentation:_play.tools.getURL(),playparent:_tcp._config.reportParent,playparentprotocol:_tcp._config.reportParentProtocol,appversion:_app.config.constants.VERSION.toString(),frameworkversion:_play.config.constants.SDK_VERSION.toString()};if(_play.session.isDebug)params.clearCache="1";if(aparams)params=$.extend(aparams);_play.tools.log("STARTING NATIVE PLAYER WITH "+
JSON.stringify(params),"HALCYON");_app["native"].media.player.start(params)},ad:{player:null,cd:null,cdt:0,midrollTarget:0,bannerTarget:0,lastRoll:0,adresult:[],index:0,mode:"",dur:0,reportedStart:false,currentURL:"",mediaSrc:null,mediaPos:0,had25:false,had50:false,had75:false,bannerActive:false,bannerNext:0,bannerCurrent:0,bannerIndex:-1,breakIndex:-1,bannerStarted:false,allowPre:true,allowMid:true,allowPost:true,allowBanner:true,allowBreakAds:true,isSkippable:false,midRollPlayed:false,load:function(ctxt){_tcp._flow.ad.mode=
ctxt;if(_tcp._stream.m){_tcp._flow.ad.mediaSrc=_tcp._stream.m.getAttribute("src");_tcp._flow.ad.mediaPos=_tcp._stream.getCurrentTime()}else _tcp._flow.ad.mediaSrc=null;_play.tools.log("CHECKING ADS FOR "+ctxt,"HALCYON");if((_play.tools.parseInt(_tcp._data.getMedia("adMode","streamdata"))!=-1&&_tcp._flow.ad.mediaSrc&&(_play.tools.parseInt(_tcp._data.getMedia("isPay"))==0||_play.tools.parseInt(_tcp._data.getMedia("adMode","streamdata"))==1)||_tcp._useAdFallback)&&_tcp._playmode!="variant")if(ctxt==
"pre"||_play.tools.parseInt(_tcp._data.getMedia("adMode","streamdata"))!=2)if(["pre","mid","post"].indexOf(ctxt)==-1||_tcp._flow.ad.lastRoll<=_play.session.getTime()-_tcp._admodel.vast_minimal_distance)if(["banner","break"].indexOf(ctxt)==-1&&(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima"))_tcp._flow.ad.ima.getAd();else{var url=_tcp._admodel["vast_"+ctxt];if(ctxt=="pre"&&!_tcp._live&&_tcp._admodel.vast_bumper!=""&&_tcp._admodel.vast_bumper_threshold>=_play._factory.tools.formatSeconds(_tcp._data.getMediaReal("runtime"))){_tcp._adIsBumper=
true;url=_tcp._admodel.vast_bumper}else _tcp._adIsBumper=false;url=url||"";if(url&&url!="")if(url.substr(0,4)!="http"||_tcp._admodel.type=="jsvast"){_play.tools.log("CALLING JS FOR VAST URL","HALCYON");try{var a=url.split(",");url=eval(a[0]+"('"+a[1]+"')")}catch(e){url=""}}if(url&&url!="")_tcp._data.vast.init(url,_tcp._flow.ad.mode);else{_play.tools.log("ADS DISABLED DUE TO EMPTY URL","HALCYON");_tcp._flow.ad.four.sendEvent("AdError");_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"url",
mode:"vast",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._flow.ad.onDone();if(_tcp._admodel.type=="jsvast")_tcp._data.emitNotification(_play.config.events.AD_ERROR)}}else{_play.tools.log("ADS DISABLED DUE TO TOO SHORT AD DELAY","HALCYON");_tcp._flow.ad.onDone()}else{_play.tools.log("ONLY PREROLLS ARE ALLOWED","HALCYON");_tcp._flow.ad.onDone()}else{_play.tools.log("ADS DISABLED DUE TO MEDIA SETTINGS","HALCYON");_tcp._flow.ad.onDone()}},onLoaded:function(data){_play.tools.log("XML LOADING SUCCESS",
"HALCYON");var adresult;if(_tcp._data.vast.media.length>1){var o=[];var f=[];jQuery.each(_tcp._data.vast.media,function(i,j){if(j.sequence>0)o.push(j);else f.push(j)});if(o.length==0){_play.tools.log("AD MEDIA ARE NOT IN SEQUENCE, AD BUFFET FOUND","HALCYON");o.push(_tcp._data.vast.media[0]);f.shift()}adresult={media:o,fallbacks:f,listener:_tcp._data.vast.listener,verifications:_tcp._data.vast.verifications}}else adresult={media:_tcp._data.vast.media,fallbacks:[],listener:_tcp._data.vast.listener,
verifications:_tcp._data.vast.verifications};if(_tcp._flow.ad.mode=="break"&&_tcp._data.vast["break"].length>0){_tcp._flow.ad.breakIndex=-1;_tcp._flow.ad.adresult=adresult;_tcp._flow.ad.nextBreak()}else if(!adresult||!adresult.media||adresult.media.length<1||adresult.media[0]["url"]==""){if(_tcp._data.vast.banner.length>0)_tcp._flow.ad.adresult=adresult;_tcp._flow.ad.onDone()}else{_play.tools.log("ADS WILL COME","HALCYON");_tcp._flow.ad.index=0;_tcp._flow.ad.adresult=adresult;if(_play.system.isIOS())_tcp._ui.addons.captions.hide();
if(_tcp._flow.ad.mode=="mid"){_tcp._flow.ad.cdt=_play.config.constants.MIDROLL_SEEKBACK;_tcp._ui.addons.notice.build(_play.tools.getClientText("adpreslogan").replace("{sec}",_tcp._flow.ad.cdt),true,"pread");_tcp._flow.ad.cd=window.setInterval(function(){_tcp._flow.ad.cdt--;_tcp._overlay.find(".nxp_notice[data-context='pread']").html(_play.tools.getClientText("adpreslogan").replace("{sec}",_tcp._flow.ad.cdt))},1E3);window.setTimeout(function(){_tcp._flow.ad.onWillStart()},_play.config.constants.MIDROLL_SEEKBACK*
1E3)}else _tcp._flow.ad.onWillStart()}},onWillStart:function(){if(_tcp._flow.ad.cd){window.clearInterval(_tcp._flow.ad.cd);_tcp._ui.addons.notice.remove()}if(["pre","mid","post"].indexOf(_tcp._flow.ad.mode)>-1)_tcp._flow.ad.lastRoll=_play.session.getTime();_tcp._ui.addons.tap.remove();_tcp._el.addClass("nxp_admode");_tcp._playingAdPaused=false;_tcp._ia.onLeavePlayer();if(_tcp._willUseSHAKA){_tcp._area.append("<video id='nxp_adplayer"+_tcp._index+"' style='width:100%;height:100%;position:absolute;top:0;left:0;opacity:1 !important;'></video>");
_tcp._flow.ad.player=document.getElementById("nxp_adplayer"+_tcp._index);jQuery.each(_tcp._stream.events.ev,function(i,j){_tcp._flow.ad.player.addEventListener(j,_tcp._stream.events.listen,false)});if(_tcp._flow.ad.mode!="post"){_tcp._pendingPause=true;_tcp._stream.m.pause()}if(_tcp._muted)_tcp._flow.ad.player.muted=true}_tcp._flow.ad.nextAd()},onError:function(e){_play.tools.log("XML LOADING FAILED","HALCYON");_tcp._flow.ad.onDone();_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"url",mode:"vast",
provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._flow.ad.four.sendEvent("AdError");_tcp._data.emitNotification(_play.config.events.AD_ERROR)},onClick:function(){_tcp._flow.ad.ping("click");_tcp._flow.ad.four.sendEvent("AdClickThru");_tcp._data.reportAd(_tcp._flow.ad.mode,_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type,false,true);if(_tcp._flow.ad.adresult.media&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type!="vpaid"){if(!_tcp._flow.ad.player)_tcp._stream.m.pause();else _tcp._flow.ad.player.pause();
_tcp._flow.ad.four.sendEvent("AdPaused");_tcp._flow.ad.four.sendEvent("AdStopped")}_tcp._el.removeClass("nxp_vpaidad");_tcp._ui.visualresponse.addStatic("play")},onDone:function(fromLegacy){if(_tcp._stream.m)if(["banner","break"].indexOf(_tcp._flow.ad.mode)==-1){_play.tools.log("ADS DONE FOR "+_tcp._flow.ad.mode,"HALCYON");if(!_play.system.environment.isCasted)_tcp._menu.find(".nxp_menubar").show();_tcp._pendingPause=false;_tcp._playingAd=false;_tcp._playingAdPaused=false;_tcp._adIsBumper=false;_tcp._el.removeClass("nxp_admode nxp_vpaidad");
if(_play.tools.parseInt(_play.config.client.ads_enableOverlay)==2)_tcp._el.removeClass("nxp_noadoverlay");if(_tcp._flow.ad.four.isActive)_tcp._flow.ad.four.remove();_tcp._ui.addons.layer.remove();_tcp._ui.visualresponse.removeAll();if(!_tcp._willUseSHAKA){_play.tools.log("SETTING DELAY TO "+_tcp._flow.ad.mediaPos,"HALCYON");_tcp._config.delay=_tcp._flow.ad.mediaPos}else if(_tcp._flow.ad.player){jQuery.each(_tcp._stream.events.ev,function(i,j){_tcp._flow.ad.player.removeEventListener(j,_tcp._stream.events.listen,
false)});jQuery("#nxp_adplayer"+_tcp._index).remove();_tcp._flow.ad.player=null}_tcp._menu.find(".nxp_skip").remove();if(_tcp._hasCaptions)_tcp._ui.addons.captions.show();if(!fromLegacy){window.setTimeout(function(){if(_tcp._stream.m){if(_tcp._protocol=="http"||!_tcp._willUseSHAKA){var cs=_tcp._stream.m.getAttribute("src");if(cs!=_tcp._flow.ad.mediaSrc){if(_tcp._flow.ad.mode=="mid"&&hasBeenPlayed)_tcp._flow.ad.mediaPos-=_play.config.constants.midroll_seekback;_play.tools.log("SETTING PLAYER TO "+
_tcp._flow.ad.mediaSrc,"HALCYON");_tcp._stream.m.src=_tcp._flow.ad.mediaSrc}}if(_play.system.environment.isCasted)_tcp._ia.onEnterPlayer(true);switch(_tcp._flow.ad.mode){case "pre":if(_tcp._stream.m){if(_tcp._muted){_play.tools.log("MUTING MEDIA","HALCYON");_tcp._stream.m.muted=true}else _tcp._stream.m.muted=false;if(_tcp._protocol=="http"||!_tcp._willUseSHAKA)_tcp._stream.m.load();_tcp._stream.simplePlay();if(_tcp._useBanners)if(_tcp._flow.ad.allowBanner)_tcp._flow.ad.load("banner");else _play.tools.log("BANNERS FORBIDDEN",
"HALCYON")}break;case "post":_tcp._flow.onEnded(true);break;case "mid":if(_tcp._muted)_tcp._stream.m.muted=true;_tcp._stream.events.midrollcounter=0;if(_tcp._flow.ad.midRollPlayed){_tcp._flow.ad.midRollPlayed=false;_tcp._stream.seekRelative(-1*_play.config.constants.MIDROLL_SEEKBACK)}else _tcp._stream.simplePlay();break;case "banner":_tcp._stream.events.bannercounter=0;break}if(_play.system.isIOS())_tcp._ui.addons.captions.show();_tcp._ui.onResize();if(_tcp._streamtype=="audio"){_tcp._menuActive=
true;_tcp._ui.show()}}},_play.system.environment.isCasted?750:50);_tcp._ui.onResize()}}},onAdDone:function(skipReportAdEnd,fromLegacy,fromError){if(["banner","break"].indexOf(_tcp._flow.ad.mode)==-1){_tcp._menu.find(".nxp_skip").remove();_tcp._flow.ad.index++;if(!skipReportAdEnd)_tcp._data.emitNotification(_play.config.events.AD_ENDED);if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima"){if(_tcp._flow.ad.ima.i){window.clearInterval(_tcp._flow.ad.ima.i);_tcp._flow.ad.ima.i=null}_tcp._flow.ad.onDone(fromLegacy)}else if(_tcp._flow.ad.adresult.media&&
_tcp._flow.ad.adresult.media.length&&_tcp._flow.ad.index>_tcp._flow.ad.adresult.media.length-1||fromLegacy)if(fromError&&_tcp._flow.ad.index==1&&_tcp._flow.ad.adresult.fallbacks&&_tcp._flow.ad.adresult.fallbacks.length&&_tcp._flow.ad.adresult.fallbacks.length>0){_play.tools.log("AD FALLBACK FOUND","HALCYON");_tcp._flow.ad.index=0;_tcp._flow.ad.adresult.media=[_tcp._flow.ad.adresult.fallbacks[0]];_tcp._flow.ad.adresult.fallbacks=[];_tcp._flow.ad.nextAd()}else _tcp._flow.ad.onDone(fromLegacy);else _tcp._flow.ad.nextAd()}},
nextAd:function(){if(_tcp._flow.ad.adresult.media&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].duration>-1&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].duration<2){_play.tools.log("SKIPPING AD, TOO SHORT","HALCYON");if(_tcp._admodel.provider=="sevenone")_tcp._flow.ad.ping("impression");else _tcp._flow.ad.ping("error");_tcp._flow.ad.onAdDone(true)}else if(!_tcp._isRebuild){_tcp._ui.showLoader();_tcp._flow.ad.had25=false;_tcp._flow.ad.had50=false;_tcp._flow.ad.had75=false;_tcp._flow.ad.reportedStart=
false;_tcp._flow.ad.isSkippable=false;_tcp._playingAd=true;_tcp._menu.find(".nxp_menubar").hide();window.setTimeout(function(){if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendMessage("playingad");if(!_tcp._isRebuild)if(_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type=="vast"){if(_tcp._flow.ad.adresult.verifications[_tcp._flow.ad.index]&&_tcp._flow.ad.adresult.verifications[_tcp._flow.ad.index]!=""){_tcp._flow.ad.four.init();_tcp._flow.ad.four.sendEvent("AdLoaded")}if(!_tcp._notifiedOtherPlayer&&
_tcp._config.allowOnlyOnePlayerPlaying==1){_tcp._notifiedOtherPlayer=true;_play.control.pauseAll(_tcp._div)}_play.tools.log("SETTING PLAYER TO "+_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].url,"HALCYON");if(!_tcp._willUseSHAKA){if(_tcp._stream.m){_tcp._stream.m.src=_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].url;_tcp._stream.m.load();_tcp._stream.simplePlay()}}else{_tcp._flow.ad.player.src=_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].url;_tcp._flow.ad.player.play()}if(_tcp._muted){_play.tools.log("MUTING AD",
"HALCYON");if(!_tcp._willUseSHAKA)_tcp._stream.m.muted=true;else _tcp._flow.ad.player.muted=true}_tcp._flow.ad.four.sendEvent("AdStarted")}else _tcp._flow.ad.vpaid.init()},_play.system.environment.isCasted?750:50)}},renderText:function(){var t="";if(_tcp._flow.ad.adresult.media&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index]){if(_tcp._flow.ad.adresult.media.length>1)t=_play.tools.getClientText("adsloganpod").replace("{pos}",_tcp._flow.ad.index+1).replace("{all}",_tcp._flow.ad.adresult.media.length);
else t=_play.tools.getClientText("adslogan");if(_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type=="vpaid")try{t=t.replace("{sec}",Math.max(0,Math.floor(_tcp._flow.ad.vpaid.vp.getAdRemainingTime())))}catch(e){}else if(!_tcp._willUseSHAKA)t=t.replace("{sec}",Math.max(0,Math.floor(_tcp._flow.ad.dur-_tcp._stream.getCurrentTime(true))).toString());else t=t.replace("{sec}",Math.max(0,Math.floor(_tcp._flow.ad.dur-_tcp._flow.ad.player.currentTime)).toString())}else if(_tcp._admodel.type=="ima"||_tcp._admodel.type==
"jsima"){if(_tcp._flow.ad.ima.adcount>1)t=_play.tools.getClientText("adsloganpod").replace("{pos}",_tcp._flow.ad.ima.adindex).replace("{all}",_tcp._flow.ad.ima.adcount);else t=_play.tools.getClientText("adslogan");t=t.replace("{sec}",Math.max(0,_tcp._flow.ad.ima.getRemainingTime()))}_tcp._menu.find(".nxp_sociallayer[data-context='ad']").html("<div class='nxp_adhint'>"+t+"</div>");if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendMessage("adupdate",t)},handleProgress:function(){if(_tcp._admodel.type!=
"ima")if(_tcp._flow.ad.dur>0){var c=_tcp._stream.getCurrentTime(true);if(_tcp._willUseSHAKA)c=_tcp._flow.ad.player.currentTime;if(c>=.25*_tcp._flow.ad.dur&&!_tcp._flow.ad.had25){_tcp._flow.ad.had25=true;_tcp._flow.ad.ping("firstQuartile");_tcp._flow.ad.four.sendEvent("AdVideoFirstQuartile")}if(c>=.5*_tcp._flow.ad.dur&&!_tcp._flow.ad.had50){_tcp._flow.ad.had50=true;_tcp._flow.ad.ping("midpoint");_tcp._flow.ad.four.sendEvent("AdVideoMidpoint")}if(c>=.75*_tcp._flow.ad.dur&&!_tcp._flow.ad.had75){_tcp._flow.ad.had75=
true;_tcp._flow.ad.ping("thirdQuartile");_tcp._flow.ad.four.sendEvent("AdVideoThirdQuartile")}if(!_play.system.environment.isCasted&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].skip>0&&c>=_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].skip&&_tcp._menu.find(".nxp_skip").length==0){_tcp._flow.ad.isSkippable=true;_tcp._menu.append("<div class='nxp_skip nxp_bg nxp_roundedleft'>"+_play.tools.getClientText("skipad")+"</div>");_tcp._menu.find(".nxp_skip").animate({right:"0px"});_tcp._flow.ad.four.sendEvent("AdSkippableStateChange")}}},
skip:function(){_tcp._flow.ad.ping("skip");_tcp._flow.ad.four.sendEvent("AdSkipped");_tcp._flow.ad.onAdDone()},ping:function(ctxt){_play.tools.log("LOOKING FOR PINGS FOR "+ctxt,"HALCYON");if(_tcp._flow.ad.adresult.listener){var o=_tcp._flow.ad.adresult.listener[_tcp._flow.ad.index];if(_tcp._flow.ad.mode=="break")o=_tcp._flow.ad.adresult.listener[_tcp._flow.ad.breakIndex];if(o&&o.hasOwnProperty(ctxt)&&o[ctxt].length)_play.tools.preloadImages(o[ctxt])}else _play.tools.log("NO AD LISTENER DEFINED","HALCYON")},
initBanners:function(){_play.tools.log("INITING BANNERS","HALCYON");if(_play.system.environment.isFullscreen||_tcp._useFullPlayer&&_tcp._width>=_play.config.constants.BANNER_MIN_WIDTH){_tcp._flow.ad.bannerIndex=-1;_tcp._flow.ad.bannerStarted=true;_tcp._menu.append("<div class='nxp_banners'></div>");window.setTimeout(function(){_tcp._flow.ad.nextBanner()},5E3)}else _play.tools.log("SKIPPING BANNERS, TOO SMALL","HALCYON")},nextBanner:function(){if(_tcp._flow.ad.bannerIndex>=0){_tcp._flow.ad.ping("complete");
_tcp._flow.ad.ping("close");_tcp._flow.ad.ping("closeLinear");_tcp._menu.find(".nxp_banners").html("")}_tcp._flow.ad.bannerIndex++;_play.tools.log("INIT BANNER "+_tcp._flow.ad.bannerIndex,"HALCYON");if(_tcp._flow.ad.bannerIndex<=_tcp._data.vast.banner.length-1){_tcp._flow.ad.ping("creativeView");_tcp._flow.ad.ping("impression");_tcp._flow.ad.ping("start");_tcp._flow.ad.four.sendEvent("AdImpression");_tcp._flow.ad.four.sendEvent("AdStarted");_tcp._data.vast.bannerActive=true;_tcp._data.vast.bannerCurrent=
0;_tcp._data.vast.bannerNext=_tcp._data.vast.banner[_tcp._flow.ad.bannerIndex]["duration"];_tcp._data.reportAd("banner","vast");_tcp._menu.find(".nxp_banners").html("<img data-command='bannerclick' style='display:none;' src='"+_tcp._data.vast.banner[_tcp._flow.ad.bannerIndex]["url"]+"' class='nxp_banner' />");_tcp._menu.find(".nxp_banner").stop().fadeIn();_tcp._el.addClass("nxp_adbanner")}else{_tcp._data.vast.bannerActive=false;_tcp._flow.ad.removeBanners()}},removeBanners:function(){if(_tcp._el.hasClass("nxp_adbanner")){_tcp._data.vast.bannerActive=
false;_tcp._data.vast.bannerCurrent=0;_tcp._data.vast.bannerNext=0;_tcp._data.vast.banner=[];_tcp._el.removeClass("nxp_adbanner");_tcp._menu.remove(".nxp_banners");_tcp._data.emitNotification(_play.config.events.AD_ENDED)}},nextBreak:function(){_tcp._overlay.find(".nxp_breakad").remove();if(_tcp._stream.m&&_tcp._stream.m.paused&&!_tcp._playingAd){_tcp._flow.ad.breakIndex++;_tcp._el.addClass("nxp_breakingad");_tcp._overlay.prepend("<div class='nxp_breakad'><div class='nxp_breakadholder'><img src='"+
_tcp._data.vast["break"][_tcp._flow.ad.breakIndex].url+"' /></div></div>");_tcp._data.reportAd("break","vast");_tcp._flow.ad.ping("creativeView");_tcp._flow.ad.ping("impression");_tcp._flow.ad.ping("start");if(_tcp._flow.ad.breakIndex==0){_tcp._ui.addons.layer.build("ad");_tcp._menu.find(".nxp_sociallayer[data-context='ad']").html("<div class='nxp_adhint'>"+_play.tools.getClientText("breakad")+"</div>")}}},removeBreak:function(){if(_tcp._el.hasClass("nxp_breakingad")){_tcp._el.removeClass("nxp_breakingad");
_tcp._ui.addons.layer.remove();_tcp._overlay.find(".nxp_breakad").remove();_tcp._data.vast["break"]=[];_tcp._flow.ad.ping("complete");_tcp._flow.ad.ping("close");_tcp._flow.ad.ping("closeLinear");_tcp._data.emitNotification(_play.config.events.AD_ENDED)}},ima:{hasStarted:false,disabled:false,container:null,loader:null,manager:null,adcount:0,adindex:0,i:null,prepare:function(){if(typeof google!="object"||typeof google.ima!="object"){_play.tools.log("LOADING IMA SDK","HALCYON");jQuery.getScript("http"+
(_play.system.environment.isSSL?"s":"")+"://imasdk.googleapis.com/js/sdkloader/ima3.js")}},getVideoObject:function(){return jQuery("#nxp_vpaid"+_tcp._index)},initContainer:function(){var vc=document.getElementById("nxp_player"+_tcp._index);google.ima.settings.setPlayerType("nexxPLAY");google.ima.settings.setPlayerVersion("HALCYON-"+_play.config.constants.PLAYERVERSION);google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED);google.ima.settings.setNumRedirects(_play.tools.parseInt(_tcp._admodel.maxredirects));
google.ima.settings.setLocale(_play.session.language);_tcp._area.append("<div id='nxp_vpaid"+_tcp._index+"' style='width:100%;height:100%;position:absolute;top:0;left:0;border:none;background-color:transparent'></div>");_tcp._flow.ad.ima.container=new google.ima.AdDisplayContainer(document.getElementById("nxp_vpaid"+_tcp._index),vc);if(typeof _tcp._flow.ad.ima.container.initialize=="function")_tcp._flow.ad.ima.container.initialize()},init:function(){_play.tools.log("INITING IMA SDK","HALCYON");if(typeof google!=
"object"||typeof google.ima!="object")window.setTimeout(function(){if(typeof google!="object"||typeof google.ima!="object"){_play.tools.log("GIVING UP ON IMA - MAYBE ADBLOCKER","HALCYON");_tcp._flow.ad.ima.disabled=true;_tcp._flow.ad.onAdDone(true);_tcp._data.emitNotification(_play.config.events.AD_ERROR);_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"sdk",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})}else _tcp._flow.ad.ima.init()},2500);else{if(!_tcp._flow.ad.ima.container)_tcp._flow.ad.ima.initContainer();
var vc=document.getElementById("nxp_player"+_tcp._index);_tcp._flow.ad.ima.loader=new google.ima.AdsLoader(_tcp._flow.ad.ima.container);_tcp._flow.ad.ima.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(e){var ars=new google.ima.AdsRenderingSettings;ars.loadVideoTimeout=15E3;ars.restoreCustomPlaybackStateOnAdBreakComplete=false;_tcp._flow.ad.ima.manager=e.getAdsManager(vc,ars);try{_play.tools.log("INITING IMA MANAGER","HALCYON");var vel=_tcp._flow.ad.ima.getVideoObject();
_tcp._flow.ad.ima.manager.init(vel.width(),vel.height(),_play.system.environment.isFullscreen?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL);_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.STARTED,function(e){_play.tools.log("IMA AD HAS STARTED","HALCYON");var ad=e.getAd();if(ad.isLinear()){if(["pre","mid","post"].indexOf(_tcp._flow.ad.mode)>-1)_tcp._flow.ad.lastRoll=_play.session.getTime();_tcp._flow.ad.ima.mute(_tcp._muted);var ap=ad.getAdPodInfo();_tcp._flow.ad.ima.hasStarted=
true;_tcp._flow.ad.ima.adcount=ap.getTotalAds();_tcp._flow.ad.ima.adindex=ap.getAdPosition();_tcp._ui.addons.tap.remove();_tcp._el.addClass("nxp_admode nxp_vpaidad");_tcp._el.removeClass("nxp_active");_tcp._data.reportAd(_tcp._flow.ad.mode+"roll","ima");if(!_tcp._notifiedOtherPlayer&&_tcp._config.allowOnlyOnePlayerPlaying==1){_tcp._notifiedOtherPlayer=true;_play.control.pauseAll(_tcp._div)}if(_tcp._flow.ad.mode!="post"&&_tcp._useFullPlayer&&!_play.system.environment.isCasted&&!_play.system.isIOS()){_play.tools.log("PAUSING MAIN CONTENT FOR IMA",
"HALCYON");_tcp._pendingPause=true;_tcp._stream.m.pause()}if(!_play.system.isMobile())_tcp._ui.addons.layer.build("ad");else _tcp._el.addClass("nxp_noadoverlay");if(_play.tools.parseInt(_play.config.client.ads_enableOverlay)==2){var af="";try{af=ad.getApiFramework()}catch(e$5){}if(af&&af!=""&&af!="vast"){_play.tools.log("IMA3 API FRAMEWORK: "+af,"HALCYON");_tcp._el.addClass("nxp_noadoverlay")}}_tcp._flow.ad.ima.i=window.setInterval(function(){_tcp._flow.ad.renderText()},750);if(!_play.system.environment.isCasted&&
!_play.system.isMobile())_tcp._ui.addons.layer.build("adcontrol",true)}});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.CLICK,function(e){_play.tools.log("AD CLICK DETECTED","HALCYON");_tcp._data.reportAd(_tcp._flow.ad.mode,"ima",false,true);if(!_play.system.isMobile()){_tcp._playingAdPaused=true;_tcp._flow.ad.ima.manager.pause();_tcp._ui.visualresponse.addStatic("play")}});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,function(e){_play.tools.log("IMA AD CAN START",
"HALCYON")});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(e){_tcp._playingAd=true;_play.tools.log("IMA AD WILL START","HALCYON")});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(e){_play.tools.log("IMA AD ENDED","HALCYON");if(!_tcp._flow.ad.ima.hasStarted){_play.tools.log("IMA AD HAD NOT STARTED, BUT ENDED, MEDIA ERROR ASSUMED, EMITTING ERROR","HALCYON");_tcp._data.emitNotification(_play.config.events.AD_ERROR);
_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"file",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})}_tcp._flow.ad.onAdDone(false)});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.PAUSED,function(e){_play.tools.log("IMA AD PAUSED","HALCYON");_tcp._playingAdPaused=true;_tcp._ui.visualresponse.addStatic("play")});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.RESUMED,function(e){_play.tools.log("IMA AD RESUMED","HALCYON");_tcp._playingAdPaused=
false;_tcp._ui.visualresponse.removeAll()});_tcp._flow.ad.ima.manager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(e){_play.tools.log("IMA SKIPPABLE STATE CHANGED","HALCYON");if(_tcp._flow.ad.ima.manager.getAdSkippableState()){_tcp._menu.append("<div class='nxp_skip nxp_bg nxp_roundedleft'>"+_play.tools.getClientText("skipad")+"</div>");_tcp._menu.find(".nxp_skip").animate({right:"0px"})}else _tcp._menu.find(".nxp_skip").remove()});_tcp._flow.ad.ima.manager.start()}catch(ae){_play.tools.log("AD CATCH ERROR",
"HALCYON");_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"error",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._flow.ad.onAdDone(true)}});_tcp._flow.ad.ima.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){_tcp._flow.ad.ima.remove(true);try{if(!e||e.getError().getVastErrorCode()!=303){_play.tools.log("IMA AD ERROR","HALCYON");_tcp._data.emitNotification(_play.config.events.AD_ERROR);_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"error",
mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})}else{_play.tools.log("EMPTY VAST","HALCYON");_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"vast",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})}}catch(aa){_play.tools.log("AD CATCH ERROR","HALCYON");_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"error",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})}});_tcp._flow.ad.ima.getAd()}},getAd:function(){if(!_tcp._flow.ad.ima.disabled)if(!_tcp._flow.ad.ima.loader)_tcp._flow.ad.ima.init();
else{_tcp._flow.ad.ima.hasStarted=false;var url=_tcp._admodel["vast_"+_tcp._flow.ad.mode];if(_tcp._flow.ad.mode=="pre"&&_tcp._admodel.vast_bumper!=""&&_tcp._admodel.vast_bumper_threshold>=_play._factory.tools.formatSeconds(_tcp._data.getMediaReal("runtime"))){_tcp._adIsBumper=true;url=_tcp._admodel.vast_bumper}else _tcp._adIsBumper=false;url=url||"";if(url&&url!="")if(url.substr(0,4)!="http"||_tcp._admodel.type=="jsima"){_play.tools.log("CALLING JS FOR IMA URL","HALCYON");try{var a=url.split(",");
url=eval(a[0]+"('"+a[1]+"')")}catch(e){url=""}}if(url&&url!=""){var vel=_tcp._flow.ad.ima.getVideoObject();var ar=new google.ima.AdsRequest;_tcp._flow.ad.currentURL=_play._factory.stream.rewriteAdURL(url,_tcp._admodel.provider,_tcp._data.getMedia("ID"),_tcp._data.getMedia("title"),_tcp._data.getMedia("adref","channeldata"),_tcp._data.getMedia("originalAdChannel","streamdata"),_tcp._data.getMedia("studio_adref"),_tcp._width,_tcp._height);ar.adTagUrl=_tcp._flow.ad.currentURL;ar.vastLoadTimeout=16E3;
ar.linearAdSlotWidth=vel.width();ar.linearAdSlotHeight=vel.height();ar.nonLinearAdSlowWidth=vel.width();ar.nonLinearAdSlotHeight=vel.height();_tcp._flow.ad.ima.loader.requestAds(ar);_tcp._data.reportAd(_tcp._flow.ad.mode,"ima",true)}else{_tcp._flow.ad.onDone();_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"url",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});if(_tcp._admodel.type=="jsima")_tcp._data.emitNotification(_play.config.events.AD_ERROR)}}else{_play.tools.log("IMA AD ERROR",
"HALCYON");_tcp._flow.ad.onAdDone(true);_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"sdk",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._data.emitNotification(_play.config.events.AD_ERROR)}},handleResize:function(){_play.tools.log("RESIZING IMA","HALCYON");var vel=_tcp._flow.ad.ima.getVideoObject();_tcp._flow.ad.ima.manager.init(vel.width(),vel.height(),_play.system.environment.isFullscreen?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},getRemainingTime:function(){var t=
0;try{t=_tcp._flow.ad.ima.manager.getRemainingTime()}catch(e){}return _play.tools.parseInt(t)},skip:function(){_tcp._flow.ad.ima.manager.skip()},mute:function(b){if(b)_tcp._flow.ad.ima.manager.setVolume(0);else _tcp._flow.ad.ima.manager.setVolume(1)},remove:function(skipReporting){_play.tools.log("REMOVING IMA","HALCYON");_tcp._flow.ad.onAdDone(skipReporting)}},four:{q:[],vp:null,i:null,isActive:false,isReady:false,check:function(n){var c=jQuery(n).find("Verification");jQuery.each(c,function(i,j){var f=
c.find("JavaScriptResource");if(f&&f.length==1){_play.tools.log("VAST4 FOUND","HALCYON");_tcp._data.vast.verifications[_tcp._data.vast.index]=f.text()}})},init:function(){_play.tools.log("INITING AD VERIFICATION","HALCYON");_tcp._flow.ad.four.isActive=true;_tcp._flow.ad.four.vp=null;_tcp._flow.ad.q=[];_tcp._flow.ad.four.i=document.createElement("iframe");_tcp._flow.ad.four.i.id="adfourframe"+_tcp._index;_tcp._flow.ad.four.i.style.position="absolute";_tcp._flow.ad.four.i.style.top="-10px";_tcp._flow.ad.four.i.style.left=
"-10px";_tcp._flow.ad.four.i.style.width="5px";_tcp._flow.ad.four.i.style.height="5px";document.body.appendChild(_tcp._flow.ad.four.i);_tcp._flow.ad.four.i.contentWindow.document.write('<body><script src="'+_tcp._flow.ad.adresult.verifications[_tcp._flow.ad.index]+'"></scr'+"ipt></body>");_tcp._flow.ad.four.checkIFrame()},checkIFrame:function(){if(_tcp._flow.ad.four.i&&_tcp._flow.ad.four.i.contentWindow&&_tcp._flow.ad.four.i.contentWindow.vendorAdapter&&_tcp._flow.ad.four.i.contentWindow.vendorAdapter.getAPI&&
typeof _tcp._flow.ad.four.i.contentWindow.vendorAdapter.getAPI=="function")try{_tcp._flow.ad.four.vp=_tcp._flow.ad.four.i.contentWindow.vendorAdapter.getAPI();_tcp._flow.ad.four.vp.handshakeVersion("1.0.0");_tcp._flow.ad.four.vp.subscribe("VendorReady",function(e){_tcp._flow.ad.four.vp.getInstructions()});_tcp._flow.ad.four.vp.initService({vendorData:{},slots:{slot:_tcp._area[0],videoSlot:document.getElementById("nxp_player"+_tcp._index)},timeout:500});_tcp._flow.ad.four.isReady=true;_play.tools.log("AD VERIFICATION INIT DONE",
"HALCYON");if(_tcp._flow.ad.four.q.length>0){_tcp._flow.ad.four.q.forEach(function(e){_play.tools.log("PUSHING EARLY AD "+e.type+" TO AD VERIFICATION","HALCYON");_tcp._flow.ad.four.vp.update(e)});_tcp._flow.ad.four.q=[]}}catch(e){_play.tools.log("AD VERIFICATION INIT FAILURE","HALCYON");_tcp._flow.ad.four.remove()}else if(_tcp._flow.ad.four.i)window.setTimeout(function(){_tcp._flow.ad.four.checkIFrame()},500)},sendEvent:function(e){if(_tcp._flow.ad.four.isActive){var d=_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].duration;
var t=_tcp._stream.getCurrentTime(true);var ev={type:e,timestamp:_play.session.getTime(true,true),data:{adData:{viewMode:"normal",adWidth:_tcp._width,adVolume:1,adSkippableState:_tcp._flow.ad.isSkippable,adRemainingTime:d-t,remainingTime:d-t,adLinear:["break","banner"].indexOf(_tcp._flow.ad.mode)==-1,adHeight:_tcp._height,adExpanded:false,adDuration:d},eventData:{}}};switch(e){case "AdVideoComplete":ev.data.adData.adRemainingTime=0;ev.data.adData.remainingTime=0;break;case "AdInteraction":ev.data.eventData.Id=
"";break;case "AdClickThru":ev.data.eventData.url="";ev.data.eventData.Id="";ev.data.eventData.playerHandles="";break}console.log(ev);_play.tools.log("UPDATE AD VERIFICATION","HALCYON");if(_tcp._flow.ad.four.vp)try{_tcp._flow.ad.four.vp.update(ev)}catch(e$6){}else{_tcp._flow.ad.four.q.push(ev);_play.tools.log("VAST4 NOT READY YET FOR "+e,"HALCYON")}}},remove:function(){_play.tools.log("REMOVING AD VERIFICATION","HALCYON");delete _tcp._flow.ad.four.vp;jQuery("#adfourframe"+_tcp._index).remove();_tcp._flow.ad.four.i=
null;_tcp._flow.ad.four.vp=null;_tcp._flow.ad.four.isActive=false;_tcp._flow.ad.four.isReady=false}},vpaid:{vp:null,i:null,j:null,vidmode:"",init:function(){_tcp._flow.ad.vpaid.vp=null;_tcp._flow.ad.vpaid.i=document.createElement("iframe");_tcp._flow.ad.vpaid.i.id="adloaderframe"+_tcp._index;_tcp._flow.ad.vpaid.i.style.position="absolute";_tcp._flow.ad.vpaid.i.style.top="-10px";_tcp._flow.ad.vpaid.i.style.left="-10px";_tcp._flow.ad.vpaid.i.style.width="5px";_tcp._flow.ad.vpaid.i.style.height="5px";
document.body.appendChild(_tcp._flow.ad.vpaid.i);_tcp._flow.ad.vpaid.i.contentWindow.document.write('<body><script src="'+_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].url+'"></scr'+"ipt></body>");_tcp._flow.ad.vpaid.checkIFrame()},checkIFrame:function(){var fn=_tcp._flow.ad.vpaid.i.contentWindow["getVPAIDAd"];if(fn&&typeof fn=="function")try{_tcp._flow.ad.vpaid.vp=fn();if(_tcp._flow.ad.vpaid.vp.handshakeVersion&&_tcp._flow.ad.vpaid.vp.initAd)if(typeof _tcp._flow.ad.vpaid.vp.handshakeVersion==
"function"){if(_tcp._flow.ad.vpaid.vp.handshakeVersion("2.0")<="3.0"){_play.tools.log("VPAID HANDSHAKE SUCCESS","HALCYON");_tcp._flow.ad.vpaid.initAd()}}else{_play.tools.log("VPAID HANDSHAKE FAILURE","HALCYON");_tcp._flow.ad.vpaid.remove(true)}else{_play.tools.log("VPAID NOT COMPLIANT","HALCYON");_tcp._flow.ad.vpaid.remove(true)}}catch(e){_play.tools.log("VPAID INIT FAILURE","HALCYON");_tcp._flow.ad.vpaid.remove(true)}else window.setTimeout(function(){_tcp._flow.ad.vpaid.checkIFrame()},500)},initAd:function(){try{if(_tcp._willUseSHAKA)_tcp._flow.ad.vpaid.vidmode=
"video";else _tcp._flow.ad.vpaid.vidmode="inline";_play.tools.log("VPAID INIT AD","HALCYON");_tcp._area.append("<div id='nxp_vpaid"+_tcp._index+"' style='width:100%;height:100%;position:absolute;top:0;left:0;border:none;background-color:transparent'></div>");_tcp._flow.ad.vpaid.vp.subscribe(function(){_play.tools.log("VPAID AD LOADED","HALCYON");_tcp._el.addClass("nxp_vpaidad");_tcp._flow.ad.vpaid.vp.startAd()},"AdLoaded");if(_tcp._flow.ad.vpaid.vidmode=="inline"){_tcp._flow.ad.vpaid.vp.subscribe(function(){_tcp._data.reportAd(_tcp._flow.ad.mode,
"vpaid");_tcp._flow.ad.ping("creativeView");_tcp._flow.ad.ping("start")},"AdStarted");_tcp._flow.ad.vpaid.vp.subscribe(function(){_tcp._flow.ad.ping("impression")},"AdImpression");_tcp._flow.ad.vpaid.vp.subscribe(function(){_tcp._ui.addons.layer.build("ad");if(!_play.system.environment.isCasted)_tcp._ui.addons.layer.build("adcontrol",true);if(!_tcp._flow.ad.vpaid.j)_tcp._flow.ad.vpaid.j=window.setInterval(function(){_tcp._flow.ad.renderText()},750)},"AdDurationChange");_tcp._flow.ad.vpaid.vp.subscribe(function(){},
"AdVideoFirstQuartile");_tcp._flow.ad.vpaid.vp.subscribe(function(){},"AdVideoMidpoint");_tcp._flow.ad.vpaid.vp.subscribe(function(){},"AdVideoThirdQuartile");_tcp._flow.ad.vpaid.vp.subscribe(function(){_play.tools.log("VPAID VIDEO COMPLETED","HALCYON")},"AdVideoComplete")}_tcp._flow.ad.vpaid.vp.subscribe(function(m){_tcp._flow.ad.ping("error");_play.tools.log("VPAID AD ERROR: "+m,"HALCYON");_tcp._flow.ad.vpaid.remove(true);_tcp._data.emitNotification(_play.config.events.AD_ERROR);_tcp._data.emitEvent(_samaritan.events.AD_ERROR,
{reason:"error",mode:"vpaid",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode})},"AdError");_tcp._flow.ad.vpaid.vp.subscribe(function(){_play.tools.log("VPAID AD CLICKED","HALCYON");_tcp._flow.ad.onClick()},"AdClickThru");_tcp._flow.ad.vpaid.vp.subscribe(function(){_play.tools.log("VPAID AD COMPLETED","HALCYON");window.setTimeout(function(){_tcp._flow.ad.vpaid.remove(false)},250)},"AdStopped");_tcp._flow.ad.vpaid.vp.subscribe(function(){_play.tools.log("VPAID AD SKIPPED","HALCYON");_tcp._flow.ad.ping("skip");
_tcp._flow.ad.vpaid.remove(false)},"AdSkipped");_tcp._flow.ad.vpaid.vp.subscribe(function(){},"AdLinearChange");var vel="nxp_player";if(_tcp._flow.ad.vpaid.vidmode=="video")vel="nxp_adplayer";_tcp._flow.ad.vpaid.vp.initAd(jQuery("#"+vel+_tcp._index).width(),jQuery("#"+vel+_tcp._index).height(),_play.system.environment.isFullscreen?"fullscreen":"normal",800,_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].params,{slot:document.getElementById("nxp_vpaid"+_tcp._index),videoSlotCanAutoPlay:true,videoSlot:document.getElementById(vel+
_tcp._index)})}catch(e){_play.tools.log("VPAID INIT AD FAILURE","HALCYON");_tcp._flow.ad.vpaid.remove(true)}},remove:function(skipReporting){_play.tools.log("REMOVING VPAID","HALCYON");_tcp._ui.hideLoader();delete _tcp._flow.ad.vpaid.vp;_tcp._el.removeClass("nxp_vpaidad");jQuery("#nxp_vpaid"+_tcp._index).remove();jQuery("#adloaderframe"+_tcp._index).remove();if(_tcp._flow.ad.vpaid.j)window.clearInterval(_tcp._flow.ad.vpaid.j);_tcp._flow.ad.onAdDone(skipReporting)},handleResize:function(){_play.tools.log("CHECKING VPAID RESIZE",
"HALCYON");if(_tcp._flow.ad.vpaid.vp){var vel="nxp_player";if(_tcp._flow.ad.vpaid.vidmode=="video")vel="nxp_adplayer";_tcp._flow.ad.vpaid.vp.resizeAd(jQuery("#"+vel+_tcp._index).width(),jQuery("#"+vel+_tcp._index).height(),_play.system.environment.isFullscreen?"fullscreen":"normal")}}}},handleBumperClick:function(){var d=_tcp._data.getMedia("targetURL");if(!_tcp._bumperPaused){if(d&&d!=""){_tcp._bumperPaused=true;_tcp._ia.interact("pause");_tcp._data.emitEvent(_samaritan.events.CLICK,{},_tcp._data.getMedia("ID"),
"bumper");_play.tools.openWindow(d)}}else{_tcp._bumperPaused=false;_tcp._ia.interact("play")}},pay:{refid:"",checkPayState:function(){_play.tools.log("VERIFYING PAYMENT","HALCYON");_tcp._ui.showLoader();_tcp._useAdFallback=false;var ep="/payment/itemstate";var pa={item:_tcp._data.getMediaReal("ID"),streamtype:_tcp._streamtype,performTransactionIfPossible:1};if(_tcp._config.paymentReference!=""){ep+="anonymous";pa.reference=_tcp._config.paymentReference;_tcp._config.paymentReference=""}_play.system.connection.callAPI(ep,
pa).then(function(data){_tcp._ui.hideLoader();if(data)if(_play.tools.parseInt(data.itemstate.status)==1){if(data.itemstate.method=="ppm"){_tcp._payReason="ppm";_tcp._usePPM=true;_tcp._flow.pay.refid=data.itemstate.reference.toString()}if(data.itemstate.reason=="adfallback"&&_tcp._useAds&&_tcp._admodel.provider!=""){_play.tools.log("ENABLING ADFALLBACK","HALCYON");_tcp._payReason="adfallback";_tcp._useAdFallback=true}else if(data.itemstate.reason=="preview"){_play.tools.log("ENABLING ADFALLBACK","HALCYON");
if(_tcp._admodel.provider!=""&&_tcp._useAds)_tcp._useAdFallback=true;_tcp._payReason="preview";_tcp._usePreview=true;_tcp._autofullscreen=0;_tcp._config.delay=0;_tcp._previewDuration=_play.tools.parseInt(_play.config.client.payPreviewSeconds);if(_play.tools.parseInt(_tcp._data.getMedia("payPreviewSeconds","streamdata"))>0)_tcp._previewDuration=_play.tools.parseInt(_tcp._data.getMedia("payPreviewSeconds","streamdata"));_tcp._usesForcedTemplate=true;_tcp._el.addClass("skin_forced")}else{_play.tools.log("PAYMENT VALID",
"HALCYON");_tcp._payReason=data.itemstate.reason}if(!_tcp._useAdFallback&&!_tcp._usePreview)_tcp._userHasPay=1;_tcp._ui.hideLoader();_tcp._ui.build()}else _tcp._flow.onError("pay");else{_play.tools.log("NO PAYMENT FOUND","HALCYON");_tcp._flow.onError("json","checkpaystate")}})["catch"](function(e){_tcp._flow.onError("json","checkpaystate")})},checkPPMUpdate:function(){_play.tools.log("UPDATEING PPM","HALCYON");_play.system.connection.callAPI("/payment/updatetransaction",{transactionID:_tcp._flow.pay.refid,
item:_tcp._data.getMediaReal("ID"),streamtype:_tcp._streamtype}).then(function(e){if(e&&e.itemupdate){if(_play.tools.parseInt(e.itemupdate.validuntil)>0)_tcp._stream.events.ppmcounter=0}else _tcp._flow.onError("json","checkppmupdate")})["catch"](function(e){_tcp._flow.onError("json","checkppmupdate")})},checkAfterPreview:function(){_play.tools.log("VERIFYING PAYMENT","HALCYON");_tcp._ui.showLoader();_play.system.connection.callAPI("/payment/itemstate",{item:_tcp._data.getMediaReal("ID"),streamtype:_tcp._streamtype,
performTransactionIfPossible:1}).then(function(data){_tcp._ui.hideLoader();if(data)if(_play.tools.parseInt(data.itemstate.status)==1)if(["adfallback","preview"].indexOf(data.method)==-1){_play.tools.log("PAYMENT VALID","HALCYON");_tcp._payReason=data.itemstate.reason;_tcp._userHasPay=1;_tcp._useAdFallback=false;_tcp._usePreview=false;_tcp._useAds=false;_tcp._useBanners=false;_tcp._useMidRolls=false;_tcp._previewPaused=false;_tcp._previewDuration=0;_tcp._usesForcedTemplate=false;if(_play.system.isIOS()){_tcp._menu.find("div[data-command='fullscreen']").show();
_tcp._el.find(".nxp_menubar").removeAttr("style")}_tcp._el.removeClass("skin_forced");_tcp._ui.addLayout();_tcp._ui.visualresponse.removeAll();_tcp._ui.sidebar.build();_tcp._ui.menu.build();_tcp._menu.find(".nxp_totaltimedisplay").html(_play._factory.tools.formatTime(_tcp._stream.dur,_tcp._stream.useHours));_tcp._ui.onResize();_tcp._ia.interact("play")}})["catch"](function(e){})}},revolver:{index:0,chosenIndex:0,inited:false,items:null,prepare:function(){_play.tools.log("GETTING EXIT DATA","HALCYON");
_tcp._flow.revolver.inited=true;_tcp._stream.seekTarget=0;if(_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC){_tcp._flow.revolver.items=_tcp._data.getMediaObject("suggestiondata");_tcp._flow.revolver.prepareHotSpot()}else{var method=_play.config.client.exitPlayOption;var params={start:0,limit:8,forceResults:1,additionalfields:"slug"};if(_play.tools.parseInt(_tcp._data.getMediaReal("isUGC"))==1)params.includeUGC=1;if(_tcp._data.isEpisode())method="nextinseries/"+_tcp._data.getMediaReal("ID");
else switch(method){case "trending":method="all";params.onlyTrending=1;break;case "reco":if(_play.config.user.id>0){method="userrecommendations";params.item=_tcp._data.getMediaReal("ID")}else method="recommendationsfor/"+_tcp._data.getMediaReal("ID");break;case "similar":method="similarsfor/"+_tcp._data.getMediaReal("ID");break}_play.system.connection.callAPI("/videos/"+method,params).then(function(data){if(data){_tcp._flow.revolver.items=data;_tcp._flow.revolver.prepareHotSpot()}})["catch"](function(e){})}},
prepareHotSpot:function(){_play.tools.log("PREPARING EXIT HOTSPOT","HALCYON");if(_tcp._flow.revolver.items&&_tcp._flow.revolver.items.length&&_tcp._flow.revolver.items.length>0){_tcp._flow.revolver.chosenIndex=0;_tcp._flow.revolver.index=0;for(var u=0;u<_tcp._flow.revolver.items.length;u++)if(!_play.system.device.history.hasPlayed(_tcp._flow.revolver.items[u]["general"]["ID"])){_play.tools.log("SELECTING ITEM "+_tcp._flow.revolver.items[u]["general"]["ID"]+" FOR REVOLVER","HALCYON");_tcp._flow.revolver.chosenIndex=
u;_tcp._flow.revolver.index=u;break}else _play.tools.log("SKIPPING ITEM "+_tcp._flow.revolver.items[u]["general"]["ID"]+" FOR REVOLVER, ALREADY SEEN","HALCYON");if(_tcp._useRevolver&&_tcp._ui.exitdisplay.willRevolver()&&_play.tools.parseInt(_play.config.client.exitdisplaypreload)>0){var n={general:{ID:-2,isAuto:1,type:"exit",autopos:1,validfrom:_tcp._stream.dur-1-_play.tools.parseInt(_play.config.client.exitdisplaypreload),validto:_tcp._stream.dur,showthumb:1,posx:0,posy:0,text:_play.tools.getClientText("comingup")+
" <b>"+_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["general"]["title"]+"</b>",textadd:"",linkparam:_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["general"]["ID"]},imagedata:{thumb:_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb"],thumb_alt:_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb_alt"]}};if(!_tcp._useSpots){_tcp._useSpots=true;_tcp._ui.addons.spots.init()}if(!_tcp._ui.addons.spots.spots)_tcp._ui.addons.spots.spots=
[];_tcp._ui.addons.spots.spots.push(n)}}},andGo:function(){_tcp._ui.exitdisplay.killTimer();if(_tcp._flow.revolver.items){_play.tools.log("HANDLING REVOLVER EXIT MODE: "+_tcp._exitmode,"HALCYON");_tcp._area.find(".nxp_exit").fadeOut(300,function(){jQuery(this).remove()});if(_tcp._exitmode=="load"){if(_play.system.environment.isCasted)_play.addons.cast.receiver.sentSwap=true;_tcp._playparam=_tcp._flow.revolver.items[_tcp._flow.revolver.index]["general"]["ID"];_tcp._playpos=0;_tcp._flow.prepareSwap()}else{var id=
_tcp._flow.revolver.items[_tcp._flow.revolver.index]["general"][_play.config.client.linkItem];var linkt=_tcp._mime=="audio"?"sharelinktemplateaudio":"sharelinktemplate";if(_tcp._live)linkt="sharelinktemplatelive";linkt=_play.config.client[linkt];if(_tcp._flow.revolver.items[_tcp._flow.revolver.index]["general"].hasOwnProperty("belongsToSeries")){var s=_tcp._flow.revolver.items[_tcp._flow.revolver.index]["seriesIndex"].replace("S","").split("E");id=_tcp._flow.revolver.items[_tcp._flow.revolver.index]["belongsToSeries"]+
"/season-"+_play.tools.parseInt(s[0])+"/episode-"+_play.tools.parseInt(s[1]);linkt=linkt.replace("videos","series")}if(_play.system.environment.isONE)if(_tcp._flow.revolver.items[_tcp._flow.revolver.index].hasOwnProperty("belongsToSeries"))_one.actions.navigateToVideoWithContext("series",id,"series/"+id,_tcp._playedVia);else{var a=linkt.split("/");a.pop();_one.actions.navigateToVideoWithContext(a[a.length-1],id,a[a.length-1]+"/"+id,_tcp._playedVia)}else document.location.href=linkt+id+"?nxp_sbpc="+
_tcp._playedVia}}else window.setTimeout(function(){_tcp._flow.revolver.andGo()},1E3)}},onError:function(m,d,sr){_tcp._data.reportError(m,d);if(_play.system.environment.isApp)if(_app.config.hasPhysicalPlayer)_play._factory.ui.renderError(_tcp._div,m,_tcp._streamtype);else{_app["native"].screen.fullscreen.exit();if(_play.system.environment.isONE){_one.actions.notify(_play.tools.getClientText("error_"+m),_client.constants.alerticon);_one.actions.error()}}else _play._factory.ui.renderError(_tcp._div,
m,_tcp._streamtype)},onEnterLinkedVideo:function(id){_tcp._playedVia="spot";_tcp._playparam=id;_tcp._playpos=0;_tcp._flow.prepareSwap();_tcp._flow.prevVideo=_tcp._data.getMedia("ID");_tcp._flow.prevDelay=_tcp._stream.getCurrentTime()},onPlaylistData:function(){_play.tools.log("PLAYLIST IS READY","HALCYON");_tcp._ui.hideLoader();_tcp._ui.addons.captions.hide();_play._factory.ui.tooltip.hide();_tcp._isRebuild=false;_tcp._tokenUpdateNeeded=false;_tcp._flow.ended=false;_tcp._usePreview=false;_tcp._previewPaused=
false;_tcp._useAdFallback=false;_tcp._isPanorama=false;_tcp._stream.isBuffering=false;_tcp._stream.seekTarget=0;_tcp._stream.autoPauseTarget=0;_tcp._flow.prevVideo=0;_tcp._flow.prevDelay=0;_tcp._userHasPay=0;_tcp._payReason="";_tcp._playingAd=false;_tcp._flow.ad.reportedStart=false;_tcp._overlay.find(".nxp_caption").remove();_tcp._menu.find(".nxp_suggestions").remove();_tcp._area.find(".nxp_exit").fadeOut(300,function(){jQuery(this).remove()});if(_tcp._playlist[_tcp._playpos]){_tcp._ui.useThumbs=
_play.tools.parseInt(_tcp._data.getMedia("encodedTHUMBS","streamdata"))==1&&_tcp._mime=="video"&&!_tcp._live;_tcp._stream.events.forceNewMedia();if(_tcp._data.getMedia("videotype")=="bumper"){_play.tools.log("MEDIA IS BUMPER","HALCYON");_tcp._el.addClass("nxp_bumper");_tcp._isBumper=true;_tcp._ui.hide()}else{_tcp._el.removeClass("nxp_bumper");_tcp._isBumper=false}var cancon=true;if(_play.tools.parseInt(_tcp._data.getMedia("isPanorama","features"))==1){_tcp._isPanorama=true;if(_play.system.capabilities.hasWebGL)_play._factory.ui.preparePanorama();
else{_tcp._flow.onError("panoramavideo");cancon=false}}if(_tcp._live&&_play.tools.parseInt(_tcp._data.getMedia("replaceWithVideo","streamdata"))>0){cancon=false;_tcp._live=false;_tcp._dvr=false;_tcp._streamtype="video";_tcp._usesForcedTemplate=false;_tcp._playmode="video";_tcp._playpos=0;_tcp._config.delay=0;_tcp._playedVia="liveexchange";_tcp._config.reportParent="";_tcp._config.reportParentProtocol="";_tcp._playIndex=-1;_tcp._ia.interact("swap",_tcp._data.getMedia("replaceWithVideo","streamdata"))}if(_tcp._live)_tcp._stream.autoPauseTarget=
_tcp._data.getMedia("autoPause","streamdata");if(cancon)if(_play.tools.parseInt(_tcp._data.getMedia("ageok","statusdata"))==0&&!_play.system.environment.isOMNIA)_tcp._flow.onError("fsk");else if(_play.tools.parseInt(_tcp._data.getMedia("commok","statusdata"))==0&&!_play.system.environment.isOMNIA)_tcp._flow.onError("community");else if(_play.tools.parseInt(_tcp._data.getMedia("devok","statusdata"))==0&&!_play.system.environment.isOMNIA)_tcp._flow.onError("device");else if(_play.tools.parseInt(_tcp._data.getMedia("geook",
"statusdata"))==0&&!_play.system.environment.isOMNIA)_tcp._flow.onError("geo");else if(_play.tools.parseInt(_tcp._data.getMedia("embedok","statusdata"))==0&&_play.system.environment.isEmbedded)_tcp._flow.onError("embed");else if(_play.tools.parseInt(_tcp._data.getMedia("isPanorama","features"))==1&&!_play.system.capabilities.hasWebGL)_tcp._flow.onError("panorama");else{if(_tcp._config.dataMode=="static"){cancon=false;_play.tools.log("CHECKING DOMAIN RESTRICTION","HALCYON");var r=_tcp._data.getMediaObject("connectordata");
if(r)jQuery.each(r,function(i,j){if(i==_play.config.client.id)switch(j){case "own":if(i==_tcp._data.getMedia("originalDomain","streamdata"))cancon=true;break;default:cancon=true;break}});if(cancon){_play.tools.log("CHECKING GATEWAY RESTRICTION","HALCYON");cancon=false;r=_tcp._data.getMediaObject("gatewaydata");if(r){var p="desktop";if(_play.system.isMobile())p="mobile";else if(_play.system.isTV())p="tv";if(r.hasOwnProperty(p)){var t=_play.session.getTime();if(_play.tools.parseInt(r[p].ready)==2)if(_play.tools.parseInt(r[p].from)<=
t)if(_play.tools.parseInt(r[p].until)==0||_play.tools.parseInt(r[p].until)>t)cancon=true}}}}if(cancon){_tcp._useRevolver=_tcp._playmode=="video"&&_play.tools.parseInt(_tcp._autonext)==1;_play.tools.log((_tcp._useRevolver?"EN":"DIS")+"ABLING REVOLVERPLAY","HALCYON");if(_tcp._useAds&&_tcp._playmode!="live"&&_tcp._admodel.vast_mid&&_tcp._admodel.vast_mid!=""){_tcp._useMidRolls=true;_tcp._flow.ad.midrollTarget=_tcp._admodel.vast_mid_interval*60;_play.tools.log("ENABLING MIDROLLS AT INTERVAL: "+_tcp._flow.ad.midrollTarget,
"HALCYON")}else{_play.tools.log("DISABLING MIDROLLS","HALCYON");_tcp._useMidRolls=false}if(_tcp._useAds&&_tcp._useFullPlayer&&!_play.system.environment.isOMNIA&&_tcp._width>=_play.config.constants.BANNER_MIN_WIDTH&&_tcp._admodel.vast_banner&&_tcp._admodel.vast_banner!=""){_tcp._flow.ad.bannerTarget=_tcp._admodel.vast_banner_interval*60+15;_tcp._useBanners=true;_play.tools.log("ENABLING BANNERS","HALCYON")}else{_play.tools.log("DISABLING BANNERS","HALCYON");_tcp._useBanners=false}_tcp._data.emitNotification(_play.config.events.METADATA);
if(_tcp._isCasting)_play.addons.cast.sender.initMedia();if(_play.tools.parseInt(_tcp._data.getMedia("isPay"))>0&&!_play.system.environment.isOMNIA)_tcp._flow.pay.checkPayState();else{_tcp._ui.hideLoader();_tcp._ui.build()}}else _tcp._flow.onError("fraud")}}else _tcp._flow.onError("noplaylist")},onMediaReady:function(){_tcp._usePPM=false;_tcp._hasMBR=false;_tcp._ended=false;_tcp._waitForLive=false;_tcp._ui.addons.captions.automaticOn=["always","selectandstart"].indexOf(_tcp._captionMode)>-1;if(_tcp._playlist){_tcp._el.removeClass("nxp_startmode");
_tcp._data.emitNotification(_play.config.events.START_PLAYBACK)}_play.tools.log("MEDIA IS READY","HALCYON");_tcp._el.removeClass("nxp_startmode");_tcp._el.find(".nxp_audioholder,.nxp_spots,.nxp_sociallayer").remove();if(_tcp._useFullPlayer)_tcp._ui.visualresponse.removeAll();_tcp._el.removeClass("nxp_audiocast");if(_tcp._mime=="audio"&&_play.system.environment.isCasted)_tcp._el.addClass("nxp_audiocast");if(_tcp._mime=="image")_tcp._ui.panorama.build();else{if(_play.system.environment.isApp&&!_app.config.useAppPlayer){_play.tools.log("APP SCREEN TIMEOUT DISABLED",
"HALCYON");_app["native"].screen.timeout.disable()}var cm=_tcp._willUseSHAKA;var cc=true;if(_tcp._mime=="audio")_tcp._willUseSHAKA=_tcp._useVideoAudio;else if(_tcp._playmode=="variant"||!_play.system.capabilities.hasMP4){_tcp._willUseSHAKA=false;_play.tools.log("STREAMTYPE DOES NOT OFFER MBR","HALCYON")}else if(typeof shaka=="object"&&_play.system.capabilities.hasDASH)if(_tcp._live&&!_play.system.isMobile())_tcp._willUseSHAKA=true;else if(_play.system.capabilities.hasMP4)_tcp._willUseSHAKA=true;else{_tcp._willUseSHAKA=
false;if(_play.tools.parseInt(_tcp._data.getMedia("encodedWEBM"))==0&&_play.tools.parseInt(_tcp._data.getMedia("encodedVP9"))==0)cc=false}else _play.tools.log("NO SHAKA OBJECT FOUND","HALCYON");if(_tcp._willUseSHAKA&&_tcp._data.getMedia("cdnType","streamdata")=="free"&&_tcp._data.getMedia("cdnPathDASH",_tcp._useVideoAudio?"videoStreamdata":"streamdata")==""&&_tcp._shakaProtocol=="dash"){_tcp._willUseSHAKA=false;_play.tools.log("CDN DOES NOT OFFER DASH","HALCYON");if(_tcp._live)cc=false}if(_tcp._willUseSHAKA&&
(_play.system.isMobile()||_play.system.capabilities.hasMutedAutoPlay))if(_tcp._useAds&&_tcp._admodel.type.indexOf("ima")==-1){_tcp._willUseSHAKA=false;_play.tools.log("STACKED PLAYERS NOT SUPPORTED","HALCYON")}if(_tcp._willUseSHAKA&&_tcp._useAds&&_play.system.environment.isCasted){_tcp._willUseSHAKA=false;_play.tools.log("STACKED PLAYERS ON CHROMECAST NOT SUPPORTED","HALCYON");_play.addons.cast.receiver.sendMessage("skipshaka")}if(_tcp._willUseSHAKA&&_play.system.isTV()&&!_play.system.environment.isCasted){_tcp._willUseSHAKA=
false;_play.tools.log("STACKED PLAYERS ON TV NOT SUPPORTED","HALCYON")}_play.tools.log((_tcp._willUseSHAKA?"WILL USE":"DISABLING")+" SHAKA / "+_tcp._shakaProtocol.toUpperCase(),"HALCYON");if(cc){if(cm&&!_tcp._willUseSHAKA)_tcp._stream.cleanDASH();if(_tcp._mime=="audio")_tcp._ui.audiodisplay.build();if(_tcp._data.getMediaObject("hotspotdata")&&_tcp._data.getMediaObject("hotspotdata").length&&_tcp._data.getMediaObject("hotspotdata").length>0){_tcp._useSpots=true;_tcp._ui.addons.spots.init()}else _tcp._useSpots=
false;if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendMessage("loaded");_tcp._stream.build()}else _tcp._flow.onError("flash")}},onEnded:function(fromAd){_tcp._config.delay=0;_tcp._stream.seekTarget=0;_tcp._flow.ended=true;_tcp._ui.hideLoader();_tcp._ui.addons.tap.remove();_tcp._ui.addons.captions.hide();_tcp._flow.ad.removeBanners();if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,"IDLE");if(_play.system.environment.isApp&&_app["native"].media.systemMedia.isAvailable)_app["native"].media.systemMedia.updatePlayState(_play.config.events.ENDED);
if(!_tcp._useAds||fromAd)if(_tcp._flow.hasNext()){_tcp._flow.next();if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendMessage("next")}else if(_play.system.environment.isPIP){_tcp._ui.visualresponse.addStatic("restart");_tcp._ui.afterPlay()}else if(_tcp._flow.revolver.inited)if(_tcp._flow.revolver.items&&_tcp._flow.revolver.items.length&&_tcp._flow.revolver.items.length>1){_tcp._ui.afterPlay();_tcp._ui.exitdisplay.revolverCanceled=!_tcp._ui.exitdisplay.willRevolver();_tcp._ui.exitdisplay.build()}else{_tcp._ui.visualresponse.addStatic("restart");
_tcp._ui.afterPlay()}else if(_tcp._exitmode=="playlist"){if(_play.system.environment.isFullscreen)_play.system.fullscreen.exit();_tcp._ui.afterPlay()}else if(_tcp._exitmode=="loop"){_tcp._playedVia="loop";_tcp._data.emitNotification(_play.config.events.REPLAY,{byUserAction:0});_tcp._flow.next(true)}else{if(!_tcp._useMicroPlayer)_tcp._ui.visualresponse.addStatic("restart");_tcp._ui.afterPlay()}else if(!_tcp._useRevolver&&_tcp._playmode!="live")if(_tcp._flow.hasNext())_tcp._flow.next();else if(_tcp._flow.ad.allowPost)_tcp._flow.ad.load("post");
else{_play.tools.log("POSTROLL FORBIDDEN","HALCYON");_tcp._flow.onEnded(true)}else _tcp._flow.onEnded(true)},prepareSwap:function(isRetry){if(_play.system.environment.isCasted&&_play.addons.cast.receiver.sentSwap){_play.addons.cast.receiver.sendMessage("changeplay",{vid:_tcp._playparam,playmode:_tcp._playmode,delay:0});_play.addons.cast.receiver.sentSwap=false}else{if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("changeplay",{vid:_tcp._playparam,playmode:_tcp._playmode,delay:0});_play._factory.data.getMedia(_tcp._playparam,
_tcp._playmode,_tcp._config.dataMode).then(function(d){_tcp._isPseudoLive=false;var t=[];var cc=false;if(d){cc=true;if(d.itemdata){t=d.itemdata;if(d.streamdata)if(d.streamdata.playtype)if(d.streamdata.playtype=="live"){_play.tools.log("ENABLING PSEUDO LIVE","HALCYON");_tcp._isPseudoLive=true;_tcp._playpos=d.streamdata.startWithItem;_tcp._config.delay=d.streamdata.startWithDelay;_tcp._exitmode="loop";_tcp._masked=true}if(d.statusdata)if(d.statusdata.hasOwnProperty("embedok"))if(_play.tools.parseInt(d.statusdata.embedok)==
0&&_play.system.environment.isEmbedded){cc=false;_tcp._flow.onError("embed")}}else if(!Array.isArray(d)){if(d.general&&d.general.ID)t.push(d)}else{t=d;if(!t[0]){t=[];cc=false}}}if(cc)if(t&&t.length&&t.length>0){_play.tools.log("PLAYLIST DATA OK","HALCYON");_tcp._playlist=t;if(_tcp._config.bumperMode==0){_play.tools.log("REMOVING BUMPER VIDEOS","HALCYON");t=[];_tcp._playlist.forEach(function(i){if(!i.general||!i.general.videotype||i.general.videotype!="bumper")t.push(i)});_tcp._playlist=t}_tcp._originalplaylist=
t;if(t.length==1&&t[0]["statusdata"]["shouldBeCached"]==1&&(!t[0]["protectiondata"]||t[0]["protectiondata"]["method"]==""))_play.system.cache.set("mediadata_"+_tcp._playparam+"_"+_tcp._playmode,JSON.stringify(d));else _play.tools.log("DONT CACHE MEDIA","HALCYON");if(_tcp._playmode=="live"&&typeof shaka=="undefined"&&!_play.system.capabilities.hasHLS&&_play.system.capabilities.hasDASH)_play.tools.addScript("libs/shaka"+(_play.config.client.useLiveTransmux==1?"-mux":"")+".js",true).then(function(){_tcp._flow.onPlaylistData()});
else if(_tcp._playmode=="live"&&!_play.system.capabilities.hasHLS&&_play.config.client.useLiveTransmux==0&&_tcp._playlist[0]["streamdata"]["cdnType"]=="free"&&_tcp._playlist[0]["streamdata"]["cdnPathDASH"]=="")_play.tools.addScript("libs/mux.js",true).then(function(){_tcp._shakaProtocol="hls";_tcp._flow.onPlaylistData()});else _tcp._flow.onPlaylistData()}else _tcp._flow.onError("noplaylist");else if(isRetry||_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)_tcp._flow.onError("json");
else _play._factory.data.checkSession().then(function(){_tcp._flow.prepareSwap(true)})})["catch"](function(e){if(_play.session.isDebug)console.log(e);if(isRetry||_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)_tcp._flow.onError("json");else _play._factory.data.checkSession().then(function(){_tcp._flow.prepareSwap(true)})})}},internalSwap:function(){_tcp._flow.onPlaylistData()},hasNext:function(){var t=false;if(_tcp._playlist.length>1)if(_tcp._playpos<_tcp._playlist.length-1)t=true;
return t},next:function(byLoop){if(!_tcp._isBumper){_tcp._playedVia="next";if(byLoop)_tcp._playedVia="loop"}_tcp._playpos++;if(_tcp._playpos>=_tcp._playlist.length)_tcp._playpos=0;_tcp._flow.internalSwap()},prev:function(){_tcp._playpos--;if(_tcp._playpos<0)_tcp._playpos=_tcp._playlist.length-1;_tcp._playedVia="next";_tcp._flow.internalSwap()},updatePlayPos:function(id){for(var u=0;u<_tcp._playlist.length;u++)if(_tcp._playlist[u]["ID"]==id){_play.tools.log("CURRENT PLAYPOS: "+u,"HALCYON");_tcp._playpos=
u;break}}},_stream:{m:null,tmr:null,dur:0,startPos:0,seekTarget:0,autoPauseTarget:0,useHours:false,isBuffering:false,playPromise:null,playPromiseError:null,castedTime:0,clean:function(){_play.tools.log("CLEANING STREAM DATA","HALCYON");if(_tcp._stream.tmr){window.clearInterval(_tcp._stream.tmr);_tcp._stream.tmr=null}if(_tcp._stream.m){_tcp._stream.events.remove();_tcp._stream.m=null}_tcp._stream.cleanDASH()},cleanDASH:function(){if(_tcp._dashobj)_tcp._dashobj.unload().then(function(){_tcp._dashobj.destroy().then(function(r){_play.tools.log("DASH OBJECT DESTROYED SUCCESSFULLY",
"HALCYON");_tcp._dashobj=null})["catch"](function(e){_play.tools.log("DASH OBJECT DESTROYED WITH ERRORS","HALCYON");_tcp._dashobj=null})})["catch"](function(){_tcp._dashobj.destroy().then(function(){_play.tools.log("DASH OBJECT DESTROYED WITH UNLOAD ERRORS","HALCYON");_tcp._dashobj=null})["catch"](function(){_play.tools.log("DASH OBJECT DESTROYED WITH UNLOAD AND DESTROY ERRORS","HALCYON");_tcp._dashobj=null})})},build:function(){_play.tools.log("BUILDING STREAM","HALCYON");if(_tcp._useFullPlayer&&
!_play.system.environment.isCasted&&!_play.system.isTV()){_tcp._ui.showLoader();window.setTimeout(function(){_tcp._ui.sidebar.build();_tcp._ui.updateTooltips()},500)}_tcp._ui.menu.handleMode();_tcp._stream.m=document.getElementById("nxp_player"+_tcp._index);if(!_play.system.environment.isApp||!_app.config.useAppPlayer)if(_tcp._stream.m){_tcp._stream.m.volume=_tcp._lastVolume;_tcp._stream.events.init();var so=_tcp._streamtype;var mo=_tcp._data.getMediaObject("streamdata");var vid=_tcp._data.getMedia("ID");
var hash=_tcp._data.getMedia("hash");var otherID=0;if(_tcp._streamtype=="audio"&&_tcp._useVideoAudio){mo=_tcp._data.getMediaObject("videoStreamdata");so="videoaudio";vid=_tcp._data.getMedia("videoID","videoStreamdata");hash=_tcp._data.getMedia("videoHash","videoStreamdata")}if(_tcp._playmode=="scene"){otherID=vid;hash=_tcp._data.getMedia("parentHash");vid=_tcp._data.getMedia("parentID")}var sd=_play._factory.stream.getMediaURL(vid,otherID,hash,so,mo,_tcp._config.streamingFilter,_tcp._data.isDRM(),
_play.system.environment.isFullscreen||_tcp._width>=_play.config.constants.THRESHOLD_HQ,_tcp._willUseSHAKA,_tcp._data.getMedia("fileversion"),_tcp._data.isTokenized()?{ref:_tcp._data.getProtection("tokenReference",false),hls:_tcp._data.getProtection("tokenHLS",false),dash:_tcp._data.getProtection("tokenDASH",false)}:null,_tcp._forceCodec,_tcp._forceProtocol==""?_tcp._shakaProtocol=="dash"?"":"hls":_tcp._forceProtocol);_tcp._data.currenturl=sd[0];_tcp._protocol=sd[1];_tcp._codec=sd[2];if(_tcp._protocol==
"http"&&!_tcp._data.canUseHTTP())_tcp._flow.onError("novalidstream");else if(_tcp._data.isDRM()&&!_play.system.capabilities.hasDRM)_tcp._flow.onError("novalidstream");else{if(_play.system.environment.isApp&&!_app.config.useAppPlayer)if(_tcp._data.isDRM()){_play.tools.log("DISABLING SCREEN CAPTURE","HALCYON");_app["native"].screen.capture.disable()}else{_play.tools.log("ENABLING SCREEN CAPTURE","HALCYON");_app["native"].screen.capture.enable()}if(_tcp._protocol=="http"||!_tcp._willUseSHAKA){_tcp._stream.m.setAttribute("src",
sd[0]);if(_tcp._useAutoMediaLoad){_tcp._stream.m.load();_tcp._stream.simplePlay()}else{_tcp._el.find(".nxp_icon-pause").removeClass("nxp_icon-pause").addClass("nxp_icon-play").attr("data-command","play").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_play"));_tcp._ui.updateTooltips()}}else _tcp._stream.buildDASH(sd[0])}}else{_play.tools.log("STREAM NOT FOUND","HALCYON");_tcp._flow.onError(_tcp._live?"nolive":"notfound",_tcp._data.getCurrentURL())}},buildDASHConfig:function(){var conf=
{preferredAudioLanguage:_play.config.client.language,abr:{enabled:_tcp._mime=="video"},streaming:{failureCallback:function(e){if(_tcp._live&&_tcp._online)_tcp._dashobj.retryStreaming()}}};if(_tcp._data.isDRM()){_play.tools.log("DRM DETECTED","HALCYON");conf.drm={servers:{"com.widevine.alpha":"https://"+_tcp._data.getProtection("server")+"/Widevine/?KID="+_tcp._data.getProtection("key")}};if(!_play.system.environment.isCasted)conf.drm.servers["com.microsoft.playready"]="https://"+_tcp._data.getProtection("server")+
"/PlayReady/"}_play.tools.log("CONFIGURING SHAKA WITH "+JSON.stringify(conf),"HALCYON");return conf},buildDASH:function(sd){if(!_tcp._dashobj){if(!_tcp._shakaInstalled){_play.tools.log("INSTALL SHAKA POLYFILLS","HALCYON");shaka.polyfill.installAll();_tcp._shakaInstalled=true}if(shaka.log)shaka.log.setLevel(shaka.log.Level.DEBUG);_play.tools.log("STARTING SHAKA "+shaka.Player.version,"HALCYON");_tcp._dashobj=new shaka.Player(document.querySelector("#nxp_player"+_tcp._index));_tcp._dashobj.getNetworkingEngine().registerRequestFilter(function(type,
request){if(type==shaka.net.NetworkingEngine.RequestType.LICENSE)request.headers["Authorization"]="Bearer "+_tcp._data.getProtection("token")});_tcp._dashobj.addEventListener("error",function(e){_tcp._stream.events.listen({type:"dasherror"})});_tcp._dashobj.addEventListener("adaptation",function(){_tcp._stream.events.listen({type:"adaptation"})});_tcp._dashobj.addEventListener("buffering",function(e){_tcp._stream.events.listen({type:e.buffering?"waiting":"ratechange"})});if(!_tcp._initiallyMuted)_tcp._stream.simplePlay()}else _tcp._dashobj.resetConfiguration();
_tcp._stream.multiAudio.checked=false;_tcp._stream.metrics.lastQuality=_play.session.getTime();_tcp._stream.metrics.lastReportedQuality="";_tcp._stream.metrics.history={};_tcp._dashobj.configure(_tcp._stream.buildDASHConfig());_tcp._dashurl=sd;if(_tcp._useAutoMediaLoad)_tcp._stream.startDASH();else{_tcp._el.find(".nxp_icon-pause").removeClass("nxp_icon-pause").addClass("nxp_icon-play").attr("data-command","play").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_play"));
_tcp._ui.updateTooltips()}},startDASH:function(){_play.tools.log("STARTING SHAKA STREAM","HALCYON");_tcp._useAutoMediaLoad=true;_tcp._dashobj.load(_tcp._dashurl).then(function(){_tcp._stream.changeStream()})["catch"](function(){if(_tcp._dashobj)_tcp._stream.events.listen({type:"dasherror"})})},startChangeStream:function(i){if(_tcp._willUseSHAKA){jQuery(".nxp_listitem.nxp_activeitem").removeClass("nxp_activeitem");jQuery(".nxp_listitem[data-index='"+i+"']").addClass("nxp_activeitem");jQuery(".nxp_listitem .nxp_icon-checked").remove();
jQuery(".nxp_listitem[data-index='"+i+"']").append("<div class='nxp_icon-checked'></div>");_tcp._desiredQuality=i;if(_play.system.capabilities.hasStorage)_play.system.storage.set("nxp_desiredquality",i);if(!_tcp._isCasting){if(i!=-1)_tcp._stream.changeStream(i,true);else _tcp._stream.changeStream();_tcp._ui.showLoader()}_tcp._ui.addons.layer.remove()}},changeStream:function(ct,disableMBR){if(!ct){_play.tools.log("AUTOSELECT STREAM","HALCYON");if(_play.tools.parseInt(_tcp._desiredQuality)==-1)ct=_play._factory.stream.getInitialBitrate(_play.system.environment.isFullscreen||
_tcp._width>=_play.config.constants.THRESHOLD_HQ);else{ct=_play.tools.parseInt(_tcp._desiredQuality);disableMBR=true}}var t=[];var sq=-1;var cb=0;var a=[];_tcp._dashobj.getVariantTracks().forEach(function(j){if(j.mimeType.indexOf("video")==0){var bw=j.bandwidth/1E3;t.push(j);a.push(_play._factory.tools.translateVideoQuality(j.height,bw)[0]);if(!disableMBR){if(bw<=ct&&bw>cb){cb=bw;sq=t.length-1}}else if(j.id==ct)sq=t.length-1}});_play.tools.log("FOUND STREAMS: "+a.join(", "),"HALCYON");if(t.length>
2&&_play.tools.parseInt(_play.config.client.allowstreamindex)==1&&!_play.system.environment.isCasted){_tcp._hasMBR=true;_tcp._menu.find("div[data-command='streamsettings']").show()}else{_tcp._hasMBR=false;_tcp._menu.find("div[data-command='streamsettings']").hide()}if(sq>-1){var tar=t[sq];_play.tools.log("CHANGING STREAM TO "+_play._factory.tools.translateVideoQuality(tar.height,tar.bandwidth/1E3),"HALCYON");var c=_tcp._dashobj.getConfiguration();c.abr.enabled=false;_tcp._dashobj.configure(c);_tcp._dashobj.selectVariantTrack(tar,
true);if(!disableMBR){c=_tcp._dashobj.getConfiguration();c.abr.enabled=true;_tcp._dashobj.configure(c)}}_tcp._stream.simplePlay();_tcp._stream.multiAudio.check()},isRunning:function(){return _tcp._stream.m&&_tcp._stream.m.currentTime>.1&&!_tcp._stream.m.paused},getCurrentTime:function(andReturnAd,returnLastTimeIfAd){var t=0;if(_tcp._stream.m&&(!_tcp._playingAd||andReturnAd))t=_tcp._stream.m.currentTime;if(_tcp._playingAd&&returnLastTimeIfAd)if(_tcp._willUseSHAKA)t=_tcp._stream.m.currentTime;else t=
_tcp._flow.ad.mediaPos;return t},updateCurrentTime:function(sp,forceBar){if(_tcp._dvr&&_tcp._dashobj)_tcp._stream.dur=(_play.session.getTime(true)-_tcp._dashobj.getPresentationStartTimeAsDate().getTime())/1E3;if(!_tcp._ui.isDragging||forceBar){_tcp._menu.find(".nxp_currenttime").html(_play._factory.tools.formatTime(sp,_tcp._stream.useHours));if(_tcp._stream.dur){if(_tcp._totalTimeMode=="remaining")_tcp._menu.find(".nxp_totaltimedisplay").html(_play._factory.tools.formatTime(_tcp._stream.dur-sp,_tcp._stream.useHours));
_tcp._menu.find(".nxp_progressholder .nxp_innerprogress").css({width:sp/_tcp._stream.dur*100+"%"})}}},multiAudio:{langs:[],currentLanguage:"",isAvailable:false,checked:false,check:function(){if(_tcp._willUseSHAKA&&!_tcp._stream.multiAudio.checked)try{_tcp._stream.multiAudio.langs=[];if(_tcp._dashobj.getAudioLanguages().length>1){_tcp._stream.multiAudio.langs=_tcp._dashobj.getAudioLanguages();_tcp._stream.multiAudio.isAvailable=true;jQuery.each(_tcp._dashobj.getVariantTracks(),function(i,j){if(j.active)_tcp._stream.multiAudio.currentLanguage=
j.language});_tcp._menu.find("div[data-command='toggleaudio']").show();_play.tools.log("MULTI AUDIO DETECTED: "+_tcp._stream.multiAudio.langs.join(",")+": "+_tcp._stream.multiAudio.currentLanguage,"HALCYON");_tcp._data.emitEvent(_samaritan.events.AUDIO,{language:_tcp._stream.multiAudio.currentLanguage,type:"auto"})}else{_tcp._stream.multiAudio.isAvailable=false;_tcp._menu.find("div[data-command='toggleaudio']").hide()}_tcp._stream.multiAudio.checked=true}catch(e){}},switchTrack:function(lang){if(_tcp._willUseSHAKA&&
_tcp._stream.multiAudio.isAvailable){_play.tools.log("SWAPPING AUDIO TRACK","HALCYON");_tcp._dashobj.selectAudioLanguage(lang);_tcp._stream.multiAudio.currentLanguage=lang;_tcp._data.emitEvent(_samaritan.events.AUDIO,{language:lang,type:"manual"})}}},metrics:{history:{},currentQuality:0,lastQuality:0,lastReportedQuality:0,update:function(){if(_tcp._willUseSHAKA&&_tcp._dashobj)try{jQuery.each(_tcp._dashobj.getVariantTracks(),function(i,j){if(j.mimeType.indexOf("video")==0)if(j.active){var d=_play._factory.tools.translateVideoQuality(j.height,
j.bandwidth/1E3);_tcp._stream.metrics.currentQuality=d[0];_play.tools.log("CURRENT QUALITY: "+d[0],"HALCYON");_tcp._el.find(".nxp_current").removeClass("nxp_current");_tcp._el.find(".nxp_listitem[data-itemmode='streamindex'][data-index='"+j.id+"']").addClass("nxp_current");if(!_tcp._stream.metrics.history.hasOwnProperty(d[0]))_tcp._stream.metrics.history[d[0]]=0;var nq=_play.session.getTime();_tcp._stream.metrics.history[d[0]]+=nq-_tcp._stream.metrics.lastQuality;_tcp._stream.metrics.lastQuality=
nq}})}catch(e){}},checkQualityReporting:function(){_play.tools.log("CHECKING QUALITY STATUS","HALCYON");var nq=_play.session.getTime();_tcp._stream.metrics.history[_tcp._stream.metrics.currentQuality]+=nq-_tcp._stream.metrics.lastQuality;_tcp._stream.metrics.lastQuality=nq;var mq="";var mi=0;jQuery.each(_tcp._stream.metrics.history,function(i,j){if(j>mi){mi=j;mq=i}});if(mq!=""&&mq!=_tcp._stream.metrics.lastReportedQuality){_tcp._stream.metrics.lastReportedQuality=mq;var tar="auto";if(_tcp._desiredQuality>
-1)_tcp._dashobj.getVariantTracks().forEach(function(j){if(_play.tools.parseInt(j.id)==_play.tools.parseInt(_tcp._desiredQuality))tar=_play._factory.tools.translateVideoQuality(j.height,j.bandwidth/1E3)});_tcp._data.emitEvent(_samaritan.events.QUALITY,{quality:mq,target:tar})}}},events:{waitForLightsOut:false,askedForPreroll:false,elapsedSeconds:0,elapsedMinutes:0,midrollcounter:0,bannercounter:0,lastPos:0,lightsOutSeconds:0,ppmcounter:0,ppmtarget:0,had25:false,had50:false,had75:false,had95:false,
had100:false,hadFS:false,hadCasted:false,hadPIP:false,hadInfo:false,hadLightsout:false,hadPopout:false,hadHeadset:false,ev:["loadstart","progress","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","play","pause","ratechange","resize","volumechange","webkitplaybacktargetavailabilitychanged","webkitcurrentplaybacktargetiswireless","webkitpresentationmodechanged","webkitbeginfullscreen",
"webkitendfullscreen"],init:function(){_tcp._stream.events.ev.forEach(function(j){_tcp._stream.m.addEventListener(j,_tcp._stream.events.listen,false)})},remove:function(){_tcp._stream.events.ev.forEach(function(j){_tcp._stream.m.removeEventListener(j,_tcp._stream.events.listen,false)})},initProcessing:function(){_play.tools.log("INIT VIDEO PROCESSING","HALCYON");_tcp._ui.addons.captions.clean();if(_play.system.capabilities.hasCaptions){var c=_tcp._data.getMediaObject("captiondata");if(c&&c.length>
0)_tcp._ui.addons.captions.init();else _tcp._ui.addons.captions.clean()}_tcp._stream.events.initReporting();if(_tcp._muted)_tcp._stream.mute(true);if(_play.system.environment.isCasted)_tcp._ia.onLeavePlayer();if(!_tcp._initiallyMuted)if(!_tcp._stream.askedForPreroll&&_tcp._useAds){if(_tcp._flow.ad.allowPre)_tcp._flow.ad.load("pre");else _play.tools.log("PREROLL FORBIDDEN","HALCYON");_tcp._stream.askedForPreroll=true}else if(_tcp._useBanners)if(_tcp._flow.ad.allowBanner)_tcp._flow.ad.load("banner");
else _play.tools.log("BANNERS FORBIDDEN","HALCYON");if(_tcp._usePreview)_tcp._ui.addons.notice.build(_play.tools.getClientText("paypreviewhint").replace("{duration}",_play._factory.tools.formatTime(_tcp._previewDuration)),true)},initReporting:function(){if(!_tcp._stream.tmr){_play.tools.log("INIT REPORTING TIMER","HALCYON");_tcp._stream.askedForPreroll=false;_tcp._stream.events.elapsedSeconds=0;_tcp._stream.events.elapsedMinutes=0;_tcp._stream.events.lightsOutSeconds=0;_tcp._stream.events.midrollcounter=
0;_tcp._stream.events.bannercounter=0;_tcp._stream.events.ppmcounter=0;if(_tcp._usePPM)_tcp._stream.events.ppmtarget=_play.tools.parseInt(_play.config.client.payPPM_extend);if(_tcp._isPanorama)_tcp._ui.panorama.build();_tcp._ia.onLeavePlayer();if(_tcp._playIndex==0&&!_tcp._initiallyMuted&&!_play.system.environment.isApp&&_tcp._autofullscreen==1&&_play.system.isIOS()&&_play.system.getIOSVersion()>=10&&_play.system.device.type=="mobile"){_play.tools.log("FORCING FULLSCREEN FOR IOS 10","HALCYON");_play.system.fullscreen.enter(_tcp._el.attr("id"))}_tcp._stream.events.had25=
_tcp._stream.events.had50=_tcp._stream.events.had75=_tcp._stream.events.had95=_tcp._stream.events.had100=false;_tcp._stream.events.hadCasted=false;_tcp._stream.events.hadPIP=false;_tcp._stream.events.hadPopout=false;_tcp._stream.events.hadHeadset=false;_tcp._stream.events.hadLightsout=false;_tcp._stream.events.hadInfo=false;_tcp._stream.events.hadFS=_play.system.environment.isFullscreen;_tcp._data.reportPlay();_tcp._stream.tmr=window.setInterval(function(){_tcp._stream.events.onElapsed()},1E3)}},
forceNewMedia:function(){_play.tools.log("INITING NEW MEDIA","HALCYON");_tcp._data.emitNotification(_play.config.events.CHANGE_MEDIA);_tcp._ui.panorama.destroy();window.clearInterval(_tcp._stream.tmr);_tcp._stream.tmr=null;_tcp._forceCodec="";_tcp._forceProtocol="";_tcp._isCollection=_tcp._playmode=="collection";if(_tcp._isCollection){_tcp._useVideoAudio=true;_tcp._streamtype=_tcp._mime=_tcp._playlist[_tcp._playpos].general.streamtype;if(["live","scene"].indexOf(_tcp._streamtype)>-1)_tcp._mime="video";
else if(_tcp._streamtype=="audio")_tcp._mime="audio"}else{_tcp._mime=_play._factory.tools.getMimetype(_tcp._playmode);_tcp._streamtype=_play._factory.tools.getStreamtype(_tcp._playmode)}_tcp._data.updateAdModel();_tcp._el.removeClass("nxp_stt_video nxp_stt_audio").addClass("nxp_stt_"+_tcp._mime);_tcp._live=["live","radio"].indexOf(_tcp._streamtype)>-1||_tcp._isPseudoLive;_tcp._dvr=_tcp._live&&_play.tools.parseInt(_tcp._data.getMedia("isDVR","streamdata"))==1;_tcp._ui.menu.handleMode();_tcp._el.removeClass("nxp_notitle nxp_fullscreentitle");
if(_play.tools.parseInt(_tcp._titleMode)==0)_tcp._el.addClass("nxp_notitle");else if(_play.tools.parseInt(_tcp._titleMode)==2)_tcp._el.addClass("nxp_notitle nxp_fullscreentitle");_tcp._desiredQuality=-1;_tcp._desiredSpeed=1;_tcp._desiredCaptionLanguage="";var d;if(_tcp._mime=="video"){_tcp._useVideoAudio=false;if(_play.tools.parseInt(_play.config.client.allowstreamindex)==1)if(_play.system.capabilities.hasStorage){d=_play.system.storage.get("nxp_desiredquality");if(!d)_play.system.storage.set("nxp_desiredquality",
-1);else{_play.tools.log("FOUND QUALITY SETTING: "+d,"HALCYON");_tcp._desiredQuality=_play.tools.parseInt(d)}}if(_play.tools.parseInt(_play.config.client.allowtrickplay)==1)if(_play.system.capabilities.hasStorage){d=_play.system.storage.get("nxp_desiredspeed");if(!d)_play.system.storage.set("nxp_desiredspeed",1);else{_play.tools.log("FOUND SPEED SETTING: "+d,"HALCYON");_tcp._desiredSpeed=parseFloat(d)}}}if(_play.system.capabilities.hasStorage){d=_play.system.storage.get("nxp_desiredcaptionlanguage");
if(!d)_play.system.storage.set("nxp_desiredcaptionlanguage","");else{_play.tools.log("FOUND CAPTION LANGUAGE SETTING: "+d,"HALCYON");_tcp._desiredCaptionLanguage=d}}if(_tcp._desiredCaptionLanguage==""&&_tcp._captionMode=="always"){_tcp._ui.addons.captions.automaticOn=true;_tcp._desiredCaptionLanguage=_play.session.language}_tcp._ui.onResize();_play.tools.log("SETTING STREAMTYPE: "+_tcp._mime+"/"+_tcp._streamtype+"/"+(_tcp._live?"LIVE":""),"HALCYON")},handleAirPlayState:function(){var el=document.getElementById("nxp_player"+
_tcp._index);if(el)if(el.webkitCurrentPlaybackTargetIsWireless){if(!_tcp._isPlayingExternal){_tcp._isPlayingExternal=true;_tcp._data.emitNotification(_play.config.events.ENTER_REMOTE,{device:"airplay"})}_tcp._el.addClass("nxp_active");_play.tools.log("AIRPLAY HAS STARTED","HALCYON");if(!_tcp._stream.events.hadCasted){_tcp._stream.events.hadCasted=true;_tcp._data.emitEvent(_samaritan.events.CASTING,{device:"airplay"})}}else if(_tcp._isPlayingExternal)if(_tcp._isPlayingExternal){_tcp._isPlayingExternal=
false;_play.tools.log("AIRPLAY HAS ENDED","HALCYON");_tcp._data.emitNotification(_play.config.events.ENTER_REMOTE,{device:"airplay"})}},onElapsed:function(){if(_tcp._stream.m&&_tcp._stream.getCurrentTime()>0&&!_tcp._stream.isBuffering&&!_tcp._stream.m.paused&&!_tcp._stream.m.ended&&!_tcp._playingAd&&!_tcp._stream.had100){_tcp._stream.events.elapsedSeconds++;if(_tcp._stream.events.waitForLightsOut&&!_tcp._menuActive&&!_play.system.environment.isLightsOut&&!_play.system.environment.isFullscreen&&!_play.system.environment.isPopOut&&
!_play.system.environment.isPIP){_tcp._stream.events.lightsOutSeconds++;if(_tcp._stream.events.lightsOutSeconds>=_tcp._config.enableLightsOutAutomaticAfter)_tcp._ia.interactSidebar("togglelight","time")}if(_tcp._usePreview)if(_tcp._stream.events.elapsedMinutes>=_tcp._previewDuration/60){_play.tools.log("ACTIVATING PREVIEW END","HALCYON");_tcp._ia.interact("pause");_tcp._previewPaused=true;_tcp._ia.onLeavePlayer();_tcp._ui.visualresponse.removeAll();_tcp._ui.visualresponse.addStatic("pause","previewended");
_tcp._ui.addons.notice.remove();_tcp._ui.hide();_tcp._menuActive=false;if(_play.system.environment.isFullscreen)_play.system.fullscreen.exit();_tcp._data.emitNotification(_play.config.events.PAY_PREVIEW_ENDED)}else _tcp._el.find(".nxp_notice").html(_play.tools.getClientText("paypreviewhint").replace("{duration}",_play._factory.tools.formatTime(_tcp._previewDuration-(_tcp._stream.events.elapsedMinutes*60+_tcp._stream.events.elapsedSeconds))),true);else if(_tcp._live)if(_tcp._stream.autoPauseTarget>
0){_tcp._stream.autoPauseTarget--;if(_tcp._stream.autoPauseTarget<=2){_play.tools.log("ACTIVATING AUTOMATIC PAUSE","HALCYON");_tcp._ia.interact("pause")}}if(_tcp._stream.events.elapsedSeconds>=15){_tcp._stream.events.elapsedSeconds=0;_tcp._stream.events.elapsedMinutes+=.25;_tcp._data.emitEvent(_samaritan.events.TIME,{duration:_tcp._stream.events.elapsedMinutes*60,position:_tcp._stream.getCurrentTime(),isMinute:_tcp._stream.events.elapsedMinutes*60%60==0?1:0});_tcp._data.emitNotification(_play.config.events.QUARTER,
{duration:_tcp._stream.events.elapsedMinutes*60+_tcp._stream.events.elapsedSeconds});if(_tcp._dashobj)_tcp._stream.metrics.checkQualityReporting()}_tcp._data.emitNotification(_play.config.events.SECOND,{duration:_tcp._stream.events.elapsedMinutes*60+_tcp._stream.events.elapsedSeconds});if(_tcp._useWatermark)if(_tcp._stream.events.elapsedSeconds==_play.config.client.watermark_delay)_tcp._menu.find(".nxp_watermark").stop().fadeIn();if(_tcp._stream.dur>0&&!_tcp._live){var c=_tcp._stream.getCurrentTime()-
_tcp._stream.startPos;if(c>=.25*_tcp._stream.dur&&!_tcp._stream.events.had25){_tcp._stream.events.had25=true;_tcp._data.emitEvent(_samaritan.events.PROGRESS,{progress:25});_tcp._data.emitNotification(_play.config.events.PROGRESS_25)}if(c>=.5*_tcp._stream.dur&&!_tcp._stream.events.had50){_tcp._stream.events.had50=true;_tcp._data.emitEvent(_samaritan.events.PROGRESS,{progress:50});_tcp._data.emitNotification(_play.config.events.PROGRESS_50)}if(c>=.75*_tcp._stream.dur&&!_tcp._stream.events.had75){_tcp._stream.events.had75=
true;_tcp._data.emitEvent(_samaritan.events.PROGRESS,{progress:75});_tcp._data.emitNotification(_play.config.events.PROGRESS_75)}if(c>=.95*_tcp._stream.dur&&!_tcp._stream.events.had95){_tcp._stream.events.had95=true;_tcp._data.emitEvent(_samaritan.events.PROGRESS,{progress:95});_tcp._data.emitNotification(_play.config.events.PROGRESS_95)}if((_tcp._useRevolver||["replay","playlist","loop"].indexOf(_tcp._exitmode)==-1)&&c>=_tcp._stream.dur-30-_play.tools.parseInt(_play.config.client.exitdisplaypreload)&&
!_tcp._playingAd&&!_tcp._flow.revolver.inited&&!_tcp._flow.hasNext())_tcp._flow.revolver.prepare();if(_tcp._data.vast.banner&&_tcp._data.vast.banner.length>0&&!_tcp._flow.ad.bannerStarted)_tcp._flow.ad.initBanners()}if(_tcp.usePPM)if(_tcp._stream.events.ppmcounter>=_tcp.stream.events.ppmtarget)_tcp._flow.pay.checkPPMUpdate();else if(_tcp._stream.events.ppmcounter>-1)_tcp._stream.events.ppmcounter++;if(_tcp._useSpots)_tcp._ui.addons.spots.update(_tcp._stream.getCurrentTime());if(_tcp._useMidRolls){if(_tcp._stream.events.midrollcounter>=
_tcp._flow.ad.midrollTarget){_tcp._stream.events.midrollcounter=-1;if(_tcp._flow.ad.allowMid)_tcp._flow.ad.load("mid");else _play.tools.log("MIDROLLS FORBIDDEN","HALCYON")}if(_tcp._stream.events.midrollcounter>-1)_tcp._stream.events.midrollcounter++}if(_tcp._useBanners)if(_tcp._data.vast.bannerActive){_tcp._data.vast.bannerCurrent++;if(_tcp._data.vast.bannerCurrent>=_tcp._data.vast.bannerNext)_tcp._flow.ad.nextBanner()}else{if(_tcp._stream.events.bannercounter>=_tcp._flow.ad.bannerTarget){_tcp._stream.events.bannercounter=
-1;if(_tcp._live||_tcp._stream.getCurrentTime()<_tcp._stream.dur-75)if(_tcp._flow.ad.allowBanner)_tcp._flow.ad.load("banner");else _play.tools.log("BANNERS FORBIDDEN","HALCYON")}if(_tcp._stream.events.bannercounter>-1)_tcp._stream.events.bannercounter++}}},listen:function(e){if(e.type!="timeupdate"&&e.type!="progress")_play.tools.log("MEDIA EVENT: "+e.type,"HALCYON");switch(e.type){case "play":case "playing":_tcp._stream.isBuffering=false;if(!_play.system.environment.isUnloading&&!_tcp._playingAd){if(_tcp._startMode)_tcp._ia.startClick();
if(_tcp._live){_tcp._stream.autoPauseTarget=_play.tools.parseInt(_tcp._data.getMedia("autoPause","streamdata"))*60;if(_tcp._stream.autoPauseTarget>0)_play.tools.log("ACTIVATING AUTOMATIC PAUSE ON "+_tcp._stream.autoPauseTarget,"HALCYON")}if(e.type=="play"){_tcp._data.emitNotification(_play.config.events.PLAY,{byUserAction:_tcp._playPauseByUser?1:0});_tcp._playPauseByUser=false;_tcp._flow.ad.removeBreak()}if(_tcp._isPanorama)_tcp._ui.panorama.startUpdate();_tcp._stream.setPlaybackRate()}else if(_tcp._playingAd)_tcp._stream.setPlaybackRate(1,
true);_tcp._ui.hideLoader();break;case "pause":if(!_play.system.environment.isUnloading&&!_tcp._playingAd){_tcp._data.emitNotification(_play.config.events.PAUSE,{byUserAction:_tcp._playPauseByUser&&!_tcp._stream.m.ended?1:0});_tcp._playPauseByUser=false;if(_tcp._isPanorama)_tcp._ui.panorama.stopUpdate()}_tcp._ui.hideLoader();break;case "seeking":if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,"BUFFERING");_tcp._stream.isBuffering=true;_tcp._ui.showLoader();break;case "waiting":if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,
"BUFFERING");_tcp._stream.isBuffering=true;_tcp._ui.showLoader();break;case "ratechange":_tcp._ui.hideLoader();break;case "seeked":if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,"PLAYING");_tcp._stream.isBuffering=false;_tcp._stream.play();_tcp._ui.hideLoader();_tcp._ui.visualresponse.removeAll();if(_play.system.environment.isCasted)_tcp._ia.onLeavePlayer();break;case "error":case "dasherror":_tcp._ui.hideLoader();if(!_tcp._online&&!_play.system.environment.isUnloading)_tcp._stream.pause();
else if(!_play.system.environment.isUnloading&&_play.system.connection.isOnline)if(_tcp._playingAd){_tcp._flow.ad.ping("error");_tcp._flow.ad.onAdDone(true,false,true);_tcp._data.emitNotification(_play.config.events.AD_ERROR);_tcp._data.emitEvent(_samaritan.events.AD_ERROR,{reason:"file",mode:"ima",provider:_tcp._admodel.provider,type:_tcp._flow.ad.mode});_tcp._flow.ad.four.sendEvent("AdError")}else if(_tcp._mime=="audio")if(_tcp._codec=="opus"&&_tcp._forceCodec!="mp3"){_tcp._forceCodec="mp3";_play.tools.log("HTTP/OPUS ERROR, TRYING TO USE MP3",
"HALCYON");_tcp._stream.build()}else _tcp._flow.onError("notfound",_tcp._data.getCurrentURL());else if(_tcp._willUseSHAKA&&!_tcp._firstRun&&e.type!="dasherror")_play.tools.log("IGNORING ERROR EVENT DUE TO SRC CHANGE","HALCYON");else if(!_tcp._live&&_tcp._data.isTokenized()&&!_tcp._tokenUpdateNeeded){_tcp._tokenUpdateNeeded=true;_tcp._ui.showLoader();_play._factory.ui.tooltip.hide();if(_tcp._protocol=="dash")_tcp._stream.cleanDASH();_play.tools.log("TOKEN MIGHT BE EXPIRED","HALCYON");_play.system.connection.callAPI("/videos/byid/"+
_tcp._data.getMedia("ID"),{addStreamDetails:1}).then(function(data){_tcp._ui.hideLoader();if(data&&data.protectiondata){_tcp._playlist[_tcp._playpos]["protectiondata"]=data.protectiondata;_tcp._stream.build()}else _tcp._flow.onError("notfound",_tcp._data.getCurrentURL())})["catch"](function(e){_tcp._flow.onError("novalidstream",_tcp._data.getCurrentURL())})}else if(_tcp._willUseSHAKA&&_tcp._shakaProtocol=="dash"&&_play.system.capabilities.hasHLS){_play.tools.log("DASH ERROR, TRYING TO USE HLS","HALCYON");
_tcp._stream.cleanDASH();_tcp._willUseSHAKA=false;_tcp._forceProtocol="hls";_tcp._stream.build()}else if(_tcp._data.canUseHTTP()){var del=10;_play.tools.log("HLS/DASH ERROR, TRYING TO USE HTTP","HALCYON");if(_tcp._willUseSHAKA){_tcp._stream.cleanDASH();_tcp._willUseSHAKA=false;del=150}window.setTimeout(function(){if(_play.system.capabilities.hasMP4&&_tcp._forceCodec!="mp4"){_tcp._forceCodec="mp4";_tcp._forceProtocol="http";_tcp._stream.build()}else if(_play.system.capabilities.hasWebM&&(_play.tools.parseInt(_tcp._data.getMedia("encodedWEBM",
"streamdata"))==1||_play.tools.parseInt(_tcp._data.getMedia("encodedVP9","streamdata"))==1)){_tcp._forceCodec="webm";_tcp._forceProtocol="http";_tcp._stream.build()}else if(_tcp._live)_tcp._flow.onError("nolive",_tcp._data.getCurrentURL());else _tcp._flow.onError("notfound",_tcp._data.getCurrentURL())},del)}else if(_tcp._live)_tcp._flow.onError("nolive",_tcp._data.getCurrentURL());else _tcp._flow.onError("notfound",_tcp._data.getCurrentURL());break;case "ended":if(!_tcp._playingAd){_tcp._el.find(".nxp_icon-pause").removeClass("nxp_icon-pause").addClass("nxp_icon-play").attr("data-command",
"play").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._playmode,"option_play"));if(!_tcp._stream.events.had100){_tcp._stream.events.had100=true;_tcp._data.emitEvent(_samaritan.events.PROGRESS,{progress:100})}_tcp._data.emitEvent(_samaritan.events.TIME,{duration:_tcp._stream.events.elapsedMinutes*60+_tcp._stream.events.elapsedSeconds,position:_tcp._stream.getCurrentTime(),isMinute:_tcp._stream.events.elapsedMinutes*60%60==0?1:0});_tcp._data.emitNotification(_play.config.events.ENDED);
_tcp._flow.onEnded()}else if(_tcp._admodel.type!="ima"){_tcp._flow.ad.ping("complete");_tcp._flow.ad.four.sendEvent("AdVideoComplete");if(_tcp._flow.ad.adresult.media){if(_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type!="vpaid")_tcp._flow.ad.onAdDone()}else _tcp._flow.ad.onAdDone()}else _tcp._flow.ad.onAdDone();break;case "suspend":break;case "emptied":if(_tcp._stream.m){var s=_tcp._stream.m.getAttribute("src");if(!s){if(_tcp._stream.playPromise&&_tcp._stream.playPromiseError)_tcp._stream.playPromiseError=
false;_tcp._stream.m.setAttribute("src",_tcp._data.currenturl[0]);_tcp._stream.m.load();_tcp._stream.simplePlay()}}break;case "volumechange":if(!_tcp._playingAd&&!_tcp._stream.m.muted&&_tcp._stream.m.volume>0)_play.system.storage.set("nxp_lastvolume",_tcp._stream.m.volume,true);break;case "resize":case "adaptation":_tcp._ui.hideLoader();if(_tcp._willUseSHAKA)_tcp._stream.metrics.update();break;case "durationchange":if(_tcp._playingAd){if(!_tcp._willUseSHAKA)_tcp._flow.ad.dur=_tcp._stream.m.duration;
else if(_tcp._flow.ad.player)_tcp._flow.ad.dur=_tcp._flow.ad.player.duration;_tcp._ui.addons.layer.build("ad");if(!_play.system.environment.isCasted)_tcp._ui.addons.layer.build("adcontrol",true)}else if(!_tcp._live){if(_tcp._stream.m.duration>0&&_tcp._stream.m.duration<Infinity){_tcp._stream.dur=_tcp._stream.m.duration;_tcp._stream.startPos=0;_tcp._stream.useHours=_tcp._stream.dur>60*60;if(!_tcp._stream.useHours)_tcp._menu.find(".nxp_currenttime").removeClass("nxp_extended");_tcp._menu.find(".nxp_totaltimedisplay").html(_play._factory.tools.formatTime(_tcp._stream.dur,
_tcp._stream.useHours));if(_tcp._stream.seekTarget>0){_play.tools.log("RESTORING SEEKTARGET "+_tcp._stream.seekTarget,"HALCYON");_tcp._stream.m.currentTime=_tcp._stream.seekTarget}}}else if(_tcp._dvr){_tcp._stream.useHours=true;_tcp._stream.dur=(_play.session.getTime(true)-_tcp._dashobj.getPresentationStartTimeAsDate().getTime())/1E3;_tcp._menu.find(".nxp_totaltimedisplay").html(_play._factory.tools.formatTime(_tcp._stream.dur,_tcp._stream.useHours))}break;case "loadedmetadata":case "canplaythrough":case "canplay":if(!_tcp._playingAd&&
!_tcp._flow.ended){if(_tcp._useFullPlayer){_tcp._ui.visualresponse.removeAll();_tcp._startMode=false;_tcp._ui.onResize()}if(!_tcp._stream.tmr)if(!_tcp._startMode)_tcp._stream.events.initProcessing();else _tcp._videoMetaLoaded=true;if(_play.tools.parseInt(_tcp._config.delay)>0&&e.type=="canplay"){_play.tools.log("DELAY FOUND, SETTING CURRENTTIME TO "+_tcp._config.delay,"HALCYON");_tcp._stream.m.currentTime=_tcp._config.delay;_tcp._stream.seekTarget=_tcp._config.delay;_tcp._config.delay=0}}else if(_tcp._playingAd&&
!_tcp._flow.ad.reportedStart){if(_tcp._willUseSHAKA)if(_tcp._flow.ad.player)_tcp._flow.ad.dur=_tcp._flow.ad.player.duration;_tcp._flow.ad.reportedStart=true;_tcp._data.reportAd(_tcp._flow.ad.mode,_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima"?"ima":"vast");_tcp._flow.ad.ping("impression");_tcp._flow.ad.ping("start");_tcp._flow.ad.ping("creativeView");if(!_play.system.environment.isCasted)_tcp._ui.addons.layer.build("adcontrol",true)}break;case "timeupdate":if(!_tcp._playingAd){var n=_tcp._stream.getCurrentTime();
if(_tcp._stream.events.lastPos!=n){_tcp._stream.events.lastPos=n;_tcp._stream.isBuffering=false}var sp=Math.max(n-_tcp._stream.startPos,0);_tcp._stream.updateCurrentTime(sp)}else{if(_tcp._pendingPause)if(_tcp._stream.m)_tcp._stream.m.pause();_tcp._flow.ad.handleProgress();_tcp._flow.ad.renderText();_tcp._flow.ad.four.sendEvent("AdRemainingTimeChange")}break;case "webkitplaybacktargetavailabilitychanged":_play.tools.log("AIRPLAY EVENT: "+e.availability,"HALCYON");var el=_tcp._menu.find("div[data-command='airplay']");
if(el){switch(e.availability){case "available":_tcp._hasAirPlay=true;el.css("display","inline-block");break;default:_tcp._hasAirPlay=false;el.css("display","none");break}window.setTimeout(function(){_tcp._stream.events.handleAirPlayState()},500)}else _play.tools.log("UI NOT INITILAIZED YET","HALCYON");break;case "webkitcurrentplaybacktargetiswireless":_tcp._stream.events.handleAirPlayState();break;case "webkitpresentationmodechanged":_play.tools.log("WEBKIT PRESENTATION MODE: "+_tcp._stream.m.webkitPresentationMode,
"HALCYON");if(_tcp._stream.m)if(_tcp._stream.m.webkitPresentationMode=="picture-in-picture"){if(!_play.system.environment.isPIP){_play.system.environment.isPIP=true;_tcp._data.emitNotification(_play.config.events.ENTER_PIP)}if(!_tcp._stream.events.hadPIP){_tcp._stream.events.hadPIP=true;_tcp._data.emitEvent(_samaritan.events.PIP,{})}}else if(_tcp._stream.m.webkitPresentationMode=="inline"){if(_play.system.environment.isPIP){_play.system.environment.isPIP=false;_tcp._data.emitNotification(_play.config.events.EXIT_PIP)}if(_play.system.isIOS()&&
_play.system.getIOSVersion()>=10&&_play.system.device.platform!="fbia"&&!_play.system.environment.isWebView){_tcp._ui.onResize();if(!_tcp._ended)_tcp._stream.play()}}else if(_tcp._stream.m.webkitPresentationMode=="fullscreen"){if(!_tcp._stream.events.hadFS){_tcp._data.emitEvent(_samaritan.events.FULLSCREEN,{type:_tcp._autofullscreen==1?"domainsetting":"manual"});_tcp._stream.events.hadFS=true}_play.system.environment.isPIP=false}else _play.system.environment.isPIP=false;break;case "webkitendfullscreen":if(_play.system.isIOS()){_tcp._data.emitNotification(_play.config.events.EXIT_FULLSCREEN);
_play.system.environment.isFullscreen=false;if(_play.system.environment.isWebView||_play.system.getIOSVersion()<10)if(_play.system.device.type=="mobile"){if(_tcp._stream.m&&!_tcp._playingAd){_tcp._delay=_tcp._stream.getCurrentTime();_play.tools.log("SETTING DELAY TO "+_tcp._delay,"HALCYON")}if(_tcp._playingAd)_tcp._flow.ad.onAdDone(false,true);_tcp._ui.hideLoader();_tcp._ui.show();_tcp._ui.visualresponse.removeAll();if(_tcp._delay>=_tcp._stream.m.duration-10){_tcp._delay=0;_tcp._ui.visualresponse.addStatic("restart",
"restart")}else _tcp._ui.visualresponse.addStatic("play","resume")}else _tcp._stream.simplePlay();else _tcp._ui.onResize()}break;case "webkitbeginfullscreen":if(_play.system.isIOS()){_tcp._data.emitNotification(_play.config.events.ENTER_FULLSCREEN);_play.system.environment.isFullscreen=true;_play.system.fullscreen.lastElement="nxp_player"+_tcp._index}break}}},simplePlay:function(){_play.tools.log("SIMPLE PLAY","HALCYON");_tcp._stream.playPromise=_tcp._stream.m.play();if(_tcp._stream.playPromise!==
undefined&&typeof _tcp._stream.playPromise.then=="function"){_play.tools.log("DEVICE USES PROMISE","HALCYON");_tcp._stream.playPromise.then(function(){_play.tools.log("PLAY PROMISE RESOLVED","HALCYON");_tcp._ui.buildMediaSession()})["catch"](function(e){var m=e.message||"";_play.tools.log("PLAY PROMISE ERROR: "+m,"HALCYON");if(_tcp._autoplay==1){_play.tools.log("PROCESSING PROMISE ERROR","HALCYON");_tcp._stream.playPromiseError=true;if(_tcp._initiallyMuted)window.setTimeout(function(){if(!_tcp._stream.m||
_tcp._stream.m.currentTime==0){_play.system.cache.set("nxp_deniedmobileauto2",1);_tcp._flow.reset()}else _tcp._ui.buildMediaSession()},600);else if(!_tcp._isRebuild&&(m.indexOf(" user denied")>-1||m.indexOf(" aborted")>-1)&&!_play.system.isIOS()&&_play.system.isSafari()&&_play.system.getSafariVersion()>=11){_play.system.cache.set("nxp_denieddesktopauto2",1);_tcp._flow.reset()}}})}},play:function(){if(_tcp._stream.m){_tcp._menu.find(".nxp_suggestions").remove();if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("play");
else if(_tcp._stream.m.paused){if(!_tcp._playingAd)_tcp._ui.visualresponse.add("play");_tcp._stream.simplePlay();if(_play.system.environment.isCasted)_tcp._ia.onLeavePlayer()}}},pause:function(skipAnimation){_play.tools.log("TRYING TO PAUSE STREAM","HALCYON");if(_tcp._stream.m)if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("pause");else if(!_tcp._stream.m.paused){_play.tools.log("TRYING TO PAUSE STREAM","HALCYON");_tcp._stream.m.pause();if(_tcp._stream.m.paused){if(_tcp._playingAd)_tcp._playingAdPaused=
true;if(_tcp._online)if(_play.system.environment.isCasted){_tcp._ia.onEnterPlayer();_tcp._ui.visualresponse.add("play")}else if(!skipAnimation)_tcp._ui.visualresponse.addStatic("play")}else _play.tools.log("STREAM PAUSE FAILED","HALCYON")}else{if(_tcp._playingAd){_play.tools.log("AD IS PLAYER","HALCYON");if(_tcp._flow.ad.player){_play.tools.log("TRYING TO PAUSE ADPLAYER","HALCYON");_tcp._playingAdPaused=true;_tcp._flow.ad.player.pause();_tcp._ui.visualresponse.addStatic("play")}else if(_tcp._flow.ad.ima.manager){_play.tools.log("TRYING TO PAUSE IMA PLAYER",
"HALCYON");_tcp._playingAdPaused=true;_tcp._flow.ad.ima.manager.pause();_tcp._ui.visualresponse.addStatic("play")}}}else _play.tools.log("NO STREAM AVAIABLE","HALCYON")},mute:function(skipAnimation){if(_tcp._stream.m)if(!_tcp._isCasting){if(!skipAnimation)_tcp._ui.visualresponse.add("unmute");_tcp._stream.m.muted=true}else _play.addons.cast.sender.sendMessage("mute");if(_tcp._flow.ad.player)_tcp._flow.ad.player.muted=true;if(_tcp._playingAd)if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.mute(true);
else{_tcp._flow.ad.four.sendEvent("AdVolumeChange");_tcp._flow.ad.four.sendEvent("AdInteraction")}else _tcp._data.emitNotification(_play.config.events.MUTE);var c=_tcp._data.getMediaObject("captiondata");if(c&&c.length>0&&_tcp._captionMode=="selectandstart"&&_tcp._currentCaptionLanguage=="")_tcp._ui.addons.captions.handleMuting()},unmute:function(skipAnimation){if(_tcp._stream.m)if(!_tcp._isCasting){if(!skipAnimation)_tcp._ui.visualresponse.add("mute");_tcp._stream.m.muted=false;if(_tcp._ui.addons.captions.mutedFallback)_tcp._ui.addons.captions.hide(true)}else _play.addons.cast.sender.sendMessage("nomute");
if(_tcp._flow.ad.player)_tcp._flow.ad.player.muted=false;else _tcp._data.emitNotification(_play.config.events.UNMUTE);if(_tcp._playingAd)if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.mute(false);else _tcp._flow.ad.four.sendEvent("AdVolumeChange")},pip:function(){if(_play.system.environment.isPIP)_app["native"].media.pip.exit(function(){_play.tools.log("EXITING PIP","HALCYON");_tcp._el.removeClass("nxp_pip");jQuery("body").removeClass("nxp_pip");if(["android","atv"].indexOf(_play.system.device.platform)>
-1)_tcp._menu.show();_play.system.environment.isPIP=false;_tcp._data.emitNotification(_play.config.events.EXIT_PIP)});else _app["native"].media.pip.enter(function(){_play.tools.log("ENTERING PIP","HALCYON");_play.system.environment.isPIP=true;_tcp._el.addClass("nxp_pip");jQuery("body").addClass("nxp_pip");if(["android","atv"].indexOf(_play.system.device.platform)>-1)_tcp._menu.hide();if(!_tcp._stream.events.hadPIP){_tcp._stream.events.hadPIP=true;_tcp._data.emitEvent(_samaritan.events.PIP,{})}_tcp._data.emitNotification(_play.config.events.ENTER_PIP)})},
setVolume:function(v){if(_tcp._stream.m)if(!_tcp._isCasting)_tcp._stream.m.volume=v;else _play.addons.cast.sender.sendMessage("volume",v)},setPlaybackRate:function(v,forAd,doReport){v=v||_tcp._desiredSpeed;v=parseFloat(v);if(_tcp._live)v=1;_play.tools.log("SETTING PLAYBACKRATE TO "+v,"HALCYON");if(!forAd){if(v!=_tcp._desiredSpeed){_tcp._desiredSpeed=v;if(_play.system.capabilities.hasStorage)_play.system.storage.set("nxp_desiredspeed",v)}if(v!=1&&doReport)_tcp._data.emitEvent(_samaritan.events.TRICKPLAY,
{speed:v});jQuery(".nxp_listitem.nxp_activeitem").removeClass("nxp_activeitem");jQuery(".nxp_listitem[data-value='"+v+"']").addClass("nxp_activeitem");jQuery(".nxp_listitem .nxp_icon-checked").remove();jQuery(".nxp_listitem[data-value='"+v+"']").append("<div class='nxp_icon-checked'></div>");if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,"PLAYING")}if(_tcp._stream.m)if(!_tcp._isCasting)_tcp._stream.m.playbackRate=v;else _play.addons.cast.sender.sendMessage("playbackrate",
v)},seek:function(v,forced){if(_tcp._stream.m)if(_tcp._isCasting||_tcp._stream.getCurrentTime()>0||forced){v=parseFloat(v);if(!v)v=0;v=Math.max(0,v);v=Math.min(v,_tcp._stream.dur-10);_play.tools.log("SEEKING FROM "+_tcp._stream.getCurrentTime()+" TO "+v+" OF "+_tcp._stream.dur,"HALCYON");if(!_tcp._isCasting)_tcp._stream.m.currentTime=v;else _play.addons.cast.sender.sendMessage("seek",v)}},seekRelative:function(v){v=_tcp._stream.getCurrentTime()+parseFloat(v);_tcp._stream.seek(v)}},_ui:{useThumbs:true,
isDragging:false,isShowing:true,clean:function(){_tcp._el.find(".nxp_watermark").remove()},show:function(){if(!_tcp._hiddenMenu){if(!_tcp._el.hasClass("nxp_active")&&!_tcp._playingAd){_tcp._ui.isShowing=true;_tcp._data.emitNotification(_play.config.events.UI_SHOW)}if(!_tcp._isBumper)_tcp._el.addClass("nxp_active")}},hide:function(){if(!_tcp._fixedMenu){if(_tcp._el.hasClass("nxp_active")&&!_tcp._playingAd){_tcp._ui.isShowing=false;_tcp._data.emitNotification(_play.config.events.UI_HIDE)}_tcp._el.removeClass("nxp_active")}},
getSubtitle:function(){var t=_tcp._data.getMedia("subtitle");if(t=="")switch(_play.config.client.playersubtitlemode){case "actor":t=_tcp._data.getMedia("actors");break;case "album":t=_tcp._data.getMedia("album");break;case "all":t=_tcp._data.getMedia("actors");if(t=="")t=_tcp._data.getMedia("album");break}return t},getFullscreenIcon:function(forFullscreen){var icos=["fullscreen","nofullscreen"];if(_play.config.client.fullscreenicon!="fullscreen")icos=["enlarge","shrink"];return icos[forFullscreen?
0:1]},getStartImageData:function(forceImage){var ss="";var ap=_tcp._data.getMediaReal("thumb","imagedata");if(_play.config.client.thumbversion=="alternate")ap=_tcp._data.getMediaReal("thumb_alt","imagedata");if(_play.system.capabilities.hasWebP&&_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)ap=ap.replace(".jpg",".webp");if(_play.tools.parseInt(_tcp._data.getMediaReal("thumb_hasX2","imagedata"))>0)if(_tcp._width<=_play.config.constants.THRESHOLD_HQ){ss=" srcset='"+ap+" 1x, "+_play.tools.getImageVersion(ap,
2)+" 2x";if(_play.tools.parseInt(_tcp._data.getMediaReal("thumb_hasX3","imagedata"))>0)ss+=", "+_play.tools.getImageVersion(ap,3)+" 3x";ss+="'"}else{if(_play.tools.parseInt(_tcp._data.getMediaReal("thumb_hasX3","imagedata"))>0)ss=" srcset='"+ap+" 1x, "+_play.tools.getImageVersion(ap,3)+" 2x'";ap=_play.tools.getImageVersion(ap,2)}if(forceImage||_play.tools.parseInt(_play.config.client.autoplayimage)==0){ap=_play.config.client.thumb_playerthumb;if(_play.system.capabilities.hasWebP&&_tcp._config.dataMode==
_play.config.constants.DATAMODE_STATIC)ap=ap.replace(".jpg",".webp");ss=""}else if(_play.tools.parseInt(_play.config.client.autoplayimage)==2&&_tcp._data.getMediaReal("animation","imagedata")&&_tcp._data.getMediaReal("animation","imagedata").indexOf("nodata")==-1){ap=_tcp._data.getMediaReal("animation","imagedata");if(_play.system.capabilities.hasWebP&&_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)ap=ap.replace(".gif",".webp");ss=""}return[ap,ss]},buildMediaSession:function(){if(_play.system.capabilities.hasMediaSession){_play.tools.log("CREATING MEDIA SESSION OBJECT",
"HALCYON");var cover=_tcp._data.getMediaReal("thumb","imagedata");if(_play.config.client.thumbversion=="alternate")cover=_tcp._data.getMediaReal("thumb_alt","imagedata");var ext=_play.system.capabilities.hasWebP?"webp":"jpg";var o={title:_tcp._data.getMediaReal("title"),artist:_tcp._ui.getSubtitle(),artwork:[{src:cover,type:"image/"+ext}]};if(_play.tools.parseInt(_tcp._data.getMediaReal("thumb_hasX2","imagedata"))>0)o.artwork.push({src:_play.tools.getImageVersion(cover,2),sizes:"1280x720",type:"image/"+
ext});if(_play.tools.parseInt(_tcp._data.getMediaReal("thumb_hasX3","imagedata"))>0)o.artwork.push({src:_play.tools.getImageVersion(cover,3),sizes:"1920x1080",type:"image/"+ext});if(_tcp._mime=="audio")o.album=_tcp._data.getMediaReal("album");navigator.mediaSession.metadata=new MediaMetadata(o);navigator.mediaSession.setActionHandler("play",function(){_tcp._ia.interact("play")});navigator.mediaSession.setActionHandler("pause",function(){_tcp._ia.interact("pause")});if(_play.config.client.allowseekbuttons>
0){navigator.mediaSession.setActionHandler("seekbackward",function(){_tcp._ia.interact("seekleft")});navigator.mediaSession.setActionHandler("seekforward",function(){_tcp._ia.interact("seekright")})}if(_tcp._playlist.length>1&&["playlist","audioalbum","videolist","audiolist"].indexOf(_tcp._playmode)>-1){navigator.mediaSession.setActionHandler("previoustrack",function(){_tcp._ia.interact("prev")});navigator.mediaSession.setActionHandler("nexttrack",function(){_tcp._ia.interact("next")})}}else if(_play.system.environment.isApp&&
_app["native"].media.systemMedia.isAvailable)_app["native"].media.systemMedia.update(_tcp._div)},build:function(){_play.tools.log("BUILDING UI","HALCYON");_tcp._ui.clean();if(_tcp._el.find("#nxp_player"+_tcp._index).length==0){_play.tools.log("CREATING MEDIA HOLDER","HALCYON");if(_tcp._mime=="video"||_tcp._useVideoAudio){if(!_play.system.environment.isApp||!_app.config.useAppPlayer)_tcp._area.html("<video id='nxp_player"+_tcp._index+"'"+(!_tcp._useFullPlayer?" controls":"")+(_play.system.isSafari()&&
!_play.system.isMobile()?"":" poster='"+_play.config.constants.ARCROOT+"static/structure/pixel_transparent.png'")+" width='100%' height='100%' preload='metadata'"+(_play.system.isIOS()&&_play.system.getIOSVersion()>=10&&!_play.system.environment.isWebView?" playsinline":"")+(_tcp._initiallyMuted?" autoplay muted":"")+"></video>")}else if(_tcp._mime=="audio")_tcp._area.html("<audio id='nxp_player"+_tcp._index+"' preload='metadata'></audio>")}if(_tcp._firstRun)if(_tcp._live&&_play.tools.parseInt(_tcp._data.getMedia("validfrom",
"streamdata"))>_play.session.getTime())_tcp._waitForLive=true;else if(!_tcp._useMicroPlayer&&_play.tools.parseInt(_tcp._autoplay)==0){var idata=_tcp._ui.getStartImageData();_tcp._area.append("<div id='nxp_startimage"+_tcp._index+"' class='cl_nxp_startimage'><img class='behave"+(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+idata[0]+"'"+idata[1]+" /></div>");_tcp._fixedMenu=true}_tcp._ui.menu.build();_tcp._ui.sidebar.build();if(_play.system.environment.isCasted){_play.addons.cast.receiver.updateElement(_tcp._index);
_tcp._el.find(".nxp_sidebar,.nxp_menubar").hide()}if(_tcp._mime=="video"&&_tcp._config.watermarkMode!=0){if(_tcp._config.watermarkMode==1)_tcp._useWatermark=true;else if(_tcp._allowWatermark)_tcp._useWatermark=_play.tools.parseInt(_tcp._data.getMedia("watermarkMode","streamdata"))!=-1;if(_tcp._useWatermark)_tcp._menu.append("<div class='nxp_watermark nxp_"+_play.config.client.watermark_position+"' style='height:"+_play.config.client.watermark_scale+"%;opacity:"+_play.config.client.watermark_alpha/
100+(_play.tools.parseInt(_play.config.client.watermark_delay)>0?";display:none":"")+";'><img src='"+_play.config.client.thumb_watermark+"' /></div>")}if(_tcp._waitForLive)_tcp._ui.livedisplay.build();else if(_play.tools.parseInt(_tcp._autoplay)==1||!_tcp._firstRun){_tcp._startMode=false;_tcp._flow.onMediaReady()}else if(!_tcp._useMicroPlayer)_tcp._ui.visualresponse.addStatic("init");else{_tcp._startMode=false;_tcp._flow.onMediaReady()}if(!_tcp._useFullPlayer){if(_tcp._firstRun&&(!_play.system.environment.isApp||
!_app.config.useAppPlayer)){var el=document.getElementById("nxp_player"+_tcp._index);if(el){_play.tools.log("ADDING WEBKIT LEGACY FULLSCREEN LISTENERES","HALCYON");el.addEventListener("webkitbeginfullscreen",function(e){if(_tcp._startMode)_tcp._ia.startClick()})}}_tcp._stream.build()}_tcp._firstRun=false;_tcp._ui.onResize();_tcp._ui.updateTooltips();if(!_tcp._isRebuild){_tcp._data.emitNotification(_play.config.events.PLAYER_READY);_tcp._data.reportDisplay()}},updateTooltips:function(){_play._factory.ui.tooltip.trigger()},
addLayout:function(){_tcp._template=_tcp._config.playerSkin;if(_tcp._useMiniPlayer){_tcp._el.addClass("nxp_mini");if(["minimal","minimalwithtime","minimalwithright","buntede"].indexOf()==-1)_tcp._template="minimalwithtime"}if(_tcp._template=="minimalwithtime"||_tcp._template=="minimalwithright"||_tcp._template=="glass")_tcp._el.addClass("skin_minimal");else if(_tcp._template=="buntede")_tcp._el.addClass("skin_minimal skin_glass");else if(_tcp._template=="float")_tcp._el.addClass("skin_minimal skin_minimalwithtime");
else if(_tcp._template=="glass66")_tcp._el.addClass("skin_minimal skin_glass");if(_tcp._template=="minimalwithright"&&!_play.system.capabilities.hasFullscreen)_tcp._template="minimalwithtime";_tcp._el.addClass("skin_"+_tcp._template);_tcp._el.addClass("nxp_cl_"+_play.config.client.id+" nxp_tile_"+_play.config.client.tilestyle+(_play.system.capabilities.hasTouch?" nxp_touch":""));if(_play.tools.parseInt(_play.config.client.allowanimations)==0)_tcp._el.addClass("nxp_fastanimations");if(_play.system.isIOS()&&
_play.system.device.type=="mobile"&&(_play.system.getIOSVersion()<10||_play.system.environment.isWebView))_tcp._el.addClass("nxp_ios9");_tcp._totalTimeMode=_play.config.client.totalTimeMode;if(_tcp._live&&!_tcp._dvr||_play.system.environment.isCasted||_tcp._usePreview||_play.system.isTV()){_tcp._usesForcedTemplate=true;_tcp._el.addClass("skin_forced")}else{_tcp._usesForcedTemplate=false;_tcp._el.removeClass("skin_forced")}},onOrientationChange:function(){if(!_play.system.fullscreen.useLegacy&&_tcp._mime==
"video"&&_tcp._stream.isRunning())if(!_play.system.device.isPortrait){if(!_play.system.environment.isFullscreen)_tcp._ia.interact("fullscreen","orientationchange")}else if(_tcp._fullscreenByRotate)_tcp._ia.interact("nofullscreen")},onNetworkEvent:function(){if(_play.system.connection.isOnline&&!_tcp._online){_tcp._online=true;_tcp._stream.seekRelative(-5);if(_tcp._willUseSHAKA&&_tcp._dashobj)_tcp._dashobj.retryStreaming();if(_tcp._ui.addons.captions.reported)_tcp._overlay.find(".nxp_captionholder").show();
_tcp._el.find(".nxp_spots").show();_tcp._ui.addons.notice.remove()}else if(!_play.system.connection.isOnline&&_tcp._online){_tcp._ia.interact("pause");if(_tcp._ui.addons.captions.reported)_tcp._overlay.find(".nxp_captionholder").hide();_tcp._el.find(".nxp_spots").hide();_tcp._ui.addons.notice.build("<div class='nxp_icon-offline' style='position:relative;top:10px;'></div>"+_play.tools.getClientText("error_deviceoffline").split(". ").join(".<br /><span style='padding-left:19px;'>")+"</span>",true);
_tcp._online=false}},onResize:function(wel){var forced=!wel;wel=wel||_tcp._el.width();wel=_play.tools.parseInt(wel);if(!_play.system.environment.isFullscreen&&_tcp._config.adjustContainerDimensions==1)if(!_play.system.environment.isEmbedded){if(wel!=_tcp._width){_tcp._el.parent().css({height:_tcp._config.aspectRatio*_tcp._el.parent().width()});wel=_tcp._el.width()}}else if(_play.system.capabilities.hasComputedStyle){var el=_tcp._el[0];cs=window.getComputedStyle(el,null);if(parseInt(cs.width)==0)el.style.width=
jQuery(window).width()+"px";if(parseInt(cs.height)==0)el.style.height=jQuery(window).height()+"px"}if(wel==0&&_play.system.environment.isFullscreen)wel=screen.width;if(forced||_tcp._width!=wel){_tcp._width=wel;_tcp._height=_play.system.environment.isFullscreen?screen.height:_tcp._el.height();_play.tools.log("UPDATING UI FOR DIMENSIONS "+_tcp._width+"/"+_tcp._height,"HALCYON");_tcp._el.removeClass("nxp_xl nxp_l nxp_m nxp_s nxp_xs");if(_tcp._stream.useHours)_tcp._menu.find(".nxp_currenttime").addClass("nxp_extended");
if(_tcp._width>=640)_tcp._el.addClass("nxp_xl");else if(_tcp._width>=560)_tcp._el.addClass("nxp_l");else if(_tcp._width>=500)_tcp._el.addClass("nxp_m");else if(_tcp._width>=400){_tcp._el.find(".nxp_extended").removeClass("nxp_extended");_tcp._el.addClass("nxp_s")}else{_tcp._el.find(".nxp_extended").removeClass("nxp_extended");_tcp._el.addClass("nxp_xs")}var tv=_tcp._useVolume;var w=0;if(!_play.system.environment.isFullscreen){_tcp._el.find(".nxp_ttf").remove();_play._factory.ui.tooltip.updateId("nxp_tt");
if(_tcp._mime!="image")_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).attr("data-command","fullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._playmode,"option_fullscreen"));else{_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true));
_tcp._el.find("nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).parent().attr("data-command","fullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_fullscreen"))}_tcp._ui.updateTooltips();_tcp._el.find(".lighttoggle").show();if(_tcp._usePreview&&_play.system.isIOS()){_tcp._menu.find("div[data-command='fullscreen']").hide();_tcp._el.find(".nxp_menubar").attr("style","width:60px !important")}if(_play.config.client.titlestyle=="top"&&_play.tools.parseInt(_tcp._titleMode)==
2)if(_tcp._mime!="audio")_tcp._menu.find(".nxp_sidebar").removeClass("nxp_toptitleactive nxp_toptitleactivenosubtitle");else{_tcp._menu.find(".nxp_sidebar").addClass("nxp_toptitleactive");if(_tcp._menu.find(".nxp_subtitle").length==0&&_tcp._menu.find(".nxp_topsubtitle").length==0)_tcp._menu.find(".nxp_sidebar").addClass("nxp_toptitleactivenosubtitle")}}else{if(_tcp._mime!="image")_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).addClass("nxp_icon-"+
_tcp._ui.getFullscreenIcon(false)).attr("data-command","nofullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nofullscreen"));else{_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false));_tcp._el.find("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).parent().attr("data-command","nofullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_nofullscreen"))}if(_play.config.client.titlestyle=="top"&&_play.tools.parseInt(_tcp._titleMode)==2){_tcp._menu.find(".nxp_sidebar").addClass("nxp_toptitleactive");if(_tcp._menu.find(".nxp_subtitle").length==0&&_tcp._menu.find(".nxp_topsubtitle").length==0)_tcp._menu.find(".nxp_sidebar").addClass("nxp_toptitleactivenosubtitle")}_tcp._el.find(".lighttoggle").hide();if(_tcp._el.find(".nxp_ttf").length==0){_tcp._el.append("<div class='nxp_ttf' id='nxp_ttf"+_tcp._index+"'></div>");_play._factory.ui.tooltip.updateId("nxp_ttf"+
_tcp._index)}}if(_tcp._useMiniPlayer)if(_tcp._height<110){_tcp._el.find(".nxp_audiocover").hide();if(_tcp._height<95){_tcp._menu.find(".nxp_subtitle, .nxp_topsubtitle").hide();if(_tcp._height<=_play.config.constants.MICROPLAYER_MAX_HEIGHT){_tcp._el.find(".nxp_audioholder").hide();_tcp._menu.find(".nxp_title").hide();_tcp._menu.find(".nxp_menubar").css({bottom:(_tcp._height-42)/2+"px"})}else{_tcp._el.find(".nxp_audioholder").show();_tcp._menu.find(".nxp_title").show();_tcp._menu.find(".nxp_menubar").css({bottom:0})}}else{_tcp._el.find(".nxp_audioholder").show();
_tcp._menu.find(".nxp_subtitle, .nxp_topsubtitle").show()}}else{_tcp._el.find(".nxp_audioholder").show();_tcp._menu.find(".nxp_subtitle, .nxp_topsubtitle").show();_tcp._el.find(".nxp_audiocover").css({height:_tcp._height-66+"px"}).show()}if(_tcp._width<_play.config.constants.VOLUME_MIN_WIDTH)_tcp._menu.find(".nxp_icon-seekbackward,.nxp_icon-seekforward").hide();else _tcp._menu.find(".nxp_icon-seekbackward,.nxp_icon-seekforward").show();if(_tcp._useVolume)if(_tcp._width<_play.config.constants.VOLUME_MIN_WIDTH){_play.tools.log("PLAYER TOO SMALL, REMOVING VOLUME",
"HALCYON");_tcp._menu.find(".nxp_volumeholder").hide();tv=false}else _tcp._menu.find(".nxp_volumeholder").show();if(!_play.system.environment.isCasted)if(_tcp._template=="default"||_tcp._usesForcedTemplate)_tcp._menu.find(".nxp_progressbar").css({width:_tcp._width-_tcp._menu.find(".nxp_actionicon").length*30-(tv?50:0)-70+"px"});else if(_tcp._template=="minimalwithtime"||_tcp._template=="minimalwithright"||_tcp._template=="buntede"||_tcp._template=="glass"||_tcp._template=="glass66"||_tcp._template==
"float"){var add=100;if(_tcp._template=="glass"||_tcp._template=="glass66"||_tcp._template=="buntede"){add=70;if(_play.system.isIOS())add+=30}if(_tcp._template!="minimalwithright"){if(_tcp._menu.find(".nxp_currenttime").hasClass("nxp_extended"))add+=20;else if(_tcp._width<_play.config.constants.TIMES_MIN_WIDTH)add=0;if(_tcp._template=="float")if(_tcp._width>640){w=640;add-=20}else if(_tcp._width<_play.config.constants.TIMES_MIN_WIDTH)add=0;else add+=40}else{add=60;if(_tcp._width<_play.config.constants.TIMES_MIN_WIDTH){_tcp._menu.find(".nxp_totaltime").hide();
add=20}else _tcp._menu.find(".nxp_totaltime").show()}var elc=_tcp._menu.find(".nxp_actionicon:visible").length;_tcp._menu.find(".nxp_progressholder").css({left:elc*30+20+(tv?50:0)+(_tcp._template=="minimalwithright"?-40:0)+"px"});if(add==0){_tcp._menu.find(".nxp_progressholder").css({width:"auto"});_tcp._menu.find(".nxp_currenttime,.nxp_totaltime").hide()}else{if(_tcp._template!="minimalwithright")_tcp._menu.find(".nxp_currenttime,.nxp_totaltime").show();_tcp._menu.find(".nxp_progressholder").css({width:(w==
0?_tcp._width:w)-elc*30-(tv?50:0)-add+"px"})}}_tcp._menu.find(".nxp_sidebaritem").removeClass("nxp_hiddenforsize");var mi=(_tcp._height-160)/50;_tcp._menu.find(".nxp_sidebaritem:visible").each(function(i,j){if(i>mi)jQuery(this).addClass("nxp_hiddenforsize")});if(_tcp._menu.find(".nxp_scroller").length>0){_tcp._menu.find(".nxp_scroller").removeAttr("style");var h=_tcp._menu.find(".nxp_sociallayer[data-context='info']").height();_tcp._menu.find(".nxp_scroller").css({height:h+"px"})}if(_tcp._menu.find(".nxp_suggestions").length>
0&&_tcp._flow.revolver.items&&_tcp._flow.revolver.items.length){var t="";var ch=Math.min(.18*_tcp._height,180);var cw=ch*1.62+20;var me=Math.min(_tcp._flow.revolver.items.length,Math.floor(_tcp._width*.86/cw));var j;var a=_play.config.client.thumbversion=="alternate"?"_alt":"";for(var l=0;l<me;l++){j=_tcp._flow.revolver.items[l];var cp=j["imagedata"]["thumb"+a];if(_play.system.capabilities.hasWebP&&_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)cp=cp.replace(".jpg",".webp");t+="<img tabindex='7' class='nxp_actionimg' src='"+
cp+"' style='max-width:"+cw+"px;height:"+ch+"px;' data-tooltip='"+j["general"]["title"]+"' data-command='exitswap' data-param='"+j["general"]["ID"]+"' />"}_tcp._menu.find(".nxp_suggestions").html(t);_tcp._ui.updateTooltips()}if(_tcp._playingAd)if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.handleResize();else _tcp._flow.ad.vpaid.handleResize()}else _play.tools.log("SKIPPING UPDATING UI","HALCYON")},onIntersection:function(){if(_tcp._visibilityRatio<.5){if(!_tcp._stream.m.paused||
_tcp._playingAd||_tcp._isCasting)if(_tcp._intersectionMode==1||_play.system.device.type=="mobile"){if(_tcp._playingAd||_tcp._stream.m.paused||_tcp._stream.isRunning()){_tcp._pausedByIntersect=true;_tcp._playPauseByUser=false;_tcp._ia.interact("pause")}}else{_play.system.environment.isPopOut=true;_tcp._el.addClass("nxp_popout");var w=.2*_play.system.device.width;w=Math.max(w,400);_tcp._el.css({width:w+"px",height:_tcp._config.aspectRatio*w+"px"});_tcp._ui.onResize();if(!_tcp._stream.events.hadPopout){_tcp._stream.events.hadPopout=
true;_tcp._data.emitEvent(_samaritan.events.POPOUT,{})}}}else if(_tcp._intersectionMode==1||_play.system.device.type=="mobile"){if(_tcp._pausedByIntersect){_tcp._pausedByIntersect=false;if(!_tcp._isCasting)_tcp._ia.interact("play")}}else if(_tcp._el.hasClass("nxp_popout")){_play.system.environment.isPopOut=false;_tcp._el.removeClass("nxp_popout");_tcp._el.css({width:"100%",height:"100%"});_tcp._ui.onResize()}},afterPlay:function(){_tcp._ended=true;_tcp._ia.onEnterPlayer();_tcp._menu.find(".nxp_actionicon[data-command='play']").removeClass("nxp_icon-play").addClass("nxp_icon-restart").attr("data-tooltip",
_play._factory.tools.getMimeClientText(_tcp._playmode,"option_play"));_tcp._ui.updateTooltips();if(_play.system.environment.isCasted&&!_tcp._useRevolver)jQuery("#chromecast-receiver-preload").removeClass("hidden");if(_play.system.fullscreen.useLegacy)_play.system.fullscreen.exit()},panorama:{viewer:null,renderer:null,lastClick:0,build:function(){if(typeof pannellum=="undefined")window.setTimeout(function(){_tcp._ui.panorama.build()},250);else{_play.tools.log("BUILDING PANORAMA","HALCYON");_tcp._area.prepend("<div id='nxp_pano"+
_tcp._index+"'></div>");var config={type:"equirectangular",dynamic:_tcp._mime=="video",showZoomCtrl:false,showFullscreenCtrl:false,autoLoad:true,keyboardZoom:false,mouseZoom:false,doubleClickZoom:false,orientationOnByDefault:_play.system.isMobile(),panorama:_tcp._mime=="image"?_play.tools.getMaxImage(_tcp._data.getMediaObject("imagedata")):document.getElementById("nxp_player"+_tcp._index)};_tcp._el.addClass("nxp_panograb");_tcp._ui.panorama.viewer=pannellum.viewer(document.getElementById("nxp_pano"+
_tcp._index),config);if(_tcp._mime=="video"){_tcp._ui.panorama.viewer.on("mousedown",_tcp._ui.panorama.startClick);_tcp._ui.panorama.viewer.on("mouseup",_tcp._ui.panorama.handleClick);_tcp._ui.panorama.viewer.on("touchstart",_tcp._ui.panorama.startClick);_tcp._ui.panorama.viewer.on("touchend",_tcp._ui.panorama.handleClick);jQuery("#nxp_player"+_tcp._index).hide();_tcp._ui.panorama.startUpdate()}else _tcp._data.reportPlay();_tcp._ui.panorama.getRenderer()}},startUpdate:function(){if(_tcp._ui.panorama.viewer){_play.tools.log("START PANORAMA UPDATE",
"HALCYON");_tcp._ui.panorama.viewer.setUpdate(true)}},stopUpdate:function(){if(_tcp._ui.panorama.viewer){_play.tools.log("PAUSING PANORAMA UPDATE","HALCYON");_tcp._ui.panorama.viewer.setUpdate(false)}},getRenderer:function(){_tcp._ui.panorama.renderer=_tcp._ui.panorama.viewer.getRenderer();if(!_tcp._ui.panorama.renderer)window.setTimeout(_tcp._ui.panorama.getRenderer,250)},destroy:function(){_tcp._el.removeClass("nxp_panograb");if(_tcp._ui.panorama.viewer)_tcp._ui.panorama.viewer.setUpdate(false);
if(_tcp._ui.panorama.renderer){_play.tools.log("DESTROYING PANORAMA","HALCYON");_tcp._ui.panorama.renderer.destroy()}_tcp._ui.panorama.renderer=null;_tcp._ui.panorama.viewer=null;jQuery("#nxp_player"+_tcp._index).show();jQuery("#nxp_pano"+_tcp._index).remove()},startClick:function(){_tcp._ui.panorama.lastClick=_play.session.getTime(true);return true},handleClick:function(){var diff=_play.session.getTime(true)-_tcp._ui.panorama.lastClick;if(diff<=250)_tcp._ia.onOverlayClick();return true}},menu:{build:function(){var mc=
2;_play.tools.log("BUILDING MENU","HALCYON");_tcp._menu.find(".nxp_title,.nxp_subtitle,.nxp_sideicon").remove();if(_play.tools.parseInt(_tcp._titleMode)>0){var s=_tcp._ui.getSubtitle();if(_play.config.client.titlestyle=="top")_tcp._menu.append("<div class='nxp_title nxp_bg nxp_toptitle'><div>"+_tcp._data.getMedia("title")+"</div>"+(s!=""?"<div class='nxp_topsubtitle'>"+s+"</div>":"")+"</div>");else{_tcp._menu.append("<div class='nxp_title nxp_bg nxp_roundedleft'>"+_tcp._data.getMedia("title")+"</div>");
if(s!="")_tcp._menu.append("<div class='nxp_subtitle nxp_bg nxp_roundedleft'>"+s+"</div>")}}if(_tcp._mime!="image"){if(!_play.system.isTV())_tcp._menu.find(".nxp_menubar").remove();else _tcp._menu.find(".nxp_tvmenu").remove();_tcp._menu.append("<div class='nxp_menubar nxp_bg"+(_play.config.client.tilestyle!="squared"?_tcp._template=="float"?" nxp_rounded":" nxp_roundedright":"")+"'></div>");_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-pause' data-command='pause' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_noplay")+"'></div>");if(_play.tools.parseInt(_play.config.client.allowseekbuttons)>0&&_tcp._playlist&&_tcp._playlist.length&&_tcp._playlist.length==1&&!_tcp._live){mc+=2;_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-seekbackward' data-command='seekleft' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_seek_minus").replace("{seekdur}",_play.config.client.allowseekbuttons)+
"'></div>");_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-seekforward' data-command='seekright' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_seek_plus").replace("{seekdur}",_play.config.client.allowseekbuttons)+"'></div>")}if(_tcp._playlist.length>1&&["playlist","audioalbum","videolist","audiolist","collection"].indexOf(_tcp._playmode)>-1&&!_tcp._masked){mc+=2;var s="";var cp=_tcp._playpos;if(cp<0)cp=0;var sks="";var ppos=
cp-1;if(ppos<0)ppos=_tcp._playlist.length-1;var b="<div tabindex='4' class='nxp_actionicon nxp_icon-prev' data-command='prev'  data-tooltip=\""+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_prev")+":<br /><b style='color:#"+_play.config.client.subtitlefontcolor+"'>"+_tcp._playlist[ppos]["general"]["title"].replace(/"/ig,"'")+'</b>"></div>';sks+=b;s+=b.replace("nxp_actionicon","nxp_sideicon");ppos=cp+1;if(ppos>=_tcp._playlist.length)ppos=0;b="<div tabindex='4' class='nxp_actionicon nxp_icon-next' data-command='next'  data-tooltip=\""+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_next")+":<br /><b style='color:#"+_play.config.client.subtitlefontcolor+"'>"+_tcp._playlist[ppos]["general"]["title"].replace(/"/ig,"'")+'</b>"></div>';sks+=b;s+=b.replace("nxp_actionicon","nxp_sideicon");_tcp._menu.find(".nxp_menubar").append(sks);if(!_play.system.isTV()&&!_play.system.environment.isCasted&&_tcp._mime=="video")_tcp._menu.append(s)}if(_play.system.capabilities.hasFullscreen&&_tcp._mime=="video"&&!_play.system.isTV()&&
!(_play.system.environment.isApp&&!_app.config.useAppPlayer&&!_app.config.hasPhysicalPlayer))if(!_tcp._isPanorama||!_play.system.fullscreen.useLegacy){mc++;if(_play.system.environment.isFullscreen)_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-"+_tcp._ui.getFullscreenIcon(false)+"' data-command='nofullscreen' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nofullscreen")+"'></div>");else _tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-"+
_tcp._ui.getFullscreenIcon(true)+"' data-command='fullscreen' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_fullscreen")+"'></div>")}if(_tcp._flow.prevVideo>0){mc++;_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-history' data-command='historyback' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_return")+"'></div>")}if(_tcp._playmode=="audioalbum"&&_tcp._playlist.length>1){mc++;if(_tcp._orderMode==
"straight")_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-shuffle' data-command='shuffle' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_order_random")+"'></div>");else _tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-loop' data-command='loop' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_order_straight")+"'></div>")}var hasMute=_tcp._useFullPlayer;if(hasMute)if(_play.system.isIOS())if(_play.system.device.platform!=
"tablet")if(_tcp._autofullscreen==1)hasMute=false;if(_play.tools.parseInt(_tcp._data.getMedia("hasAudio","features"))==1&&hasMute&&!_play.system.isTV()){if(!_tcp._muted)_tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-mute' data-command='mute' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_mute")+"'></div>");else _tcp._menu.find(".nxp_menubar").append("<div tabindex='4' class='nxp_actionicon nxp_icon-unmute' data-command='nomute' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nomute")+"'></div>");if(_tcp._useVolume)if(_tcp._template!="centered"||_tcp._usesForcedTemplate){_tcp._menu.find(".nxp_menubar").append("<div class='nxp_volumeholder'><div class='nxp_innerprogress' style='width:"+_tcp._lastVolume*100+"%'></div></div>");if(_tcp._muted)_tcp._el.find(".nxp_volumeholder .nxp_innerprogress").css({display:"none"})}}if((_tcp._template=="centered"||_tcp._template=="glass66")&&!_tcp._usesForcedTemplate){_tcp._menu.find(".nxp_iconset").remove();
var els=_tcp._menu.find(".nxp_menubar .nxp_actionicon").detach();_tcp._menu.find(".nxp_menubar").append("<div class='nxp_iconset'></div>");_tcp._menu.find(".nxp_iconset").append(els);if(_tcp._template=="glass66"&&_play.config.client.progbarheight=="thin")_tcp._menu.find(".nxp_menubar").addClass("nxp_iconset_thin");if(_tcp._template=="glass66"&&_tcp._useVolume){var vs=_tcp._menu.find(".nxp_volumeholder").detach();_tcp._menu.find(".nxp_iconset").append(vs)}}_tcp._menu.find(".nxp_volumeholder").click(function(e){var d=
(e.pageX-jQuery(this).offset().left)/jQuery(this).width();_tcp._ia.interact("setvolume",d)});if((!_tcp._live||_tcp._dvr)&&!_tcp._usePreview){if(_tcp._template=="default"||_tcp._usesForcedTemplate){var m="";if(_play.system.isTV()){_tcp._menu.find(".nxp_volumeholder").remove();m="<div class='nxp_tvmenu'>"+_tcp._menu.find(".nxp_menubar").html()+"</div>";_tcp._menu.find(".nxp_menubar").remove()}_tcp._menu.append("<div class='nxp_progressbar nxp_bg nxp_roundedleft"+(_play.system.isTV()?" nxp_tv_maxed":
"")+"'><div class='nxp_progressholder nxp_progress_"+_play.config.client.progbarheight+(_play.config.client.tilestyle!="squared"?" nxp_rounded":"")+"'><div class='nxp_innerprogress'><div class='nxp_hand'></div></div></div><div class='nxp_currenttime'>--:--</div><div class='nxp_totaltime'><div class='nxp_totaltimedisplay'>--:--</div></div>"+m+"</div>")}else{_tcp._menu.find(".nxp_menubar").append("<div class='nxp_progressholder nxp_progress_"+_play.config.client.progbarheight+(_play.config.client.tilestyle!=
"squared"?" nxp_rounded":"")+"'><div class='nxp_innerprogress'><div class='nxp_hand'></div></div></div>");if(_tcp._template=="minimalwithtime"||_tcp._template=="minimalwithright"||_tcp._template=="buntede"||_tcp._template=="centered"||_tcp._template=="glass"||_tcp._template=="glass66"||_tcp._template=="float"){_tcp._menu.find(".nxp_progressholder").after("<div class='nxp_currenttime nxp_extended'>00:00</div><div class='nxp_totaltime'><div class='nxp_totaltimedisplay'>00:00</div>");if(_tcp._template==
"glass"||_tcp._template=="buntede")jQuery(".nxp_totaltimedisplay").remove();else if(_tcp._template=="minimalwithright")jQuery(".nxp_currenttime").remove();if(_tcp._width<_play.config.constants.TIMES_MIN_WIDTH){_tcp._menu.find(".nxp_progressholder").css({width:"auto"});if(_tcp._template!="centered"&&_tcp._template!="glass66"||_tcp._width<400)_tcp._menu.find(".nxp_currenttime,.nxp_totaltime").hide()}}}_tcp._menu.find(".nxp_progressholder").click(function(e){var d;if(_tcp._template=="default"||_tcp._usesForcedTemplate)d=
(e.pageX-10-jQuery(this).parent().offset().left)/jQuery(this).width();else d=(e.pageX-jQuery(this).offset().left)/jQuery(this).width();_tcp._stream.updateCurrentTime(d*_tcp._stream.dur);_tcp._playPauseByUser=true;_tcp._ia.interact("seek",_tcp._stream.startPos+d*_tcp._stream.dur);_play._factory.ui.tooltip.hide()});if(!_play.system.capabilities.hasTouch){_tcp._menu.find(".nxp_hand").mousedown(function(){_play.tools.log("START SEEK VIA DRAG","HALCYON");_tcp._ui.isDragging=true});_tcp._menu.find(".nxp_progressholder").mouseup(function(){if(_tcp._ui.isDragging){_play.tools.log("STOP SEEK VIA DRAG",
"HALCYON");var p=jQuery(this).find(".nxp_innerprogress").width()/jQuery(this).width();_tcp._ui.isDragging=false;_tcp._stream.updateCurrentTime(p*_tcp._stream.dur);_tcp._playPauseByUser=true;_tcp._ia.interact("seek",_tcp._stream.startPos+p*_tcp._stream.dur);_play._factory.ui.tooltip.hide()}});_tcp._menu.find(".nxp_progressholder").attr("data-tooltip","");if(!_tcp._ui.useThumbs||_tcp._width<_play.config.constants.TOOLTIP_MIN_WIDTH)_tcp._menu.find(".nxp_progressholder").mousemove(function(e){if(_tcp._stream.dur>
0&&!_tcp._playingAd){var d=_tcp._ui.menu.getClickPosition(jQuery(this),e,false);var v=_play._factory.tools.formatTime(d*_tcp._stream.dur,_tcp._stream.useHours);jQuery(this).attr("data-tooltip",v);_play._factory.ui.tooltip.trigger();if(_tcp._ui.isDragging)_tcp._stream.updateCurrentTime(d*_tcp._stream.dur,true)}});else{_tcp._menu.find(".nxp_progressholder").mouseenter(function(e){_play._factory.ui.tooltip.setYPos(_play.system.environment.isFullscreen||_play.system.environment.isEmbedded?-140:-90)});
_tcp._menu.find(".nxp_progressholder").mouseleave(function(e){_play._factory.ui.tooltip.setYPos(0)});_tcp._menu.find(".nxp_progressholder").mousemove(function(e){if(_tcp._stream.dur>0&&!_tcp._playingAd){var d=_tcp._ui.menu.getClickPosition(jQuery(this),e,false);var f=_play.tools.parseInt(_tcp._data.getMediaReal("thumbInterval","streamdata"))||10;var v=_play._factory.tools.formatTime(d*_tcp._stream.dur,_tcp._stream.useHours);var ip=Math.floor(Math.floor(d*_tcp._stream.m.duration)/f)*f;if(_tcp._playmode==
"scene")ip+=Math.floor(Math.floor(_tcp._data.getMedia("validfrom_raw","streamdata"))/f)*f;_play._factory.ui.tooltip.trigger("<div class='nxp_slidingpreview'><img src='"+_play.config.constants.THUMBROOT+"vod/"+_tcp._data.getMedia(_tcp._playmode=="scene"?"parentID":"ID")+"/"+ip+".jpg?fv="+_tcp._data.getMedia("fileversion")+"' /><div>"+v+"</div></div>");if(_tcp._ui.isDragging)_tcp._stream.updateCurrentTime(d*_tcp._stream.dur,true)}})}}else{_tcp._menu.find(".nxp_progressholder").on("touchstart",function(e){_play.tools.log("START SEEK VIA TOUCH",
"HALCYON");_tcp._ui.isDragging=true;var d=_tcp._ui.menu.getClickPosition(jQuery(this),e,true);_tcp._stream.updateCurrentTime(d*_tcp._stream.dur,true)});_tcp._menu.find(".nxp_progressholder").on("touchmove",function(e){if(_tcp._ui.isDragging&&e.originalEvent&&e.originalEvent.targetTouches){var d=_tcp._ui.menu.getClickPosition(jQuery(this),e,true);var v=_play._factory.tools.formatTime(d*_tcp._stream.dur,_tcp._stream.useHours);jQuery(this).attr("data-tooltip",v);if(!_tcp._ui.useThumbs||_tcp._width<_play.config.constants.TOOLTIP_MIN_WIDTH)_play._factory.ui.tooltip.triggerTouch(e.originalEvent.touches[0].pageX,
e.originalEvent.touches[0].pageY-42,v);else{var f=_play.tools.parseInt(_tcp._data.getMediaReal("thumbInterval","streamdata"))||10;var ip=Math.floor(Math.floor(d*_tcp._stream.m.duration)/f)*f;if(_tcp._playmode=="scene")ip+=Math.floor(Math.floor(_tcp._data.getMedia("validfrom_raw","streamdata"))/f)*f;_play._factory.ui.tooltip.triggerTouch(e.originalEvent.touches[0].pageX-60,e.originalEvent.touches[0].pageY-150,"<div class='nxp_slidingpreview'><img src='"+_play.config.constants.THUMBROOT+"vod/"+_tcp._data.getMedia(_tcp._playmode==
"scene"?"parentID":"ID")+"/"+ip+".jpg' /><div>"+v+"</div></div>")}_tcp._stream.updateCurrentTime(d*_tcp._stream.dur,true)}});_tcp._menu.find(".nxp_progressholder").on("touchend",function(){_play._factory.ui.tooltip.hide();if(_tcp._ui.isDragging){_play.tools.log("STOP SEEK VIA TOUCH","HALCYON");var p=jQuery(this).find(".nxp_innerprogress").width()/jQuery(this).width();_tcp._ui.isDragging=false;_tcp._stream.updateCurrentTime(p*_tcp._stream.dur);_tcp._playPauseByUser=true;_tcp._ia.interact("seek",_tcp._stream.startPos+
p*_tcp._stream.dur)}})}if(_tcp._xmode=="timeoverlay"){var sc=_tcp._data.getMediaObject("scenedata");if(sc&&sc.length&&sc.length>0){var d=_play._factory.tools.formatSeconds(_tcp._data.getMedia("runtime"));var os=100/d;var t="<div class='nxp_scenehints'>";jQuery.each(sc,function(i,j){t+="<div class='nxp_iscene' data-tooltip='"+j.general.title+"' style='left:"+os*j.general.validfrom_raw+"%;width:5px;'></div>"});t+="</div>";_tcp._menu.find(".nxp_progressholder .nxp_innerprogress").after(t)}}}else if(_play.system.environment.isCasted||
_play.system.isTV())_tcp._menu.append("<div class='nxp_progressbar nxp_bg nxp_rounded'><div class='nxp_castaddon'></div></div>");if(_play.system.environment.isCasted||_play.system.isTV())_tcp._menu.find(".nxp_castaddon").html("<div class='nxp_casttext'><div class='nxp_casttitle'>"+_tcp._data.getMedia("title")+"</div>"+(_tcp._data.getMedia("subtitle")!=""?"<div class='nxp_castsubtitle'>"+_tcp._data.getMedia("subtitle")+"</div>":"")+"</div>");if(_play.system.isTV()){_play.tools.log("UPDATE TV CONTROL",
"HALCYON");_app.addons.tv.afterNavigation();_app.addons.tv.updatePlayerControl()}}},handleMode:function(){_tcp._fixedMenu=_tcp._hiddenMenu=false;if(_play.tools.parseInt(_tcp._menuMode)==2||_tcp._mime=="audio"){_tcp._ui.show();_tcp._fixedMenu=true}else if(_play.tools.parseInt(_tcp._menuMode)==0){_tcp._ui.hide();_tcp._hiddenMenu=true}if(_tcp._mime=="audio")_tcp._titleMode=1;else if(_tcp._config.titleMode>-1)_tcp._titleMode=_tcp._config.titleMode;else _tcp._titleMode=_play.config.client.allowtitle},
getClickPosition:function(el,e,isTouch){var d;var px=e.pageX;if(isTouch)px=e.originalEvent.touches[0].pageX;if(_tcp._template=="default"||_tcp._usesForcedTemplate)d=(px-10-el.parent().offset().left)/el.width();else d=(px-el.offset().left)/el.width();d=Math.max(d,0);d=Math.min(d,1);return d}},sidebar:{build:function(){_play.tools.log("BUILDING SIDEBAR","HALCYON");_tcp._el.find(".nxp_sidebar").remove();var is;var sb="<div class='nxp_sidebar"+(_play.config.client.titlestyle=="top"&&_play.tools.parseInt(_tcp._titleMode)==
1?" nxp_toptitleactive":"")+"'>";if(_tcp._mime=="image"){if(_play.system.capabilities.hasFullscreen&&!_play.system.fullscreen.useLegacy)if(_play.system.environment.isFullscreen)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded'  data-command='nofullscreen' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nofullscreen")+"'><div class='nxp_icon-"+_tcp._ui.getFullscreenIcon(false)+"'></div></div>";else sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded'  data-command='fullscreen' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_fullscreen")+"'><div class='nxp_icon-"+_tcp._ui.getFullscreenIcon(true)+"'></div></div>"}else{if(_tcp._xmode==""){if(!_play._factory.tools.checkDomain()&&_play.tools.parseInt(_play.config.client.allowexternallink)==1&&_play.config.client["sharelinktemplate"+(_tcp._streamtype!="video"?_tcp._streamtype:"")]!="")sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='externallink' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_externalplay").replace("{dom}",_play.config.client.domain)+"'><div class='nxp_icon-externalplay'></div></div>";if(_play.system.capabilities.hasCast&&!_tcp._usePreview&&_tcp._config.disableRemoteTarget==0&&_tcp._mime=="video")sb+="<span class='nxp_cchider'"+(!_play.addons.cast.sender.inited?" style='display:none;'":"")+"><button tabindex='3' style='border:none;width:38px;height:38px;' class='nxp_sidebaritem nxp_bg nxp_rounded' is='google-cast-button' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_cast")+"'></button></span>";if(_play.tools.parseInt(_play.config.client.allowdescription)==1)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='info' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_info")+"'><div class='nxp_icon-info'></div></div>";if(_tcp._willUseSHAKA&&_play.tools.parseInt(_play.config.client.allowstreamindex)==1)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded'"+(!_tcp._hasMBR?" style='display:none !important;'":
"")+" data-command='streamsettings' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_settings")+"'><div class='nxp_icon-settings'></div></div>";if(_tcp._willUseSHAKA)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded'"+(!_tcp._stream.multiAudio.isAvailable?" style='display:none !important;'":"")+" data-command='toggleaudio' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_toggleaudio")+"'><div class='nxp_icon-language'></div></div>";
if(_tcp._captionMode!="none"&&(!_play.system.isIE()||_play.system.getIEVersion()>=11)){var c=_tcp._data.getMediaObject("captiondata");if(!_tcp._startMode&&c&&c.length>0){_tcp._hasCaptions=true;sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='subtitles' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_subtitles")+"'><div class='nxp_icon-captions'></div></div>"}}if(_tcp._mime=="video"&&_play.system.capabilities.hasAirPlay&&!_tcp._usePreview&&
_tcp._config.disableRemoteTarget==0)sb+="<div tabindex='3'"+(!_tcp._hasAirPlay?" style='display:none;'":"")+" class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='airplay' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_airplay")+"'><div class='nxp_icon-airplay'></div></div>";if(_tcp._mime=="video"&&_play.system.capabilities.hasPIP&&!_tcp._usePreview&&_tcp._config.disableRemoteTarget==0&&(!_tcp._useAds||_play.system.isWinApp()||_tcp._admodel.type.indexOf("ima")==
-1)&&(_play.system.environment.isApp||_play.system.device!="mobile"))sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='pip' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_pip")+"'><div class='nxp_icon-pip'></div></div>";if(_play.system.device.platform!="fbia"&&_play.system.device.platform!="amp"&&_play.tools.parseInt(_play.config.client.allowsocial)==1)if(!_tcp._masked){sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='"+
(_play.system.capabilities.hasNativeShare?"nativeshare":"share")+"' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_share")+"'><div class='nxp_icon-"+_play.config.client.shareicon+"'></div></div>";if(!_play.system.isMobile()&&_play.tools.parseInt(_tcp._data.getMedia("shouldAllowEmbed","statusdata"))==1&&_play.tools.parseInt(_play.config.client.allowembed)==1&&_play.tools.parseInt(_play.config.client.allowexternalplay)==1)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='embed' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_embed")+"'><div class='nxp_icon-embed'></div></div>"}if(!_tcp._startMode&&_tcp._config.enableLightsOut==1&&!_play.system.environment.isEmbedded)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded lighttoggle' data-command='togglelight' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_togglelight")+"'><div class='nxp_icon-bulb'></div></div>";if(!_tcp._startMode&&_play.tools.parseInt(_play.config.user.id)>
0&&_tcp._config.dataMode==_play.config.constants.DATAMODE_API){if(!_tcp._usePreview&&_play.tools.parseInt(_play.config.client.usefavourites)==1){is=_play.tools.parseInt(_tcp._data.getMedia("inFavourites","interactiondata"))==1;sb+="<div class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='"+(!is?"tofavourites":"fromfavourites")+"' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_"+(!is?"tofavourites":"notofavourites"))+"'><div class='nxp_icon-"+(!is?"tofavourites":
"fromfavourites")+"'></div></div>"}if(!_tcp._usePreview&&_play.tools.parseInt(_play.config.client.uselikes)==1){is=_play.tools.parseInt(_tcp._data.getMedia("isLiked","interactiondata"))==1;sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='"+(!is?"like":"nolike")+"' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_"+(!is?"like":"nolike"))+"'><div class='nxp_icon-"+(!is?"like":"dislike")+"'></div></div>"}}if(!_tcp._startMode&&!_tcp._usePreview&&
_play.tools.parseInt(_play.config.client.allowrate)==1&&_tcp._config.dataMode==_play.config.constants.DATAMODE_API)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='rate' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_rate")+"'><div class='nxp_icon-star'></div></div>";var s=_tcp._data.getMediaObject("scenedata");if(!_tcp._startMode&&_play.tools.parseInt(_play.config.client.allowscenes)==1&&s&&s.length>0&&!_tcp._isPseudoLive)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='scenes' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_scenes")+"'><div class='nxp_icon-scenes'></div></div>";var hastm=_tcp._mime=="video"&&!_tcp._live&&_play.tools.parseInt(_play.config.client.allowtrickplay)==1;if(hastm)if(_play.system.isAndroid()&&_play.system.getAndroidVersion(true)<5)tm=false;else if(_play.system.isIOS())tm=false;if(hastm)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='speed' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_speed")+"'><div class='nxp_icon-speed'></div></div>"}if(_play.system.environment.isOMNIA){if(_tcp._xmode!=""){sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='setstart' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_setstart")+"'><div class='nxp_icon-setstart'></div></div>";sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='setend' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_setend")+"'><div class='nxp_icon-setend'></div></div>"}if(_tcp._mime=="video"&&!_tcp._live)sb+="<div tabindex='3' class='nxp_sidebaritem nxp_bg nxp_rounded' data-command='screenshot' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_screenshot")+"'><div class='nxp_icon-capture'></div></div>"}}sb+="</div>";_tcp._menu.append(sb);_tcp._ui.onResize()}},exitdisplay:{tmr:null,counter:0,revolverCanceled:false,willRevolver:function(){var t=_tcp._height>=_play.config.constants.EXITDISPLAY_MIN_HEIGHT&&
!_play.system.environment.isFullscreen;if(!t)if(!_play.system.isIOS())t=_play.system.environment.isFullscreen;return t},build:function(){if(_tcp._flow.revolver.items){_tcp._ui.addons.layer.remove();_tcp._ui.addons.spots.clear(true);_tcp._ui.exitdisplay.counter=0;var t="";var a=_play.config.client.thumbversion=="alternate"?"_alt":"";var ss="";var cp;if(_tcp._useRevolver&&!_tcp._ui.exitdisplay.revolverCanceled){cp=_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb"+a];if(_play.system.capabilities.hasWebP&&
_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)cp=cp.replace(".jpg",".webp");if(_play.tools.parseInt(_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb_hasX2"])>0)if(_tcp._width<=_play.config.constants.THRESHOLD_HQ){ss=" srcset='"+cp+" 1x, "+_play.tools.getImageVersion(cp,2)+" 2x";if(_play.tools.parseInt(_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb_hasX3"])>0)ss+=", "+_play.tools.getImageVersion(cp,3)+" 3x";ss+="'"}else{if(_play.tools.parseInt(_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["imagedata"]["thumb_hasX3"])>
0)ss=" srcset='"+cp+" 1x, "+_play.tools.getImageVersion(cp,3)+" 2x'";cp=_play.tools.getImageVersion(cp,2)}t+="<img class='nxp_exitimage behave"+(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+cp+"'"+ss+" />";t+="<div class='nxp_revolverslogan'><div class='nxp_rvs1'>"+_play.tools.getClientText("autoplayvideo").replace("{pos}",_play.config.client.autoPlayNextSeconds)+"</div><div class='nxp_rvs2'>"+_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["general"]["title"]+
"</div>";if(_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["general"]["subtitle"]!="")t+="<div class='nxp_rvs3'>"+_tcp._flow.revolver.items[_tcp._flow.revolver.chosenIndex]["general"]["subtitle"]+"</div>";t+="</div>";if(!_play.system.environment.isCasted){_tcp._menu.append("<div tabindex='1' class='nxp_button nxp_rvcancel' data-command='cancelrevolver'>"+_play.tools.getClientText("docancel")+"</div>");_tcp._ui.visualresponse.addStatic("revolver")}_tcp._ui.exitdisplay.tmr=window.setInterval(function(){_tcp._ui.exitdisplay.updateRevolver()},
1E3);if(_play.system.isTV())_app.addons.tv.onRevolverDisplay()}else{ss="";cp=_tcp._data.getMedia("thumb"+a,"imagedata");if(_play.system.capabilities.hasWebP&&_tcp._config.dataMode==_play.config.constants.DATAMODE_STATIC)cp=cp.replace(".jpg",".webp");if(_play.tools.parseInt(_tcp._data.getMedia("thumb_hasX2","imagedata"))>0){ss=" srcset='"+cp+" 1x, "+_play.tools.getImageVersion(cp,2)+" 2x";if(_play.tools.parseInt(_tcp._data.getMedia("thumb_hasX3","imagedata"))>0)ss+=", "+_play.tools.getImageVersion(cp,
3)+" 3x";ss+="'"}_tcp._ui.visualresponse.addStatic("restart","restart",true);t+="<img class='nxp_exitimage behave"+(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+cp+"'"+ss+" />";_tcp._menu.append("<div class='nxp_suggestions'></div>");if(_play.system.isTV())_app.addons.tv.onExitDisplay()}_tcp._area.append("<div class='nxp_exit' style='display:none;'>"+t+"</div>");_tcp._area.find(".nxp_exit").stop().fadeIn("slow");_tcp._ui.onResize()}else window.setTimeout(function(){_tcp._ui.exitdisplay.build()},
1E3)},killTimer:function(){_tcp._menu.find(".nxp_rvcancel").remove();if(_tcp._ui.exitdisplay.tmr)window.clearInterval(_tcp._ui.exitdisplay.tmr)},updateRevolver:function(){_tcp._ui.exitdisplay.counter++;var target=_play.system.environment.isCasted?3:_play.tools.parseInt(_play.config.client.autoPlayNextSeconds);if(!_play.system.environment.isCasted&&_play.system.isTV())target=15;if(_tcp._ui.exitdisplay.counter>=target){_tcp._playedVia="revolver";_tcp._ui.exitdisplay.killTimer();_tcp._flow.revolver.andGo()}else _tcp._area.find(".nxp_rvs1").html(_play.tools.getClientText("autoplayvideo").replace("{pos}",
target-_tcp._ui.exitdisplay.counter))},cancelRevolver:function(){_tcp._ui.visualresponse.removeAll();_tcp._area.find(".nxp_exit").remove();_tcp._ui.exitdisplay.killTimer();_tcp._ui.exitdisplay.revolverCanceled=true;_tcp._ui.exitdisplay.build()}},audiodisplay:{build:function(){_tcp._el.find(".nxp_audioholder,.nxp_audiocover").remove();var cov=_play.tools.getMaxImage(_tcp._data.getMediaObject("imagedata"));_tcp._area.after("<div class='nxp_audioholder'><div class='nxp_audiodisplay'><img class='behave"+
(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+cov+"' /></div><img class='nxp_audiocover' src='"+cov+"' /></div>")}},castdisplay:{build:function(){var idata=_tcp._ui.getStartImageData();_tcp._el.find(".nxp_casting").remove();var t="<div class='nxp_casting'><img class='behave"+(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+idata[0]+"'"+idata[1]+" /><div class='nxp_castshadow'></div><div class='nxp_innercasting'><div class='nxp_icon-cast_connected'></div><div class='nxp_textcasting'>"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"iscasting").replace("{video}","'"+_tcp._data.getMediaReal("title")+"'")+"<br /><b>"+_play.addons.cast.sender.getReceiverName()+"</b></div></div></div>";_tcp._overlay.append(t)},remove:function(){_tcp._overlay.find(".nxp_casting").remove()}},livedisplay:{diff:0,tmr:null,build:function(){var idata;if(_tcp._data.getMedia("thumb_preslate","imagedata").indexOf("nodata")==-1)idata=[_tcp._data.getMedia("thumb_preslate","imagedata"),""];else idata=
_tcp._ui.getStartImageData();_tcp._ui.livedisplay.diff=_tcp._data.getMedia("validfrom","streamdata")-_play.session.getTime();_tcp._area.append("<div id='nxp_startimage"+_tcp._index+"' class='cl_nxp_startimage'><img class='behave"+(_tcp._useMiniPlayer?"width":_play.config.client.autoplayscalemode)+"' src='"+idata[0]+"'"+idata[1]+" /></div>");_tcp._ui.addons.notice.build(_play.tools.getClientText("livepreslogan").replace("{time}",_play._factory.tools.formatTime(_tcp._ui.livedisplay.diff,true)),true,
"prelive");_tcp._ui.livedisplay.tmr=window.setInterval(function(){_tcp._ui.livedisplay.update()},1E3)},update:function(){_tcp._ui.livedisplay.diff--;if(_tcp._ui.livedisplay.diff<=0)_tcp._ui.livedisplay.remove();else _tcp._overlay.find(".nxp_notice[data-context='prelive']").html(_play.tools.getClientText("livepreslogan").replace("{time}",_play._factory.tools.formatTime(_tcp._ui.livedisplay.diff,true)))},remove:function(){_tcp._ui.showLoader();window.clearInterval(_tcp._ui.livedisplay.tmr);_tcp._waitForLive=
false;_tcp._ui.build()}},visualresponse:{counter:0,add:function(v){if(!_tcp._useMiniPlayer){_tcp._menu.append("<div id='nxp_vr_"+_tcp._ui.visualresponse.counter+"' class='nxp_vresponse nxp_bg nxp_rounded'><div class='nxp_icon-"+v+"'></div></div>");window.setTimeout("jQuery('#nxp_vr_"+_tcp._ui.visualresponse.counter+"').remove();",1500);_tcp._ui.visualresponse.counter++}},addStatic:function(v,c,y){c=c||v;if(y)y=" style='top:-100px;'";else if(c=="previewended")y=" style='cursor:default !important;'";
else y="";var ac="";var i="<div class='nxp_icon-"+v+"'></div>";if(c=="init")if(_tcp._template=="buntede"){ac=" nxp_notransition";y=" style='width: auto !important; display: inline-block;height:40px !important;'";i="<div class='nxp_bunte_start'><div class='nxp_icon-play'></div><span>VIDEO ABSPIELEN</span></div>"}else ac+=" nxp_startpos_"+_play.config.client.uistartcontrolpos;if(!_tcp._useMiniPlayer||c=="init"){_play.tools.log("ADDING STATIC OVERLAY "+c,"HALCYON");_tcp._overlay.append("<div tabindex='5' class='nxp_vresponsestatic nxp_bg nxp_rounded"+
ac+"'"+y+" data-command='"+c+"'>"+i+"</div>")}},removeAll:function(){_tcp._overlay.find(".nxp_vresponsestatic").remove()}},addons:{layer:{build:function(m,ka){var dw=0;var i=0;var u="";var skipSecond=false;_play.tools.log("ADDING SOCIAL LAYER FOR "+m,"HALCYON");if(!ka)_tcp._ui.addons.layer.remove();var rc="";if(_play.config.client.tilestyle!="squared"){rc=" nxp_rounded";if(m=="info")rc=" nxp_roundedleft";else if(m=="adcontrol")rc=" nxp_roundedright";else if(m=="ad")rc=" nxp_roundedbottom"}var t="<div class='nxp_sociallayer nxp_bg"+
rc+"' data-context='"+m+"'>";switch(m){case "share":t+="<div class='nxp_socialline'>"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"shareslogan")+"</div>";_play.config.client.shareoptions.split(",").forEach(function(j){if(j&&j!="")if(["whatsapp","messenger"].indexOf(j)==-1||_play.system.isMobile())t+="<img tabindex='7' src='"+_play.config.constants.ARCROOT+"static/share/"+j+".svg' class='nxp_actionimg nxp_shareimg' data-tooltip='"+_play.config.constants.SHARINGOPTIONS[j]+"' data-command='shareon' data-param='"+
j+"' />"});dw=Math.max(300,_play.config.client.shareoptions.split(",").length*60);break;case "externallink":_play.tools.openWindow(_play.config.client["sharelinktemplate"+(_tcp._streamtype!="video"?_tcp._streamtype:"")]+_tcp._data.getMedia(_play.config.client.linkItem));break;case "embed":var ccode=_play.tools.getEmbedCode(_play.config.client.id,_tcp._data.getMedia("hash"),_tcp._playmode,0,null,null,null,null,_play.session.playLicenseHash);t+="<div class='nxp_socialline'>Embed Code</div>";t+="<span class='nxp_linktext'>"+
ccode.replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</span>";if(_play.system.capabilities.hasClipboard)t+="<div class='nxp_button' style='width:170px;' data-clipboard-text=\""+ccode+'">'+_play.tools.getClientText("copytoclipboard")+"</div>";break;case "ad":break;case "adcontrol":if(!_tcp._muted)t+="<div tabindex='4' class='nxp_actionicon nxp_icon-mute' data-command='mute' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_mute")+"'></div>";else t+="<div tabindex='4' class='nxp_actionicon nxp_icon-unmute' data-command='nomute' data-tooltip='"+
_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nomute")+"'></div>";if(_play.system.capabilities.hasFullscreen&&_tcp._mime=="video"&&(!_tcp._usePreview||!_play.system.isIOS())&&!(_play.system.environment.isApp&&!_app.config.useAppPlayer&&!_app.config.hasPhysicalPlayer))if(_play.system.environment.isFullscreen)t+="<div tabindex='4' class='nxp_actionicon nxp_icon-"+_tcp._ui.getFullscreenIcon(false)+"' data-command='nofullscreen' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_nofullscreen")+"'></div>";else t+="<div tabindex='4' class='nxp_actionicon nxp_icon-"+_tcp._ui.getFullscreenIcon(true)+"' data-command='fullscreen' data-tooltip='"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_fullscreen")+"'></div>";break;case "scenes":var s=_tcp._data.getMediaObject("scenedata");var a=_play.config.client.thumbversion=="alternate"?"_alt":"";t+="<div class='nxp_socialline'>"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"sceneslogan")+"</div>";
for(var j=0;j<Math.min(s.length,12);j++)t+="<img tabindex='7' class='nxp_actionimg nxp_scene' data-tooltip='"+s[j]["general"]["title"]+"' data-command='gotoscene' data-param='"+_play._factory.tools.formatSeconds(s[j]["general"]["validfrom"])+"' src='"+s[j]["imagedata"]["thumb"+a].replace("xL","")+"' />";dw=s.length*64+20;break;case "streamsettings":dw=84;t+="<div class='nxp_socialline'>"+_play.tools.getClientText("option_settings")+"</div>";t+="<div data-index='-1' data-itemmode='streamindex' style='margin-left:0;' class='nxp_listitem nxp_bg nxp_rounded"+
(_tcp._desiredQuality==-1?" nxp_activeitem":"")+"'>AUTO</div>";var alr=[];skipSecond=false;var tmp=[];var v=_tcp._dashobj.getVariantTracks();if(v[0].bandwidth>v[1].bandwidth)v=v.reverse();v.forEach(function(j){if(j.mimeType.indexOf("video")==0&&(!_tcp._stream.multiAudio.isAvailable||j.language==_tcp._stream.multiAudio.currentLanguage)){var d=_play._factory.tools.translateVideoQuality(j.height,j.bandwidth);if(tmp.indexOf(d)==-1){tmp.push(d);alr.push({id:j.id,desc:d,active:j.active})}}});dw+=50*alr.length;
if(dw>_tcp._width*.74)skipSecond=true;jQuery(alr).each(function(i,j){if(!skipSecond||i%2==0){var a=j.desc[1];if(a!="")a="<div>"+a+"</div>";if(i<=4||!_tcp._el.hasClass("nxp_xs"))t+="<div data-index='"+j.id+"' data-itemmode='streamindex' class='nxp_listitem nxp_bg nxp_rounded"+(_tcp._desiredQuality==j.id?" nxp_activeitem":"")+(j.active?" nxp_current":"")+"'>"+j.desc[0]+a+"</div>"}});break;case "subtitles":t+="<div class='nxp_socialline'>"+_play.tools.getClientText("option_subtitles")+"</div>";t+="<div data-index='-1' data-itemmode='captionindex' style='margin-left:0;' data-value='' class='nxp_listitem nxp_bg nxp_rounded"+
(_tcp._desiredCaptionLanguage==""?" nxp_activeitem":"")+"'>"+_play.tools.getClientText("no").toUpperCase()+"</div>";dw=240;for(i=0;i<_tcp._stream.m.textTracks.length;i++)if(_tcp._stream.m.textTracks[i].mode!="disabled"&&_tcp._stream.m.textTracks[i].language&&_tcp._stream.m.textTracks[i].language!=""){dw+=40;var d=_tcp._stream.m.textTracks[i].language.toUpperCase();t+="<div data-index='"+i+"' data-value='"+_tcp._stream.m.textTracks[i].language+"' data-itemmode='captionindex' class='nxp_listitem nxp_bg nxp_rounded"+
(_tcp._desiredCaptionLanguage==_tcp._stream.m.textTracks[i].language?" nxp_activeitem":"")+"'>"+d+"</div>"}break;case "info":var st=_tcp._data.getMedia("subtitle");var re=_tcp._data.getMedia("releasedate");if(!re||re==0){re=_tcp._data.getMedia("uploaded");if(!re||re==0)re=_tcp._data.getMedia("created")}t+="<div class='nxp_scroller'><div class='nxp_iscroll'>";if(st&&st!=""){t+="<div class='nxp_socialline'>"+_tcp._data.getMedia("subtitle")+"</div>";t+="<b class='nxp_bigger'>"+_tcp._data.getMedia("title")+
"</b><br /><br />"}else t+="<div class='nxp_socialline'>"+_tcp._data.getMedia("title")+"</div>";var de=_tcp._data.getMedia("teaser");if(!de||de=="")de=_tcp._data.getMedia("description");if(de&&de!=""){if(de.indexOf("<br")==-1)de=de.replace(/(\n)+/g,"<br />");t+=de}t+="<div style='text-align:right;opacity:.75;margin-top:6px;font-size:10px;'>"+_play._factory.tools.formatDate(re)+"</div></div></div>";if(!_tcp._stream.events.hadInfo){_tcp._stream.events.hadInfo=true;_tcp._data.emitEvent(_samaritan.events.ENGAGE,
{action:"info",context:"",value:0})}break;case "toggleaudio":t+="<div class='nxp_socialline'>"+_play.tools.getClientText("option_toggleaudio")+"</div>";dw=200;for(i=0;i<_tcp._stream.multiAudio.langs.length;i++){dw+=40;t+="<div data-index='"+_tcp._stream.multiAudio.langs[i]+"' data-value='"+_tcp._stream.multiAudio.langs[i]+"' data-itemmode='audioindex' class='nxp_listitem nxp_bg nxp_rounded"+(_tcp._stream.multiAudio.currentLanguage==_tcp._stream.multiAudio.langs[i]?" nxp_activeitem":"")+"'>"+_tcp._stream.multiAudio.langs[i].toUpperCase()+
"</div>"}break;case "speed":t+="<div class='nxp_socialline'>"+_play.tools.getClientText("option_speed")+"</div>";dw=384;skipSecond=dw>_tcp._width*.74;jQuery(["0.25","0.50","1.00","1.25","1.50","2.00","3.00"]).each(function(i,j){if(!skipSecond||i%2==0)t+="<div data-value='"+parseFloat(j)+"' data-itemmode='speedindex' class='nxp_listitem nxp_bg nxp_rounded"+(_tcp._desiredSpeed==parseFloat(j)?" nxp_activeitem":"")+"'>"+j+"x</div>"});break;case "rate":var ta=_play.tools.parseInt(_tcp._data.getMedia("rating",
"interactiondata"));var cl=_play.tools.parseInt(_tcp._data.getMedia("canBeRated","interactiondata"))==1?"nxp_enabledrate":"nxp_disabledrate";if(cl=="nxp_enabledrate")t+="<div class='nxp_socialline'>"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"rateslogan")+"</div>";else t+="<div class='nxp_socialline'>"+_play._factory.tools.getMimeClientText(_tcp._streamtype,"alreadyrated")+"</div>";for(i=0;i<5;i++){var r=i+1;t+="<div class='nxp_icon-star nxp_rate "+cl+(r<=ta?" nxp_activerate":"")+"' data-param='"+
r+"'></div>"}dw=300;break}t+="</div>";_tcp._menu.append(t);if(dw>0)_tcp._menu.find(".nxp_sociallayer").css("width",dw+"px");else _tcp._menu.find(".nxp_sociallayer").css("width","auto");switch(m){case "ad":if(_tcp._flow.ad.mode!="break")_tcp._flow.ad.renderText();break;case "adcontrol":var l=jQuery(".nxp_sociallayer[data-context='adcontrol']");if(l.length>1)l.first().remove();break;case "streamsettings":jQuery(".nxp_listitem[data-index='"+_tcp._desiredQuality+"']").append("<div class='nxp_icon-checked'></div>");
break;case "speed":jQuery(".nxp_listitem[data-value='"+_tcp._desiredSpeed+"']").append("<div class='nxp_icon-checked'></div>");break;case "toggleaudio":jQuery(".nxp_listitem[data-index='"+_tcp._stream.multiAudio.currentLanguage+"']").append("<div class='nxp_icon-checked'></div>");break;case "subtitles":if(jQuery(".nxp_activeitem").length==0)jQuery(".nxp_listitem").first().addClass("nxp_activeitem");var ci=_tcp._captionIndex;if(_tcp._ui.addons.captions.mutedFallback&&_tcp._desiredCaptionLanguage==
"")ci=-1;jQuery(".nxp_listitem[data-index='"+ci+"']").append("<div class='nxp_icon-checked'></div>");break;case "info":var h=_tcp._menu.find(".nxp_sociallayer[data-context='info']").height();_tcp._menu.find(".nxp_scroller").css({height:h+"px"});break;case "embed":if(_play.system.capabilities.hasClipboard){var clp=new Clipboard(".nxp_button");clp.on("success",function(e){_tcp._ui.addons.layer.remove();_tcp._ui.addons.notice.build(_play.tools.getClientText("linkcopied"))})}break}_tcp._menu.find(".nxp_sociallayer").last().fadeIn();
_tcp._ui.updateTooltips()},remove:function(){_play.tools.log("REMOVING SOCIAL LAYER","HALCYON");_tcp._menu.find(".nxp_sociallayer").each(function(i,j){jQuery(this).stop().fadeOut(function(){jQuery(this).remove();_play._factory.ui.tooltip.hide()})});_play._factory.ui.tooltip.hide()}},notice:{build:function(m,keepActive,context){_tcp._ui.addons.notice.remove();_tcp._overlay.append("<div class='nxp_notice nxp_bg nxp_roundedleft' data-context='"+context+"'>"+m+"</div>");_tcp._overlay.find(".nxp_notice").animate({right:"0"},
1200,function(){jQuery(this).click(function(){if(jQuery(this).attr("data-context")=="initiallymuted")_tcp._ia.interact("nomute");_tcp._ui.addons.notice.remove()})});if(!keepActive)window.setTimeout(function(){_tcp._ui.addons.notice.remove()},5500)},remove:function(){_tcp._overlay.find(".nxp_notice").animate({right:"-350px"},750,function(){jQuery(this).remove()})}},tap:{remove:function(){_tcp._el.find(".nxp_tapactionicon").fadeOut(function(){jQuery(this).remove()})},add:function(p){_tcp._ui.addons.tap.remove();
_tcp._menu.append("<div class='nxp_tapactionicon nxp_icon-"+p+"' data-command='"+p+"'></div>");_tcp._el.find(".nxp_tapactionicon").stop().hide().fadeIn()}},captions:{ids:[],reported:false,mutedFallback:false,isOnlyHiding:false,currentmediaid:0,automaticOn:false,init:function(){_play.tools.log("INIT CAPTIONS","HALCYON");var a=_tcp._data.getMediaObject("captiondata");if(_tcp._hasCaptions&&a&&a.length&&a.length>0){_tcp._ui.addons.captions.tracks=a.length;if(_tcp._overlay.find(".nxp_caption").length==
0){_tcp._overlay.find(".nxp_captionholder").remove();_tcp._overlay.append("<div class='nxp_captionholder' style='display:none;'><div class='nxp_caption nxp_rounded'></div></div>")}if(_tcp._ui.addons.currentmediaid!=_tcp._data.getMedia("ID")){_tcp._ui.addons.captions.reported=false;_tcp._ui.addons.captions.ids=[];_tcp._ui.addons.captions.clean();_tcp._ui.addons.currentmediaid=_tcp._data.getMedia("ID");var useCue=typeof VTTCue=="function"||typeof VTTCue=="object";for(var l=0;l<a.length;l++){_tcp._ui.addons.captions.ids.push(a[l]["ID"]);
_play.tools.log("ADDING CAPTIONS FOR "+a[l]["language"],"HALCYON");if(a[l]["language"]==_tcp._desiredCaptionLanguage)_tcp._currentCaptionLanguage=a[l]["language"];var vtt=_tcp._stream.m.addTextTrack("subtitles",a[l]["language"].toUpperCase(),a[l]["language"]);var d=a[l]["data"];for(var i=0;i<d.length;i++){d[i].fromms=Math.max(1E3,d[i].fromms);if(useCue)vtt.addCue(new VTTCue(parseFloat(d[i].fromms)/1E3,parseFloat(d[i].toms)/1E3,d[i].caption));else vtt.addCue(new TextTrackCue(parseFloat(d[i].fromms)/
1E3,parseFloat(d[i].toms)/1E3,d[i].caption))}}}}else{_tcp._overlay.find(".nxp_caption").remove();_tcp._ui.addons.captions.clean()}_tcp._captionIndex=-1;if(_tcp._currentCaptionLanguage!="")_tcp._ui.addons.captions.autoSelect()},autoSelect:function(){_tcp._ui.addons.captions.hide();_play.tools.log("SEARCHING CAPTIONS FOR "+_tcp._currentCaptionLanguage,"HALCYON");if(_tcp._stream.m)for(var i=0;i<_tcp._stream.m.textTracks.length;i++)if(_tcp._stream.m.textTracks[i].mode!="disabled"&&_tcp._stream.m.textTracks[i].language==
_tcp._currentCaptionLanguage){_tcp._captionIndex=i;_tcp._ui.addons.captions.show();break}},handleMuting:function(){var si=-1;var tl=_play.config.client.language;for(var i=0;i<_tcp._stream.m.textTracks.length;i++)if(_tcp._stream.m.textTracks[i].language&&_tcp._stream.m.textTracks[i].language!="")if(_tcp._ui.addons.captions.ids.length==1||_tcp._stream.m.textTracks[i].language==tl){si=i;break}if(si>-1){_tcp._captionIndex=si;_tcp._ui.addons.captions.mutedFallback=true;if(_tcp._ui.addons.captions.isOnlyHiding){_tcp._ui.addons.captions.isOnlyHiding=
false;if(_tcp._overlay.find(".nxp_caption").html()!="")_tcp._overlay.find(".nxp_captionholder").show()}else _tcp._ui.addons.captions.show()}},clean:function(){_play.tools.log("REMOVING CAPTIONS","HALCYON");_tcp._ui.addons.captions.mutedFallback=false;_tcp._ui.addons.captions.isOnlyHiding=false;if(_tcp._stream.m&&_tcp._stream.m.textTracks)if(_tcp._stream.m.textTracks.length>0)for(var i=0;i<_tcp._stream.m.textTracks.length;i++){if(_tcp._stream.m.textTracks[i].cues)for(var j=0;j<_tcp._stream.m.textTracks[i].cues.length;j++)_tcp._stream.m.textTracks[i].removeCue(_tcp._stream.m.textTracks[i].cues[j]);
_tcp._stream.m.textTracks[i].removeEventListener("cuechange",_tcp._ui.addons.captions.cuechange);_tcp._stream.m.textTracks[i].mode="disabled"}},show:function(){if(_tcp._hasCaptions&&!_tcp._playingAd&&_tcp._stream.m&&_tcp._stream.m.textTracks&&_tcp._stream.m.textTracks.length&&_tcp._stream.m.textTracks.length>0&&_play.tools.parseInt(_tcp._captionIndex)>-1&&_tcp._stream.m.textTracks[_tcp._captionIndex]){_play.tools.log("ENABLING CAPTIONS","HALCYON");if(_tcp._useFullPlayer)if(_play.system.isIOS())_tcp._stream.m.textTracks[_tcp._captionIndex].mode=
"showing";else{_tcp._stream.m.textTracks[_tcp._captionIndex].mode="hidden";_tcp._stream.m.textTracks[_tcp._captionIndex].addEventListener("cuechange",_tcp._ui.addons.captions.cuechange)}else _tcp._stream.m.textTracks[_tcp._captionIndex].mode="showing";if(!_tcp._ui.addons.captions.reported&&!_tcp._ui.addons.captions.mutedFallback){_tcp._ui.addons.captions.reported=true;_tcp._data.emitEvent(_samaritan.events.CAPTION,{item:_tcp._ui.addons.captions.ids[_tcp._captionIndex],language:_tcp._stream.m.textTracks[_tcp._captionIndex].language,
type:_tcp._ui.addons.captions.automaticOn?"auto":"manual"})}}else _tcp._ui.addons.captions.hide(true)},hide:function(keepMutedVersion){if(_tcp._stream.m){_play.tools.log("DISABLING CAPTIONS","HALCYON");if(!keepMutedVersion){_tcp._ui.addons.captions.mutedFallback=false;_tcp._ui.addons.captions.isOnlyHiding=false;for(var i=0;i<_tcp._stream.m.textTracks.length;i++)if(_tcp._useFullPlayer)if(_tcp._stream.m.textTracks[i].mode!="disabled"){_tcp._stream.m.textTracks[i].mode="hidden";_tcp._stream.m.textTracks[i].removeEventListener("cuechange",
_tcp._ui.addons.captions.cuechange)}}else _tcp._ui.addons.captions.isOnlyHiding=true;_tcp._overlay.find(".nxp_captionholder").hide()}},change:function(index,val){jQuery(".nxp_listitem.nxp_activeitem").removeClass("nxp_activeitem");jQuery(".nxp_listitem[data-index='"+index+"']").addClass("nxp_activeitem");jQuery(".nxp_listitem .nxp_icon-checked").remove();jQuery(".nxp_listitem[data-index='"+index+"']").append("<div class='nxp_icon-checked'></div>");_tcp._captionIndex=_play.tools.parseInt(index);_tcp._desiredCaptionLanguage=
_tcp._currentCaptionLanguage=val;_tcp._ui.addons.captions.mutedFallback=false;if(_play.system.capabilities.hasStorage)_play.system.storage.set("nxp_desiredcaptionlanguage",val);if(_tcp._captionIndex>-1){_tcp._ui.addons.captions.reported=false;_tcp._ui.addons.captions.autoSelect()}else _tcp._ui.addons.captions.hide()},cuechange:function(e){if(_tcp._stream.m.textTracks[_tcp._captionIndex].activeCues.length>0){_tcp._overlay.find(".nxp_caption").html(_tcp._stream.m.textTracks[_tcp._captionIndex].activeCues[0].text);
if(!_tcp._ui.addons.captions.isOnlyHiding)_tcp._overlay.find(".nxp_captionholder").show()}else _tcp._overlay.find(".nxp_captionholder").hide()}},spots:{active:[],spots:[],refs:{},init:function(){_play.tools.log("INIT HOTSPOTS","HALCYON");_tcp._ui.addons.spots.active=[];_tcp._ui.addons.spots.refs={};_tcp._ui.addons.spots.spots=_tcp._data.getMediaObject("hotspotdata");_tcp._overlay.after("<div class='nxp_spots'></div>")},update:function(t){for(var k=0;k<_tcp._ui.addons.spots.spots.length;k++){var s=
_tcp._ui.addons.spots.spots[k];if(s&&t>=parseFloat(s.general.validfrom)&&t<=parseFloat(s.general.validto)&&_tcp._ui.addons.spots.active.indexOf(s.general.ID)==-1&&!_tcp._isPlayingExternal){var c="";if(s.general.type!="exit"){c+="<div class='nxp_innerspot'"+(_play.tools.parseInt(s.general.showthumb)>0||s.general.type=="poll"?" style='margin-left:0;'":"")+"><b>"+s.general.text+"</b>";if(s.general.textadd&&s.general.textadd!="")c+="<br /><span>"+s.general.textadd+"</span>";if(s.general.type=="poll"){c+=
"<div class='nxp_polloptions'>";if(s.general.canBeVoted==1){c+="<div data-itemmode='polloption' data-value='"+s.general.linkedPoll+"::"+s.polloptions[0]["row"]+"::"+s.polloptions[0]["ID"]+"' data-result='"+s.polloptions[0]["votes"]+"' class='nxp_listitem nxp_bg nxp_rounded'>"+s.polloptions[0]["title"]+"</div>";c+="<div data-itemmode='polloption' data-value='"+s.general.linkedPoll+"::"+s.polloptions[1]["row"]+"::"+s.polloptions[1]["ID"]+"' data-result='"+s.polloptions[1]["votes"]+"' class='nxp_listitem nxp_bg nxp_rounded'>"+
s.polloptions[1]["title"]+"</div>"}else{var u=s.polloptions[0]["votes"]+s.polloptions[1]["votes"];if(u==0){u=2;s.polloptions[0]["votes"]=s.polloptions[0]["votes"]=1}var p=Math.round(100*s.polloptions[0]["votes"]/u);c+="<div data-itemmode='polloption' style='width:"+p+"%;' class='nxp_listitem nxp_voted nxp_bg nxp_rounded'><b>"+s.polloptions[0]["title"]+"</b> ("+p+"%)</div>";p=100-p;c+="<div data-itemmode='polloption' style='width:"+p+"%;' class='nxp_listitem nxp_voted nxp_bg nxp_rounded'><b>"+s.polloptions[1]["title"]+
"</b> ("+p+"%)</div>"}c+="</div>"}c+="</div>"}else c+="<div class='nxp_socialline' style='font-weight:normal;'>"+s.general.text+"</div>";if(_play.tools.parseInt(s.general.showthumb)>0){c+="<img "+(s.general.type=="exit"?"class='nxp_actionimg' data-command='exitpreviewswap' data-param='"+s.general.linkparam+"' ":"")+"src='"+s["imagedata"]["thumb"+(_play.config.client.thumbversion=="alternate"?"_alt":"")]+"' />";if(s.general.type=="exit")c+="<div class='nxp_icon-playingnext'></div>";else c+="<div class='nxp_cleared'></div>"}else if(s.general.type!=
"poll"&&s.general.type!="exit"&&s.imagedata.icon&&s.imagedata.icon!="")c+="<div class='nxp_hsicon nxp_icon-"+s.imagedata.icon+"'"+(s.general.textadd&&s.general.textadd!=""?" style='top:16px;'":"")+"></div>";var st="";if(_play.tools.parseInt(s.general.autopos)!=1)st=" style='top:"+s.general.posy+"%;left:"+s.general.posx+"%"+(s.general.ID==-999?";cursor:move;":"")+"'";_tcp._ui.addons.spots.active.push(s.general.ID);_tcp._ui.addons.spots.refs[s.general.ID]={ID:s.general.ID,validfrom:s.general.validfrom,
validto:s.general.validto,autopos:s.general.autopos};_tcp._el.find(".nxp_spots").append("<div id='spot_"+s.general.ID+"' "+(s.general.link&&s.general.link!=""?"data-link='"+s.general.link+"' ":"")+(s.general.linkedVideo&&_play.tools.parseInt(s.general.linkedVideo)>0?"data-linkedvideo='"+s.general.linkedVideo+"' ":"")+"class='nxp_spot nxp_bg nxp_rounded"+(_play.tools.parseInt(s.general.autopos)==1?" nxp_autospot":" nxp_manualspot")+(s.general.type=="exit"?" nxp_coming":"")+(_play.tools.parseInt(s.general.showthumb)>
0?" nxp_imgspot":"")+"'"+st+">"+c+"</div>");if(s.general.ID>0){_tcp._data.reportSpot(s.general.ID,0);if(s.general.type=="poll")_tcp._data.emitEvent(_samaritan.events.PLAY,{isBumper:0,isPreview:0,playReason:"start",payReason:"",playIndex:0,protocol:"",codec:"",datamode:_tcp._config.dataMode,protection:""},s.general.linkedPoll,"poll",0,0)}if(_play.tools.parseInt(s.general.autopos)!=1)window.setTimeout("jQuery('#spot_"+s.general.ID+"').css({opacity:1});",50);else window.setTimeout("jQuery('#spot_"+s.general.ID+
"').css({right:0});",50);if(s.general.ID==-999&&_play.tools.parseInt(s.general.autopos)!=1)if(!s.general["synchronized"])_editor.hotSpotPreview();else jQuery("#spot_-999").draggable({cursor:"move",drag:function(e,ui){var yp=ui.position.top/jQuery("#mediadisplay").height()*100;var xp=ui.position.left/jQuery("#mediadisplay").width()*100;$("#slideposx").slider("value",_play.tools.parseInt(xp));$("#slideposx").find(".ui-slider-handle").html(_play.tools.parseInt(xp));$("#posx").val(_play.tools.parseInt(xp));
$("#slideposy").slider("value",_play.tools.parseInt(yp));$("#posy").val(_play.tools.parseInt(yp));$("#slideposy").find(".ui-slider-handle").html(_play.tools.parseInt(yp))}})}}_tcp._ui.addons.spots.clear(false,t)},clear:function(removeAll,t){t=t||_tcp._stream.getCurrentTime();var n=[];for(var k=0;k<_tcp._ui.addons.spots.active.length;k++){var s=_tcp._ui.addons.spots.refs[_tcp._ui.addons.spots.active[k]];if(s)if(removeAll||_tcp._isPlayingExternal||t<parseFloat(s.validfrom)||t>parseFloat(s.validto)){if(_play.tools.parseInt(s.autopos)!=
1)jQuery("#spot_"+s.ID).css({opacity:0});else if(s.type!="exit")jQuery("#spot_"+s.ID).css({right:"-200px"});else jQuery("#spot_"+s.ID).css({right:"-400px"});window.setTimeout("jQuery('#spot_"+s.ID+"').remove();",1250)}else n.push(s.ID)}_tcp._ui.addons.spots.active=n},edit:function(type,text,addon,link,auto,x,y,linkedVideo,thumb,showThumb,optionLeft,optionRight){for(var k=0;k<_tcp._ui.addons.spots.spots.length;k++)if(_tcp._ui.addons.spots.spots[k].general.ID==-999){jQuery("#spot_-999").remove();_tcp._ui.addons.spots.spots[k].general["synchronized"]=
true;_tcp._ui.addons.spots.spots[k].general.type=type;if(text!="")_tcp._ui.addons.spots.spots[k].general.text=text;_tcp._ui.addons.spots.spots[k].general.textadd=addon;_tcp._ui.addons.spots.spots[k].general.linke=link;_tcp._ui.addons.spots.spots[k].general.autopos=auto;_tcp._ui.addons.spots.spots[k].general.posx=x;_tcp._ui.addons.spots.spots[k].general.posy=y;_tcp._ui.addons.spots.spots[k].general.canBeVoted=1;_tcp._ui.addons.spots.spots[k].general.linkedPoll=-1;_tcp._ui.addons.spots.spots[k].general.linkedVideo=
linkedVideo;_tcp._ui.addons.spots.spots[k].general.showthumb=showThumb;_tcp._ui.addons.spots.spots[k].imagedata.thumb=thumb;if(type=="poll")_tcp._ui.addons.spots.spots[k].polloptions=[{ID:0,row:0,title:optionLeft,votes:0},{ID:0,row:0,title:optionRight,votes:0}];_tcp._ui.addons.spots.active=[];_tcp._ui.addons.spots.update(_tcp._stream.getCurrentTime());break}}}},hideLoader:function(){_tcp._loader.hide()},showLoader:function(){if(!_tcp._useMicroPlayer)_tcp._loader.show()}},_ia:{mouseinterval:null,touchinterval:null,
onLeavePlayer:function(){if(_tcp._playingAd||!_tcp._fixedMenu&&!_tcp._startMode&&!_tcp._isCasting)if(_tcp._playingAd||_tcp._stream.m&&!_tcp._isPlayingExternal&&!_tcp._stream.m.paused&&!_tcp._stream.m.ended){_tcp._menuActive=false;_tcp._ui.addons.tap.remove();_tcp._ui.hide();window.clearTimeout(_tcp._ia.touchinterval)}},onEnterPlayer:function(andStartCD){if(!_tcp._hiddenMenu&&!_tcp._startMode&&!_tcp._playingAd&&!_tcp._previewPaused&&!_tcp._isBumper){_tcp._menuActive=true;_tcp._ui.show();if(andStartCD){window.clearTimeout(_tcp._ia.touchinterval);
_tcp._ia.touchinterval=window.setTimeout(function(){if(_tcp._stream.m&&!_tcp._stream.m.paused&&!_tcp._stream.m.ended&&!_tcp._isPlayingExternal&&!_tcp._fixedMenu){_tcp._menuActive=false;_tcp._ui.addons.tap.remove();_tcp._ui.hide()}},5E3)}}},onMouseStill:function(){if(_tcp._stream.events.waitForLightsOut&&!_play.system.environment.isFullscreen&&!_play.system.environment.isPopOut&&!_play.system.environment.isPIP){if(_play.system.environment.isLightsOut)_tcp._ia.interactSidebar("togglelight","time");
_tcp._stream.events.lightsOutSeconds=0}if(!_tcp._playingAd&&!_tcp._isPlayingExternal&&!_play.system.environment.isCasted&&!_tcp._previewPaused&&!_tcp._isBumper){_tcp._ui.show();_tcp._el.css({cursor:"default"});if(_play.system.environment.isFullscreen){window.clearTimeout(_tcp._ia.mouseinterval);_tcp._ia.mouseinterval=window.setTimeout(function(){if(_tcp._stream.m&&_tcp._mime=="video"&&!_tcp._isPlayingExternal&&!_tcp._stream.m.paused&&!_tcp._stream.m.ended){_tcp._menuActive=false;_tcp._ui.addons.tap.remove();
_tcp._el.css({cursor:"none"});_tcp._ui.hide()}},5E3)}}},startClick:function(){_tcp._isRebuild=false;if(typeof google=="object"&&typeof google.ima=="object")_tcp._flow.ad.ima.initContainer();if(_play.system.environment.isApp&&_app.config.useAppPlayer)_tcp._flow.startNative();else if(!_tcp._useFullPlayer){_tcp._startMode=false;_tcp._el.removeClass("nxp_startmode");_tcp._data.emitNotification(_play.config.events.START_PLAYBACK);if(_tcp._videoMetaLoaded)_tcp._stream.events.initProcessing();_tcp._ui.showLoader();
_tcp._ui.hide();_tcp._ui.visualresponse.removeAll();if(_play.system.environment.isApp&&_app.config.useAppPlayer){_play.tools.log("STARTING NATIVE PLAYER","HALCYON");_tcp._flow.startNative();setTimeout(function(){_tcp._ui.hideLoader();if(_play.system.environment.isONE)_one.ajax.hideIndicator();_tcp._ui.show();_tcp._startMode=true;_tcp._ui.visualresponse.addStatic("init")},1500)}else if(_tcp._stream.m){_tcp._stream.m.load();_tcp._stream.simplePlay()}}else{jQuery("#nxp_startimage"+_tcp._index).fadeOut();
if(_tcp._autofullscreen==1&&!_tcp._initiallyMuted&&_play.system.device.type=="mobile"&&["mobile","android","fbia"].indexOf(_play.system.device.platform)>-1){_tcp._fullscreenreportmode="domainsetting";if(!_play.system.isIOS())_tcp._ia.interact("fullscreen")}_tcp._flow.onMediaReady()}},onOverlayClick:function(){if(!_tcp._waitForLive)if(_tcp._initiallyMuted){_tcp._data.emitNotification(_play.config.events.MAIN_INTERACTION);if(_play.tools.parseInt(_tcp._data.getMedia("hasAudio","features"))==1){_tcp._ia.interact("nomute");
_tcp._ui.addons.notice.remove()}if(_tcp._autofullscreen==1&&["mobile","android","fbia"].indexOf(_play.system.device.platform)>-1){_tcp._fullscreenreportmode="domainsetting";if(!_play.system.isIOS())_tcp._ia.interact("fullscreen");else if(_play.system.getIOSVersion()>=10)_play.system.fullscreen.enter(_tcp._el.attr("id"))}if(typeof google=="object"&&typeof google.ima=="object")_tcp._flow.ad.ima.initContainer();if(!_tcp._stream.askedForPreroll&&_tcp._useAds){if(_tcp._flow.ad.allowPre)_tcp._flow.ad.load("pre");
_tcp._stream.askedForPreroll=true}}else if(_tcp._startMode){_tcp._startMode=false;_tcp._playPauseByUser=true;_tcp._ia.startClick();_tcp._data.emitNotification(_play.config.events.MAIN_INTERACTION)}else if(_tcp._isIOSPause){_tcp._isIOSPause=false;_tcp._playPauseByUser=true;_tcp._ia.interact("play")}else if(_tcp._playingAd)if(!_tcp._playingAdPaused){if(_tcp._flow.ad.adresult.media)if(_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].target!=""){_play.tools.openWindow(_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].target);
_tcp._flow.ad.onClick()}}else{if(_tcp._flow.ad.adresult.media&&_tcp._flow.ad.adresult.media[_tcp._flow.ad.index].type=="vpaid"){_tcp._el.addClass("nxp_vpaidad");if(_play.tools.parseInt(_play.config.client.ads_enableOverlay)==2)_tcp._el.addClass("nxp_noadoverlay")}_tcp._data.emitNotification(_play.config.events.AD_RESUMED);_tcp._flow.ad.four.sendEvent("AdPlaying");_tcp._ia.interact("play")}else if(_tcp._el.find(".nxp_sociallayer").length>0)_tcp._ui.addons.layer.remove();else if(_play.system.capabilities.hasTouch)if(_tcp._mime==
"video")if(!_tcp._isBumper)if(_tcp._menuActive)_tcp._ia.onLeavePlayer();else{if(_tcp._stream.m)_tcp._ui.addons.tap.add("pause");_tcp._ia.onEnterPlayer(true)}else _tcp._flow.handleBumperClick();else{if(_tcp._stream.m&&!_tcp._useMiniPlayer)_tcp._ui.addons.tap.add("pause")}else if(!_tcp._live||_tcp._dvr)if(_tcp._isBumper)_tcp._flow.handleBumperClick();else{_tcp._playPauseByUser=true;_tcp._ia.toggle()}},onDoubleClick:function(){if(!_tcp._startMode&&!_tcp._waitForLive&&_tcp._mime=="video"&&!_tcp._playingAd)if(_play.system.environment.isFullscreen)_tcp._ia.interact("nofullscreen");
else _tcp._ia.interact("fullscreen")},onRate:function(r){for(var u=1;u<=r;u++)_tcp._el.find(".nxp_rate[data-param='"+u+"']").addClass("nxp_hoveredrate")},onRated:function(r){_tcp._el.find(".nxp_enabledrate").removeClass("nxp_enabledrate").addClass("nxp_disabledrate");_tcp._playlist[_tcp._playpos].canrate=0;_tcp._data.emitEvent(_samaritan.events.ENGAGE,{action:"rate",context:"",value:_play.tools.parseInt(r)});_tcp._ui.addons.layer.remove();_tcp._ui.addons.notice.build(_play._factory.tools.getMimeClientText(_tcp._streamtype,
"rated"));_play.system.connection.callAPI("/interactions/addrate",{item:_tcp._data.getMedia("ID"),streamtype:_tcp._streamtype,rating:r}).then(function(data){if(data){_play.system.cache.clear();_tcp._playlist[_tcp._playpos]["interactiondata"].canBeRated=0;_tcp._playlist[_tcp._playpos]["interactiondata"].rating=data.itemupdate.rating}})["catch"](function(e){});if(_play.addons.reco.provider!="")_play.addons.reco[_play.addons.reco.provider].onAction(_tcp._data.getMedia("ID"),_tcp._streamtype,"rate",r)},
onVoted:function(v){var d=v.split("::");var r={};r[d[1]]=d[2];_tcp._data.emitEvent(_samaritan.events.ENGAGE,{action:"submit",context:d[1],value:d[2]},d[0],"poll",0,0);_play.system.cache.clear();for(var k=0;k<_tcp._ui.addons.spots.spots.length;k++)if(_tcp._ui.addons.spots.spots[k].general.linkedPoll==d[0]){_tcp._ui.addons.spots.spots[k].general.canBeVoted=0;break}_tcp._ui.addons.spots.clear(true);_tcp._ui.addons.spots.update(_tcp._stream.getCurrentTime());_play.system.connection.callAPI("/interactions/sendpoll",
{item:d[0],result:JSON.stringify(r)}).then(function(r){console.log(r)})},onRemove:function(){_play.tools.log("KILLING PLAYER","HALCYON");_tcp._ui.exitdisplay.killTimer();_tcp._flow.ad.removeBanners();_tcp._ui.panorama.destroy();if(_tcp._stream.m)_tcp._stream.clean();_tcp._ended=true;jQuery(".nxp_lightsout").remove();if(_tcp._isCasting){_play.addons.cast.sender.sendMessage("instanceremoved");_play.system.environment.isBackgroundCasting=true}if(_play.system.environment.isApp&&!_app.config.useAppPlayer){_play.tools.log("APP SCREEN TIMEOUT ENABLED",
"HALCYON");_app["native"].screen.timeout.enable()}},onExitLegacyFullscreen:function(){if(!_play.system.isIOS()||_play.system.getIOSVersion()<10||_play.system.device.platform=="fbia"||_play.system.environment.isWebView)if(_play.system.device.type=="mobile"){if(_tcp._stream.m&&!_tcp._playingAd){_tcp._config.delay=_tcp._stream.getCurrentTime();_play.tools.log("SETTING DELAY TO "+_tcp._config.delay,"HALCYON")}if(_tcp._playingAd)_tcp._flow.ad.onAdDone(false,true);_tcp._ui.hideLoader();_tcp._ui.show();
_tcp._ui.visualresponse.removeAll();if(_tcp._config.delay>=_tcp._stream.m.duration-10){_tcp._config.delay=0;_tcp._ui.visualresponse.addStatic("restart","restart")}else _tcp._ui.visualresponse.addStatic("play","resume")}else _tcp._stream.simplePlay()},onCastCommand:function(m,p){if(m!="timeupdate"&&m!="notification")_play.tools.log("HANDLING CAST COMMAND: "+m+"/"+p,"HALCYON");switch(m){case "inited":_tcp._menu.find(".nxp_cchider").show();window.setTimeout(function(){_tcp._ui.onResize()},250);break;
case "changeplay":_tcp._stream.m.muted=true;_tcp._playparam=p.vid;_tcp._playmode=p.playmode;_tcp._flow.prepareSwap();break;case "next":_tcp._ia.interact("next","fromcast");break;case "connecting":_tcp._ui.addons.notice.build("<div class='nxp_icon-cast'></div>"+_play.tools.getClientText("contactingcast"),true);jQuery("button[is='google-cast-button']").show();window.setTimeout(function(){_tcp._ui.onResize()},250);break;case "connected":_play.system.environment.isBackgroundCasting=false;_tcp._ui.addons.notice.remove();
if(_tcp._startMode){_tcp._startMode=false;_tcp._el.removeClass("nxp_startmode");_tcp._ui.onResize()}if(_tcp._stream.m)_tcp._stream.m.pause();_tcp._ui.castdisplay.build();_tcp._ui.show();_tcp._isCasting=true;_tcp._el.addClass("nxp_casting");if(_tcp._stream.m)_tcp._stream.m.muted=true;_tcp._data.emitNotification(_play.config.events.ENTER_REMOTE,{device:"chromecast"});jQuery("button[is='google-cast-button']").show();if(!_tcp._stream.events.hadCasted){_tcp._stream.events.hadCasted=true;_tcp._data.emitEvent(_samaritan.events.CASTING,
{device:"chromecast"})}_tcp._ui.onResize();break;case "terminated":case "error":_tcp._ui.addons.notice.remove();if(_tcp._isCasting){_tcp._isCasting=false;_tcp._el.removeClass("nxp_casting");_tcp._menu.find(".nxp_sidebaritem[data-command='streamsettings']").show();if(!_tcp._initiallyMuted)_tcp._stream.m.muted=false;if(_tcp._stream.castedTime>0)_tcp._stream.seek(_tcp._stream.castedTime,true);else _tcp._stream.play();_tcp._ui.castdisplay.remove();if(m=="error")_tcp._ui.addons.notice.build(_play.tools.getClientText("errorcast"));
_tcp._ui.sidebar.build();_tcp._data.emitNotification(_play.config.events.EXIT_REMOTE,{device:"chromecast"})}window.setTimeout(function(){_tcp._ui.onResize()},250);break;case "notification":_play._factory.control.processNotification(p.type,p.data,p.streamtype,p.index,p.div,p.vid,p.dataMode,true,p.mediaIndex);break;case "skipshaka":_tcp._menu.find(".nxp_sidebaritem[data-command='streamsettings']").hide();break;case "startad":_tcp._menu.find(".nxp_menubar").hide();_tcp._ui.addons.layer.build("ad");break;
case "stopad":_tcp._menu.find(".nxp_menubar").show();_tcp._ui.addons.layer.remove();_play.addons.cast.sender.initMedia();break;case "adupdate":_tcp._menu.find(".nxp_sociallayer[data-context='ad']").html("<div class='nxp_adhint'>"+p+"</div>");break;case "timeupdate":_tcp._stream.castedTime=p;_tcp._stream.updateCurrentTime(p);break}},interact:function(m,p){if(!_tcp._playingAd||["updateconfig","play","pause","noplay","continue","mute","nomute","unmute","fullscreen","nofullscreen","exitfullscreen","homadadstarted",
"homadadclicked","homadadended","online","offline","lightsout","lightson","exitpip"].indexOf(m)>-1){_play._factory.ui.tooltip.hide();_play.tools.log("HANDLING COMMAND: "+m,"HALCYON");switch(m){case "play":if(_tcp._online)if(_tcp._startMode){if(!_play.system.isMobile()||_play.system.environment.isApp)_tcp._ia.onOverlayClick()}else if(!_tcp._playingAd){if(!_tcp._previewPaused){if(!_tcp._useAutoMediaLoad){_tcp._useAutoMediaLoad=true;if(_tcp._willUseSHAKA)_tcp._stream.startDASH();else{_tcp._stream.m.load();
_tcp._stream.simplePlay()}}_tcp._ui.exitdisplay.killTimer();_tcp._area.find(".nxp_exit").fadeOut(300,function(){jQuery(this).remove()});_tcp._menu.find(".nxp_actionicon[data-command='play']").removeClass("nxp_icon-restart").addClass("nxp_icon-play");_tcp._el.find(".nxp_icon-play").removeClass("nxp_icon-play").addClass("nxp_icon-pause").attr("data-command","pause").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_noplay"));_tcp._ui.updateTooltips();_tcp._ui.visualresponse.removeAll();
_tcp._stream.play();if(_play.system.capabilities.hasTouch)_tcp._ui.addons.tap.remove()}}else if(_tcp._playingAdPaused){_tcp._playingAdPaused=false;_tcp._data.emitNotification(_play.config.events.AD_RESUMED);_tcp._flow.ad.four.sendEvent("AdPlaying");_tcp._ui.visualresponse.removeAll();if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.manager.resume();else if(!_tcp._flow.ad.player)_tcp._stream.simplePlay();else _tcp._flow.ad.player.play()}break;case "pause":case "noplay":if(!_tcp._previewPaused&&
(!_play.system.environment.isPIP||_play.system.isWinApp())){if(!_tcp._playingAd){_tcp._ui.show();_tcp._el.find(".nxp_icon-pause").removeClass("nxp_icon-pause").addClass("nxp_icon-play").attr("data-command","play").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_play"));_tcp._ui.updateTooltips();if(_play.system.capabilities.hasTouch)_tcp._ui.addons.tap.remove();if(_tcp._stream.m&&!_tcp._stream.m.paused)if(p&&typeof p=="boolean"){_play.tools.log("PAUSE CAN BE RESUMED",
"HALCYON");_tcp._pauseCanBeResumed=true}else _tcp._pauseCanBeResumed=false}else _tcp._pauseCanBeResumed=true;_tcp._stream.pause();if(_tcp._playPauseByUser&&!_tcp._stream.m.ended&&!_tcp._playingAd&&_tcp._useAds&&_tcp._flow.ad.allowBreakAds&&_tcp._admodel.vast_break!="")if(!_play.system.environment.isFullscreen||!_play.system.isIOS())_tcp._flow.ad.load("break")}break;case "continue":if(!_tcp._previewPaused&&_tcp._pauseCanBeResumed)_tcp._ia.interact("play");break;case "toggle":if(!_tcp._previewPaused&&
_tcp._online)if(!_tcp._playingAd)if(_tcp._stream.m)if(_tcp._stream.m.paused)_tcp._ia.interact("play");else _tcp._ia.interact("pause");break;case "mute":_tcp._el.find(".nxp_icon-mute").removeClass("nxp_icon-mute").addClass("nxp_icon-unmute").attr("data-command","unmute").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nomute"));_tcp._el.find(".nxp_volumeholder .nxp_innerprogress").css({display:"none"});_tcp._stream.mute();_tcp._muted=true;_tcp._ui.updateTooltips();
break;case "nomute":case "unmute":_tcp._el.find(".nxp_icon-unmute").removeClass("nxp_icon-unmute").addClass("nxp_icon-mute").attr("data-command","mute").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_mute"));_tcp._el.find(".nxp_volumeholder .nxp_innerprogress").css({display:"block"});if(_tcp._initiallyMuted){_tcp._initiallyMuted=false;_tcp._ui.addons.notice.remove()}if(_tcp._muted){_tcp._stream.unmute();_tcp._muted=false}_tcp._ui.updateTooltips();break;case "loop":_tcp._el.find(".nxp_icon-loop").removeClass("nxp_icon-loop").addClass("nxp_icon-shuffle").attr("data-command",
"shuffle").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_order_random"));_tcp._orderMode="straight";_tcp._playlist=_tcp._originalplaylist;_tcp._flow.updatePlayPos(_tcp._data.getMedia("ID"));_tcp._ui.updateTooltips();break;case "shuffle":_tcp._el.find(".nxp_icon-shuffle").removeClass("nxp_icon-shuffle").addClass("nxp_icon-loop").attr("data-command","loop").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_order_straight"));_tcp._orderMode=
"random";_tcp._playlist=_play.tools.shuffleArray(_tcp._originalplaylist);_tcp._flow.updatePlayPos(_tcp._data.getMedia("ID"));_tcp._ui.updateTooltips();break;case "exitpip":if(_play.system.environment.isApp&&_play.system.environment.isPIP)_tcp._stream.pip();break;case "setvolume":p=parseFloat(p);if(p>0){_play.system.storage.set("nxp_lastvolume",p);_tcp._stream.setVolume(p);_tcp._lastVolume=p;_tcp._el.find(".nxp_volumeholder .nxp_innerprogress").css({width:p*100+"%"})}if(_play.system.environment.isCasted)_play.addons.cast.receiver.sendUpdate(null,
"PLAYING");break;case "seek":if((!_tcp._live||_tcp._dvr)&&_tcp._online){_tcp._ui.exitdisplay.killTimer();_tcp._menu.find(".nxp_actionicon[data-command='play']").removeClass("nxp_icon-restart").addClass("nxp_icon-play");_tcp._area.find(".nxp_exit").fadeOut(300,function(){jQuery(this).remove()});_tcp._el.find(".nxp_icon-play").removeClass("nxp_icon-play").addClass("nxp_icon-pause").attr("data-command","pause").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_noplay"));
_tcp._stream.seek(p);_tcp._ui.updateTooltips()}break;case "seekleft":case "seekright":if((!_tcp._live||_tcp._dvr)&&_tcp._online){_tcp._ui.exitdisplay.killTimer();_tcp._menu.find(".nxp_actionicon[data-command='play']").removeClass("nxp_icon-restart").addClass("nxp_icon-play");_tcp._area.find(".nxp_exit").fadeOut(300,function(){jQuery(this).remove()});_tcp._el.find(".nxp_icon-play").removeClass("nxp_icon-play").addClass("nxp_icon-pause").attr("data-command","pause").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_noplay"));if(p)_tcp._stream.seekRelative(p);else _tcp._stream.seekRelative((m=="seekleft"?"-":"")+_play.config.client.allowseekbuttons);_tcp._ui.updateTooltips()}break;case "next":if(_tcp._online){_tcp._flow.next();if(p!="fromcast")if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("changeplaypos",{index:_tcp._playpos});else _tcp._ui.visualresponse.add("next");else _tcp._ui.castdisplay.build()}break;case "prev":if(_tcp._online){_tcp._flow.prev();if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("changeplaypos",
{index:_tcp._playpos});else _tcp._ui.visualresponse.add("prev")}break;case "fullscreen":_play.system.environment.isPIP=false;if(_tcp._mime!="image")_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).attr("data-command","nofullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nofullscreen"));else{_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).removeClass("nxp_icon-"+
_tcp._ui.getFullscreenIcon(true)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false));_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).parent().attr("data-command","nofullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_nofullscreen"))}_tcp._ui.updateTooltips();_play.system.fullscreen.enter(_tcp._el.attr("id"));if(!_tcp._stream.events.hadFS)if(p=="orientationchange")window.setTimeout(function(){if(_play.system.environment.isFullscreen){_tcp._fullscreenByRotate=
true;_tcp._data.emitEvent(_samaritan.events.FULLSCREEN,{type:"orientationchange"});_tcp._stream.events.hadFS=true}},500);else{_tcp._fullscreenByRotate=false;_tcp._data.emitEvent(_samaritan.events.FULLSCREEN,{type:_tcp._fullscreenreportmode});_tcp._stream.events.hadFS=true}break;case "nofullscreen":_play.system.environment.isPIP=false;_tcp._fullscreenByRotate=false;if(_tcp._mime!="image")_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).addClass("nxp_icon-"+
_tcp._ui.getFullscreenIcon(true)).attr("data-command","fullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_fullscreen"));else{_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).removeClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(false)).addClass("nxp_icon-"+_tcp._ui.getFullscreenIcon(true));_tcp._el.find(".nxp_icon-"+_tcp._ui.getFullscreenIcon(true)).parent().attr("data-command","fullscreen").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_fullscreen"))}_play.system.fullscreen.exit();_tcp._ui.updateTooltips();break;case "lightsout":if(!_play.system.environment.isEmbedded&&!_play.system.environment.isLightsOut)_tcp._ia.interactSidebar("togglelight","manual");break;case "lightson":if(!_play.system.environment.isEmbedded&&_play.system.environment.isLightsOut)_tcp._ia.interactSidebar("togglelight","manual");break;case "swap":if(_tcp._online){_tcp._playparam=p;if(_tcp._playIndex>0)_tcp._playpos=0;_tcp._flow.prepareSwap()}break;case "swaptopos":if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("swaptopos",
p);else if(_tcp._online){_tcp._playpos=p;_tcp._flow.internalSwap()}break;case "init":if(_play.system.environment.isApp&&_app.config.useAppPlayer)_tcp._flow.startNative();else _tcp._ia.onOverlayClick();break;case "showui":_tcp._ia.onEnterPlayer(p==0);break;case "hideui":_tcp._ia.onLeavePlayer();break;case "historyback":_tcp._playparam=_tcp._flow.prevVideo;_tcp._config.delay=_tcp._flow.prevDelay;_play.tools.log("SETTING DELAY TO "+_tcp._config.delay,"HALCYON");_tcp._flow.prepareSwap();break;case "restart":if(!_tcp._useFullPlayer)_tcp._ui.visualresponse.removeAll();
_tcp._data.emitNotification(_play.config.events.REPLAY,{byUserAction:1});_tcp._playPauseByUser=false;_tcp._playedVia="loop";_tcp._el.find(".nxp_icon-play").removeClass("nxp_icon-play").addClass("nxp_icon-pause").attr("data-command","pause").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_noplay"));_tcp._ui.updateTooltips();_tcp._flow.next(true);break;case "resume":_tcp._el.find(".nxp_icon-play").removeClass("nxp_icon-play").addClass("nxp_icon-pause").attr("data-command",
"pause").attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,"option_noplay"));_tcp._ui.updateTooltips();_tcp._stream.simplePlay();break;case "revolver":_tcp._playedVia="revolver";_tcp._flow.revolver.andGo();break;case "cancelrevolver":_tcp._ui.exitdisplay.cancelRevolver();break;case "bannerclick":_tcp._flow.ad.ping("clicknonlinear");_tcp._data.reportAd("banner","vast",false,true);_play.tools.openWindow(_tcp._data.vast.banner[_tcp._flow.ad.bannerIndex]["target"]);break;case "pay":try{if(_play.tools.parseInt(_tcp._data.getMedia("isPay"))>
0)_tcp._flow.pay.checkAfterPreview();else _play.tools.log("NO PAYMENT CHECK NEEDED","HALCYON")}catch(e){}break;case "updateuser":if(_play.config.user.id>0&&_play.tools.parseInt(_tcp._data.getMedia("isPay"))>0)_tcp._flow.pay.checkAfterPreview();break;case "updateconfig":var k=p.split("::");if(Object.keys(_tcp._config).indexOf(k[0])>-1)switch(k[0]){case "menuMode":_tcp._menuMode=k[1];_tcp._config.menuMode=k[1];_tcp._ui.menu.handleMode();break;case "scrollingMode":_tcp._config.scrollingMode=k[1];_tcp._intersectionMode=
k[1];break}break;case "homadadstarted":p=p||_tcp._flow.ad.mode+"roll";_tcp._data.reportAd(p,"homad");_tcp._playingAd=false;break;case "homadadclicked":p=p||_tcp._flow.ad.mode+"roll";_tcp._data.reportAd(p,"homad",false,true);break;case "homadadended":_tcp._data.emitNotification(_play.config.events.AD_ENDED,null,"homad");break}}else _play.tools.log("PLAYING AD, ACCESS DENIED","HALCYON")},interactSidebar:function(m,p){_play.tools.log("HANDLING SIDEBAR COMMAND: "+m+"/"+p,"HALCYON");switch(m){case "rate":case "share":case "embed":case "scenes":case "streamsettings":case "subtitles":case "speed":case "toggleaudio":case "info":var el=
_tcp._el.find(".nxp_sociallayer");if(el.length>0)if(el.first().attr("data-context")!=m)_tcp._ui.addons.layer.build(m);else _tcp._ui.addons.layer.remove();else _tcp._ui.addons.layer.build(m);break;case "togglelight":if(!p)_tcp._stream.events.waitForLightsOut=false;if(_tcp._el.hasClass("nxp_lightson")){_play.system.environment.isLightsOut=false;jQuery("body").find(".nxp_lightsout").removeClass("active");window.setTimeout(function(){_tcp._el.removeClass("nxp_lightson");jQuery(".nxp_lightsout").remove()},
1050);_tcp._data.emitNotification(_play.config.events.LIGHTS_ON)}else{_play.system.environment.isLightsOut=true;jQuery("body").append("<div class='nxp_lightsout'></div>");window.setTimeout(function(){jQuery("body").find(".nxp_lightsout").addClass("active");window.setTimeout(function(){_tcp._el.addClass("nxp_lightson")},250)},150);_tcp._data.emitNotification(_play.config.events.LIGHTS_OUT);if(!_tcp._stream.events.hadLightsout){_tcp._stream.events.hadLightsout=true;_tcp._data.emitEvent(_samaritan.events.LIGHTSOUT,
{mode:p?p:"manual"})}}break;case "nativeshare":_tcp._ia.interactSidebar("shareon","native");break;case "airplay":document.getElementById("nxp_player"+_tcp._index).webkitShowPlaybackTargetPicker();break;case "pip":if(_play.system.environment.isApp)_tcp._stream.pip();else document.getElementById("nxp_player"+_tcp._index).webkitSetPresentationMode(_play.system.environment.isPIP?"inline":"picture-in-picture");break;case "fullscreen":case "nofullscreen":_tcp._ia.interact(m);break;case "setstart":case "setend":_editor.setSceneTime("valid"+
(m=="setstart"?"from":"to"),_play._factory.tools.formatTime(_tcp._stream.getCurrentTime(),true,true));break;case "screenshot":_play.system.connection.callAPI("/manage/images/fromvideo/"+_tcp._data.getMedia("ID"),{time:_tcp._stream.getCurrentTime()});_tcp._ui.addons.notice.build(_play.tools.getClientText("creatingsnapshot"));break;case "like":case "nolike":_tcp._ui.visualresponse.add(m);_tcp._el.find(".nxp_icon-"+m).parent().attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._streamtype,
"option_"+(m=="like"?"nolike":"like"))).attr("data-command",m=="like"?"nolike":"like");_tcp._el.find(".nxp_icon-"+m).removeClass("nxp_icon-"+m).addClass("nxp_icon-"+(m=="like"?"dislike":"like"));_tcp._ui.updateTooltips();_tcp._playlist[_tcp._playpos]["interactiondata"]["isLiked"]=m=="like"?1:0;_play.system.connection.callAPI("/interactions/"+(m=="like"?"add":"remove")+"like",{item:_tcp._data.getMedia("ID"),streamtype:_tcp._streamtype});_tcp._data.emitEvent(_samaritan.events.ENGAGE,{action:"like",
context:m=="like"?"add":"remove",value:0});if(m=="like")if(_play.addons.reco.provider!="")_play.addons.reco[_play.addons.reco.provider].onAction(_tcp._data.getMedia("ID"),_tcp._streamtype,"like",1);break;case "tofavourites":case "fromfavourites":_tcp._ui.visualresponse.add(m);_tcp._el.find(".nxp_icon-"+m).parent().attr("data-tooltip",_play._factory.tools.getMimeClientText(_tcp._playmode,"option_"+(m=="tofavourites"?"notofavourites":"tofavourites"))).attr("data-command",m=="tofavourites"?"fromfavourites":
"tofavourites");_tcp._el.find(".nxp_icon-"+m).removeClass("nxp_icon-"+m).addClass("nxp_icon-"+(m=="tofavourites"?"fromfavourites":"tofavourites"));_tcp._ui.updateTooltips();_tcp._playlist[_tcp._playpos]["interactiondata"]["inFavourites"]=m=="tofavourites"?1:0;_play.system.connection.callAPI("/interactions/"+(m=="tofavourites"?"addto":"removefrom")+"favourites",{item:_tcp._data.getMedia("ID"),streamtype:_tcp._streamtype});_tcp._data.emitEvent(_samaritan.events.ENGAGE,{action:"favourites",context:m==
"tofavourites"?"add":"remove",value:0});if(m=="tofavourites")if(_play.addons.reco.provider!="")_play.addons.reco[_play.addons.reco.provider].onAction(_tcp._data.getMedia("ID"),_tcp._streamtype,"favourite",5);_tcp._ui.addons.notice.build(_play.tools.getClientText("fav"+(m=="tofavourites"?"1":"0")));break;case "shareon":_tcp._data.emitEvent(_samaritan.events.ENGAGE,{action:"share",context:p,value:0});_play.tools.share(p,"",_tcp._config.sharingData.title,_tcp._config.sharingData.url);_tcp._ui.addons.layer.remove();
break;case "gotoscene":_tcp._ui.addons.layer.remove();if(_tcp._stream.m)_tcp._stream.seek(p);break;case "exitswap":case "exitpreviewswap":_tcp._playedVia=m.replace("swap","");for(var k=0;k<_tcp._flow.revolver.items.length;k++)if(_tcp._flow.revolver.items[k]["general"].ID==p){_tcp._flow.revolver.index=k;break}_tcp._flow.revolver.andGo();break}},toggle:function(){if(_tcp._stream.m&&_tcp._area.find(".nxp_exit").length==0)if(!_tcp._stream.m.paused)_tcp._ia.interact("pause");else _tcp._ia.interact("play")}}};
tgk.init=function(options){_play.tools.log("STARTING HALCYON","HALCYON");_tcp._el=jQuery(element);_tcp._width=_tcp._el.width();_tcp._height=_tcp._el.height();_tcp._div=_tcp._el.parent().attr("id");_tcp._area=_tcp._el.find(".cl_nxp_area");_tcp._overlay=_tcp._el.find(".cl_nxp_overlay");_tcp._menu=_tcp._el.find(".cl_nxp_menu");_tcp._loader=_tcp._el.find(".cl_nxp_loadingholder");_tcp._playmode=options.playmode;_tcp._playparam=options.param;if(["videolist","audiolist"].indexOf(options.playmode)==-1)_tcp._playparam=
parseInt(options.param);_tcp._index=options.index;_tcp._config=options.config;_tcp._playpos=options.config.startPosition;if(!_tcp._playpos)_tcp._playpos=0;_play.system.fullscreen.init();if(["collection","playlist","audioalbum"].indexOf(_tcp._playmode)==-1)_tcp._playpos=0;_tcp._data.initConfig();if(_play.system.capabilities.hasCast)if(!_play.system.environment.isBackgroundCasting)_play.addons.cast.setReference(_tcp);if(!_play.system.capabilities.hasTouch&&!_play.system.environment.isCasted){_tcp._el.on("mouseleave",
_tcp._ia.onLeavePlayer);_tcp._el.on("mouseenter",_tcp._ia.onEnterPlayer);_tcp._el.on("mousemove",_tcp._ia.onMouseStill);_tcp._overlay.on("click",function(e){_play._factory.ui.tooltip.hide();if(e.target&&e.target.className)if(e.target.className.toString().indexOf("nxp_icon")==-1){if(jQuery(this).hasClass("clicked")){_tcp._overlay.removeClass("clicked");_tcp._ia.onDoubleClick()}else{jQuery(this).addClass("clicked");window.setTimeout(function(){if(_tcp._overlay.hasClass("clicked")){_tcp._overlay.removeClass("clicked");
_tcp._ia.onOverlayClick()}},125)}return false}});if(_play.system.capabilities.hasFullscreen)_tcp._overlay.on("dblclick",_tcp._ia.onDoubleClick)}else _tcp._overlay.on("click",_tcp._ia.onOverlayClick);_tcp._el.on("click",".nxp_actionicon,.nxp_vresponsestatic,.nxp_button,.nxp_banner,.nxp_tapactionicon,.nxp_sideicon",function(e){_play._factory.ui.tooltip.hide();if(jQuery(this)[0].hasAttribute("data-command")){_tcp._playPauseByUser=true;_tcp._ia.interact(jQuery(this).attr("data-command"));return false}else return true});
_tcp._el.on("click",".nxp_breakadholder",function(){_tcp._flow.ad.ping("clicknonlinear");_tcp._data.reportAd("break","vast",false,true);_play.tools.openWindow(_tcp._data.vast["break"][_tcp._flow.ad.breakIndex]["target"]);return false});if(!_play.system.environment.isCasted&&_tcp._useFullPlayer){_tcp._el.on("click",".nxp_sidebaritem",function(){_play._factory.ui.tooltip.hide();_tcp._ia.interactSidebar(jQuery(this).attr("data-command"));return false});_tcp._el.on("click",".nxp_listitem",function(){_play._factory.ui.tooltip.hide();
if(jQuery(this).attr("data-itemmode")=="streamindex"){_tcp._stream.startChangeStream(jQuery(this).attr("data-index"));if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("setquality",jQuery(this).attr("data-index"))}else if(jQuery(this).attr("data-itemmode")=="speedindex"){_tcp._stream.setPlaybackRate(jQuery(this).attr("data-value"),false,true);if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("setspeed",jQuery(this).attr("data-value"))}else if(jQuery(this).attr("data-itemmode")=="audioindex"){_tcp._stream.multiAudio.switchTrack(jQuery(this).attr("data-index"));
if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("setlanguage",jQuery(this).attr("data-index"))}else if(jQuery(this).attr("data-itemmode")=="polloption"){if(!jQuery(this).hasClass("nxp_voted"))_tcp._ia.onVoted(jQuery(this).attr("data-value"))}else{_tcp._ui.addons.captions.change(jQuery(this).attr("data-index"),jQuery(this).attr("data-value"));if(_tcp._isCasting)_play.addons.cast.sender.sendMessage("setcaptionlanguage",{index:jQuery(this).attr("data-index"),value:jQuery(this).attr("data-value")})}_tcp._ui.addons.layer.remove();
return false});_tcp._el.on("click",".nxp_skip",function(){_play._factory.ui.tooltip.hide();if(_tcp._admodel.type=="ima"||_tcp._admodel.type=="jsima")_tcp._flow.ad.ima.skip();else _tcp._flow.ad.skip();return false});_tcp._el.on("click",".nxp_actionimg",function(){_play._factory.ui.tooltip.hide();_tcp._ia.interactSidebar(jQuery(this).attr("data-command"),jQuery(this).attr("data-param"));return false});_tcp._el.on("click","div[data-link]",function(){_play._factory.ui.tooltip.hide();if(jQuery(this).hasClass("nxp_spot"))_tcp._data.reportSpot(jQuery(this).attr("id").replace("spot_",
""),1);var ta=jQuery(this).attr("data-link");if(ta.substr(0,1)=="/"&&_play.system.environment.isONE){_tcp._playedVia="spot";ta=ta.split("/");if(sizeof(ta)<3)ta[2]="";_one.actions.navigateToVideoWithContext(ta[1],ta[2],ta[1]+"/"+ta[2],_tcp._playedVia)}else{_tcp._ia.interact("pause");_play.tools.openWindow(ta)}});_tcp._el.on("click","div[data-linkedvideo]",function(){if(jQuery(this).attr("id")!="spot_-999"){_play._factory.ui.tooltip.hide();if(jQuery(this).hasClass("nxp_spot"))_tcp._data.reportSpot(jQuery(this).attr("id").replace("spot_",
""),1);_tcp._flow.onEnterLinkedVideo(jQuery(this).attr("data-linkedvideo"))}});_tcp._el.on("mouseenter",".nxp_enabledrate",function(){_tcp._ia.onRate(jQuery(this).attr("data-param"));return false});_tcp._el.on("mouseleave",".nxp_enabledrate",function(){_tcp._el.find(".nxp_hoveredrate").removeClass("nxp_hoveredrate");return false});_tcp._el.on("click",".nxp_enabledrate",function(){_play._factory.ui.tooltip.hide();_tcp._ia.onRated(jQuery(this).attr("data-param"));return false});if(!_play.system.capabilities.hasTouch){_tcp._el.bind("contextmenu",
function(e){if(!_tcp._waitForLive&&!_tcp._usePreview)_tcp._ui.addons.notice.build("nexxPLAY Halcyon [V"+_play.config.constants.PLAYERVERSION+"] \u00a9 "+(new Date).getFullYear()+" nexx.tv");return false});_tcp._el.keydown(function(e){switch(e.which){case 32:_play.tools.log("DETECTED SPACE CLICK","HALCYON");_tcp._ia.onOverlayClick();break;case 77:if(!_tcp._playingAd)if(e.originalEvent)if(e.originalEvent.ctrlKey){_play.tools.log("DETECTED SHIFT-M CLICK","HALCYON");if(_tcp._useMidRolls){_play.tools.log("FORCING MIDROLL",
"HALCYON");_tcp._stream.events.midrollcounter=-1;if(_tcp._flow.ad.allowMid)_tcp._flow.ad.load("mid");else _play.tools.log("MIDROLLS FORBIDDEN","HALCYON")}else _play.tools.log("NO MIDROLL DEFINED","HALCYON")}break;case 13:_play.tools.log("DETECTED ENTER CLICK","HALCYON");if(document.activeElement){var c=document.activeElement.getAttribute("data-command");if(c)if(document.activeElement.className.indexOf("nxp_sidebaritem")>-1)_tcp._ia.interactSidebar(c);else if(document.activeElement.className.indexOf("nxp_actionimg")>
-1)_tcp._ia.interactSidebar(c,document.activeElement.getAttribute("data-param"));else _tcp._ia.interact(c)}break}})}}if(!_play.system.capabilities.hasInlineVideo||_play.system.environment.isApp)if(!_play.system.environment.isApp){_tcp._useFullPlayer=_play.system.capabilities.hasInlineVideo;if(!_tcp._useFullPlayer)_tcp._fullscreenreportmode="auto"}else if(!_app.config.useAppPlayer){_tcp._useFullPlayer=_play.system.capabilities.hasInlineVideo;if(!_app.config.hasPhysicalPlayer)_tcp._fullscreenreportmode=
"auto"}else _tcp._useFullPlayer=false;_tcp._el.addClass("nxp_startmode");_tcp._ui.show();if(!_tcp._useFullPlayer)_tcp._el.addClass("nxp_inline");if(_play.system.environment.isCasted)_tcp._el.addClass("nxp_casted");else if(_play.system.isTV())_tcp._el.addClass("nxp_casted nxp_tv");_tcp._startMode=true;_tcp._ia.interact("swap",options.param);if(_play.system.environment.isCasted)jQuery("#chromecast-receiver-preload").addClass("hidden")};tgk.resize=function(p){_tcp._ui.onResize(p)};tgk.fullscreenChange=
function(){if(_play.system.environment.isFullscreen)_tcp._data.emitNotification(_play.config.events.ENTER_FULLSCREEN);else _tcp._data.emitNotification(_play.config.events.EXIT_FULLSCREEN);_tcp._ui.onResize();if(_tcp._playingAd){_tcp._flow.ad.four.sendEvent("AdSizeChange");_tcp._flow.ad.four.sendEvent("AdInteraction")}};tgk.headsetChange=function(){if(_play.system.device.isHeadsetConnected)if(!_tcp._stream.events.hadHeadset)_tcp._data.emitEvent(_samaritan.events.HEADSET,{})};tgk.orientationChange=
function(){_tcp._ui.onOrientationChange()};tgk.pageVisibilityChange=function(){if(_tcp._stream.m&&(_tcp._pauseOnPageVisibility==2||_tcp._pauseOnPageVisibility==1&&_tcp._playingAd))if(!_tcp._isCasting&&!_play.system.environment.isPIP&&!_tcp._isPlayingExternal)if(!_play.system.environment.isVisible)_tcp._ia.interact("pause",true);else if(!_tcp._previewPaused)_tcp._ia.interact("continue")};tgk.networkstateChange=function(){_tcp._ui.onNetworkEvent()};tgk.exitLegacyFullscreen=function(){_tcp._ia.onExitLegacyFullscreen()};
tgk.remove=function(){_tcp._ia.onRemove()};tgk.interact=function(m,p){_tcp._ia.interact(m.toLowerCase(),p)};tgk.castcommand=function(m,p){_tcp._ia.onCastCommand(m,p)};tgk.swapComplex=function(item,plm,plpos,delay){_tcp._ui.showLoader();if(!plm||plm==_tcp._playmode)_tcp._ia.interact("swap",item);else{plpos=plpos||0;delay=delay||0;_tcp._playmode=plm;_tcp._playparam=item;_tcp._playpos=plpos;_tcp._config.delay=delay;_tcp._data.checkParent();_tcp._playIndex=-1;_tcp._ia.interact("swap",_tcp._playparam)}};
tgk.getMediaData=function(){return _tcp._data.getMediaData()};tgk.getCaptionData=function(){return _tcp._data.getMediaObject("captiondata")};tgk.getCurrentTime=function(){return _tcp._stream.getCurrentTime()};tgk.isPlaying=function(){return _tcp._stream.isRunning()};tgk.isShowingUI=function(){return _tcp._ui.isShowing};tgk.editHotSpot=function(type,text,addon,link,auto,x,y,lv,th,st,ol,or){_play.tools.log("EDITING HOTSPOT","HALCYON");_tcp._ui.addons.spots.edit(type,text,addon,link,auto,x,y,lv,th,st,
ol,or)};tgk.init(options)};jQuery.fn.halcyon=function(options){return this.each(function(){if(undefined==jQuery(this).data("halcyon")){var plugin=new jQuery.halcyon(this,options);jQuery(this).data("halcyon",plugin)}})}};
Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,f=!{toString:null}.propertyIsEnumerable("toString"),c="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),g=c.length;return function(b){if("object"!==typeof b&&"function"!==typeof b||null===b)throw new TypeError("Object.keys called on non-object");var d=[],a;for(a in b)e.call(b,a)&&d.push(a);if(f)for(a=0;a<g;a++)e.call(b,c[a])&&d.push(c[a]);return d}}());

"function"!=typeof Object.assign&&(Object.assign=function(a){if(null==a)throw new TypeError("Cannot convert undefined or null to object");a=Object(a);for(var c=1;c<arguments.length;c++){var b=arguments[c];if(null!=b)for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d])}return a});

if(typeof(md5)=="undefined"){md5=function(){for(var m=[],l=0;64>l;)m[l]=0|4294967296*Math.abs(Math.sin(++l));return function(c){var e,g,f,a,h=[];c=unescape(encodeURI(c));for(var b=c.length,k=[e=1732584193,g=-271733879,~e,~g],d=0;d<=b;)h[d>>2]|=(c.charCodeAt(d)||128)<<8*(d++%4);h[c=16*(b+8>>6)+14]=8*b;for(d=0;d<c;d+=16){b=k;for(a=0;64>a;)b=[f=b[3],(e=b[1]|0)+((f=b[0]+[e&(g=b[2])|~e&f,f&e|~f&g,e^g^f,g^(e|~f)][b=a>>4]+(m[a]+(h[[a,5*a+1,3*a+5,7*a][b]%16+d]|0)))<<(b=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*b+a++%4])|f>>>32-b),e,g];for(a=4;a;)k[--a]=k[a]+b[a]}for(c="";32>a;)c+=(k[a>>3]>>4*(1^a++&7)&15).toString(16);return c}}();}

!function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)i(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,u(n,e))})}catch(o){if(t)return;t=!0,u(n,o)}}var a=setTimeout;o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new c(e,t,o)),o},o.all=function(e){var n=Array.prototype.slice.call(e);return new o(function(e,t){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(e){o(r,e)},t)}n[r]=u,0===--i&&e(n)}catch(c){t(c)}}if(0===n.length)return e([]);for(var i=n.length,r=0;r<n.length;r++)o(r,n[r])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(n){n(e)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(e){return new o(function(n,t){for(var o=0,i=e.length;o<i;o++)e[o].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){a(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this);

(function(k,g){function l(a){this.time=a.time;this.target=a.target;this.rootBounds=a.rootBounds;this.boundingClientRect=a.boundingClientRect;this.intersectionRect=a.intersectionRect||m();this.isIntersecting=!!a.intersectionRect;a=this.boundingClientRect;a=a.width*a.height;var b=this.intersectionRect,b=b.width*b.height;this.intersectionRatio=a?b/a:this.isIntersecting?1:0}function d(a,b){var c=b||{};if("function"!=typeof a)throw Error("callback must be a function");if(c.root&&1!=c.root.nodeType)throw Error("root must be an Element");
	this._checkForIntersections=u(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT);this._callback=a;this._observationTargets=[];this._queuedEntries=[];this._rootMarginValues=this._parseRootMargin(c.rootMargin);this.thresholds=this._initThresholds(c.threshold);this.root=c.root||null;this.rootMargin=this._rootMarginValues.map(function(a){return a.value+a.unit}).join(" ")}function u(a,b){var c=null;return function(){c||(c=setTimeout(function(){a();c=null},b))}}function n(a,b,c,e){"function"==
typeof a.addEventListener?a.addEventListener(b,c,e||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,c)}function r(a,b,c,e){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,e||!1):"function"==typeof a.detatchEvent&&a.detatchEvent("on"+b,c)}function p(a){try{var b=a.getBoundingClientRect()}catch(c){}if(!b)return m();b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top});return b}function m(){return{top:0,bottom:0,
	left:0,right:0,width:0,height:0}}function t(a,b){for(var c=b;c;){if(c==a)return!0;c=q(c)}return!1}function q(a){return(a=a.parentNode)&&11==a.nodeType&&a.host?a.host:a}if("IntersectionObserver"in k&&"IntersectionObserverEntry"in k&&"intersectionRatio"in l.prototype)"isIntersecting"in l.prototype||Object.defineProperty(l.prototype,"isIntersecting",{get:function(){return 0<this.intersectionRatio}});else{var h=[];d.prototype.THROTTLE_TIMEOUT=100;d.prototype.POLL_INTERVAL=null;d.prototype.observe=function(a){if(!this._observationTargets.some(function(b){return b.element==
		a})){if(!a||1!=a.nodeType)throw Error("target must be an Element");this._registerInstance();this._observationTargets.push({element:a,entry:null});this._monitorIntersections()}};d.prototype.unobserve=function(a){this._observationTargets=this._observationTargets.filter(function(b){return b.element!=a});this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())};d.prototype.disconnect=function(){this._observationTargets=[];this._unmonitorIntersections();this._unregisterInstance()};
	d.prototype.takeRecords=function(){var a=this._queuedEntries.slice();this._queuedEntries=[];return a};d.prototype._initThresholds=function(a){a=a||[0];Array.isArray(a)||(a=[a]);return a.sort().filter(function(a,c,e){if("number"!=typeof a||isNaN(a)||0>a||1<a)throw Error("threshold must be a number between 0 and 1 inclusively");return a!==e[c-1]})};d.prototype._parseRootMargin=function(a){a=(a||"0px").split(/\s+/).map(function(a){a=/^(-?\d*\.?\d+)(px|%)$/.exec(a);if(!a)throw Error("rootMargin must be specified in pixels or percent");
		return{value:parseFloat(a[1]),unit:a[2]}});a[1]=a[1]||a[0];a[2]=a[2]||a[0];a[3]=a[3]||a[1];return a};d.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this._checkForIntersections(),this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(n(k,"resize",this._checkForIntersections,!0),n(g,"scroll",this._checkForIntersections,!0),"MutationObserver"in k&&(this._domObserver=new MutationObserver(this._checkForIntersections),
		this._domObserver.observe(g,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))};d.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,r(k,"resize",this._checkForIntersections,!0),r(g,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))};d.prototype._checkForIntersections=function(){var a=this._rootIsInDom(),
		b=a?this._getRootRect():m();this._observationTargets.forEach(function(c){var e=c.element,d=p(e),f=this._rootContainsTarget(e),g=c.entry,h=a&&f&&this._computeTargetAndRootIntersection(e,b);c=c.entry=new l({time:k.performance&&performance.now&&performance.now(),target:e,boundingClientRect:d,rootBounds:b,intersectionRect:h});g?a&&f?this._hasCrossedThreshold(g,c)&&this._queuedEntries.push(c):g&&g.isIntersecting&&this._queuedEntries.push(c):this._queuedEntries.push(c)},this);this._queuedEntries.length&&
	this._callback(this.takeRecords(),this)};d.prototype._computeTargetAndRootIntersection=function(a,b){if("none"!=k.getComputedStyle(a).display){for(var c=p(a),e=q(a),d=!1;!d;){var f=null,h=1==e.nodeType?k.getComputedStyle(e):{};if("none"==h.display)return;e==this.root||e==g?(d=!0,f=b):e!=g.body&&e!=g.documentElement&&"visible"!=h.overflow&&(f=p(e));if(f){var h=Math.max(f.top,c.top),l=Math.min(f.bottom,c.bottom),m=Math.max(f.left,c.left),c=Math.min(f.right,c.right),f=c-m,n=l-h,c=0<=f&&0<=n&&{top:h,
		bottom:l,left:m,right:c,width:f,height:n};if(!c)break}e=q(e)}return c}};d.prototype._getRootRect=function(){if(this.root)var a=p(this.root);else{a=g.documentElement;var b=g.body;a={top:0,left:0,right:a.clientWidth||b.clientWidth,width:a.clientWidth||b.clientWidth,bottom:a.clientHeight||b.clientHeight,height:a.clientHeight||b.clientHeight}}return this._expandRectByRootMargin(a)};d.prototype._expandRectByRootMargin=function(a){var b=this._rootMarginValues.map(function(b,e){return"px"==b.unit?b.value:
		b.value*(e%2?a.width:a.height)/100}),b={top:a.top-b[0],right:a.right+b[1],bottom:a.bottom+b[2],left:a.left-b[3]};b.width=b.right-b.left;b.height=b.bottom-b.top;return b};d.prototype._hasCrossedThreshold=function(a,b){var c=a&&a.isIntersecting?a.intersectionRatio||0:-1,e=b.isIntersecting?b.intersectionRatio||0:-1;if(c!==e)for(var d=0;d<this.thresholds.length;d++){var f=this.thresholds[d];if(f==c||f==e||f<c!==f<e)return!0}};d.prototype._rootIsInDom=function(){return!this.root||t(g,this.root)};d.prototype._rootContainsTarget=
		function(a){return t(this.root||g,a)};d.prototype._registerInstance=function(){0>h.indexOf(this)&&h.push(this)};d.prototype._unregisterInstance=function(){var a=h.indexOf(this);-1!=a&&h.splice(a,1)};k.IntersectionObserver=d;k.IntersectionObserverEntry=l}})(window,document);

!function(a){"use strict";function b(b,c){var d=a.createEvent("Event");d.initEvent(b,!0,!1),c.dispatchEvent(d)}function c(c){c.stopPropagation(),c.stopImmediatePropagation(),a[j.enabled]=a[f.enabled],a[j.element]=a[f.element],b(j.events.change,c.target)}function d(a){b(j.events.error,a.target)}function e(b){return function(c,d){function e(){c(),a.removeEventListener(f.events.change,e,!1)}function g(){d(new TypeError),a.removeEventListener(f.events.error,g,!1)}return b!==j.exit||a[f.element]?(a.addEventListener(f.events.change,e,!1),void a.addEventListener(f.events.error,g,!1)):void setTimeout(function(){d(new TypeError)},1)}}var f,g,h=!0,i={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitCancelFullScreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},j=i.w3;for(g in i)if(i[g].enabled in a){f=i[g];break}return!h||j.enabled in a||!f||(a.addEventListener(f.events.change,c,!1),a.addEventListener(f.events.error,d,!1),a[j.enabled]=a[f.enabled],a[j.element]=a[f.element],a[j.exit]=function(){var b=a[f.exit]();return!b&&window.Promise?new Promise(e(j.exit)):b},Element.prototype[j.request]=function(){var a=this[f.request].apply(this,arguments);return!a&&window.Promise?new Promise(e(j.request)):a}),f}(document);

//js.cookie v2.2.0
(function(m){var h=!1;"function"===typeof define&&define.amd&&(define(m),h=!0);"object"===typeof exports&&(module.exports=m(),h=!0);if(!h){var e=window.Cookies,a=window.Cookies=m();a.noConflict=function(){window.Cookies=e;return a}}})(function(){function m(){for(var e=0,a={};e<arguments.length;e++){var b=arguments[e],c;for(c in b)a[c]=b[c]}return a}function h(e){function a(b,c,d){if("undefined"!==typeof document){if(1<arguments.length){d=m({path:"/"},a.defaults,d);if("number"===typeof d.expires){var k=
	new Date;k.setMilliseconds(k.getMilliseconds()+864E5*d.expires);d.expires=k}d.expires=d.expires?d.expires.toUTCString():"";try{var g=JSON.stringify(c);/^[\{\[]/.test(g)&&(c=g)}catch(p){}c=e.write?e.write(c,b):encodeURIComponent(String(c)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);b=encodeURIComponent(String(b));b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);b=b.replace(/[\(\)]/g,escape);g="";for(var l in d)d[l]&&(g+="; "+l,!0!==d[l]&&(g+="="+
	d[l]));return document.cookie=b+"="+c+g}b||(g={});l=document.cookie?document.cookie.split("; "):[];for(var h=/(%[0-9A-Z]{2})+/g,n=0;n<l.length;n++){var q=l[n].split("="),f=q.slice(1).join("=");this.json||'"'!==f.charAt(0)||(f=f.slice(1,-1));try{k=q[0].replace(h,decodeURIComponent);f=e.read?e.read(f,k):e(f,k)||f.replace(h,decodeURIComponent);if(this.json)try{f=JSON.parse(f)}catch(p){}if(b===k){g=f;break}b||(g[k]=f)}catch(p){}}return g}}a.set=a;a.get=function(b){return a.call(a,b)};a.getJSON=function(){return a.apply({json:!0},
	[].slice.call(arguments))};a.defaults={};a.remove=function(b,c){a(b,"",m(c,{expires:-1}))};a.withConverter=h;return a}return h(function(){})});

//clipboard.js v1.7.1
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n||t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){function o(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=o},{}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}var r=t("./closest");e.exports=o},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return l(document.body,t,e,n)}var c=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}e.exports=o},{}],6:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],7:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if(void 0!==o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return a(t,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function t(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-0px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function t(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function t(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if(void 0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var s=i(e),u=i(n),f=i(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){r(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})}},{key:"onClick",value:function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function t(e){return l("action",e)}},{key:"defaultTarget",value:function t(e){var n=l("target",e);if(n)return document.querySelector(n)}},{key:"defaultText",value:function t(e){return l("text",e)}},{key:"destroy",value:function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
var exportz = exportz || {};
(function(exports) {
	"use strict";

	var conf = {
		'globalConfig': document.location.protocol+"//s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/global_config.json",
		'clientConfig': _play.addons.svm.getConfig,
		'prechecked': false,
		'adTag': null,
		'onReady': _play.addons.svm.onReady
	};

	var exportz=exportz||{};
	(function(h){h=h||{};(function(l){function c(){this.u="setup"}l.g=c;c.prototype={c:function(a){a=a&&"number"===typeof a&&0<a?Math.round(a):10;for(var f="",d=0;d<a;d++)f+=String.fromCharCode((.5>Math.random()?65:97)+Math.floor(26*Math.random()));return f},A:function(a){function f(e){var a="",b,d;for(b=7;0<=b;b--)d=e>>>4*b&15,a+=d.toString(16);return a}function d(e,a){return e<<a|e>>>32-a}var b,k,c=Array(80),l=1732584193,q=4023233417,p=2562383102,h=271733878,t=3285377520,g,m,n,r,e;a=a&&"string"===typeof a?
		a:"";g=a.length;var u=[];for(b=0;b<g-3;b+=4)k=a.charCodeAt(b)<<24|a.charCodeAt(b+1)<<16|a.charCodeAt(b+2)<<8|a.charCodeAt(b+3),u.push(k);switch(g%4){case 0:b=2147483648;break;case 1:b=a.charCodeAt(g-1)<<24|8388608;break;case 2:b=a.charCodeAt(g-2)<<24|a.charCodeAt(g-1)<<16|32768;break;case 3:b=a.charCodeAt(g-3)<<24|a.charCodeAt(g-2)<<16|a.charCodeAt(g-1)<<8|128}for(u.push(b);14!=u.length%16;)u.push(0);u.push(g>>>29);u.push(g<<3&4294967295);for(a=0;a<u.length;a+=16){for(b=0;16>b;b++)c[b]=u[a+b];for(b=
																																																																																																																																  16;79>=b;b++)c[b]=d(c[b-3]^c[b-8]^c[b-14]^c[b-16],1);k=l;g=q;m=p;n=h;r=t;for(b=0;19>=b;b++)e=d(k,5)+(g&m|~g&n)+r+c[b]+1518500249&4294967295,r=n,n=m,m=d(g,30),g=k,k=e;for(b=20;39>=b;b++)e=d(k,5)+(g^m^n)+r+c[b]+1859775393&4294967295,r=n,n=m,m=d(g,30),g=k,k=e;for(b=40;59>=b;b++)e=d(k,5)+(g&m|g&n|m&n)+r+c[b]+2400959708&4294967295,r=n,n=m,m=d(g,30),g=k,k=e;for(b=60;79>=b;b++)e=d(k,5)+(g^m^n)+r+c[b]+3395469782&4294967295,r=n,n=m,m=d(g,30),g=k,k=e;l=l+k&4294967295;q=q+g&4294967295;p=p+m&4294967295;h=h+n&
		4294967295;t=t+r&4294967295}return(f(l)+f(q)+f(p)+f(h)+f(t)).toLowerCase()},j:function(a){for(var f="",d,b,c,l,h,q,p=0;p<a.length;)d=a.charCodeAt(p++),b=a.charCodeAt(p++),c=a.charCodeAt(p++),l=d>>2,d=(d&3)<<4|b>>4,h=(b&15)<<2|c>>6,q=c&63,isNaN(b)?h=q=64:isNaN(c)&&(q=64),f=f+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+
		"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q);return f},fireEvent:function(a,f,d){var b=this.u,c=document.createEvent("CustomEvent");d.state=b;c.initCustomEvent(f,!1,!1,d);a.dispatchEvent(c)},l:function(a,f,d){f||(f="hdEvent");d||(d=window);this.fireEvent(d,f,a)},track:function(a,f,d){d&&(homad&&homad.K?homad.isEnabled&&(d=homad.R()+"?homad_track_key="+encodeURIComponent(a)+"&homad_track_value="+encodeURIComponent(f),homad.o(d,!0),d=homad.o(d,!0),d.data.homad_url_prefix_alias=
			"",d.data.homad_track_key=encodeURIComponent(a),d.data.homad_track_value=encodeURIComponent(f),homad.N(d,function(){})):window.setTimeout(function(){this.track(a,f)}.bind(this),500))}}})(h);var v=h.g||v;new v;var w=new v;(function(l){function c(a){this.data=a||{}}l.f=c;c.P=function(a,f){var d={},b;for(b in f)d[b]=f[b];for(b in a)d[b]=a[b];return d};c.w={code:"1000",type:"penalty",message:""};c.T={code:"1001",type:"mediaerror",message:""};c.V={code:"1002",type:"vpaid",message:""};c.M={code:"1003",
		type:"emptyVast",message:""};c.C={code:"1004",type:"malformattedXML"};c.H={code:"1005",type:"adStart"};c.D={code:"1006",type:"adFirstQuartile"};c.G={code:"1007",type:"adMidPoint"};c.I={code:"1008",type:"adThirdQuartile"};c.i={code:"1009",type:"adComplete"};c.F={code:"1010",type:"adImpressionsCalled"};c.U={code:"1011",type:"vastLoadingFailed"};c.S={code:"1012",type:"noCreative"};c.O={code:"1013",type:"emptyVastFromHomadServerEvent",message:""};c.B={code:"1014",type:"wrapperLimitReached",message:""};
		c.J={code:"1015",type:"clickthrough",message:""};c.L={code:"1016",type:"continueContent",message:""};c.prototype={}})(h);var z=h.f||z;(function(l){function c(){}l.h=c;c.prototype={s:function(a){var f=0,d,b,c;if(0==a.length)return f;d=0;for(c=a.length;d<c;d++)b=a.charCodeAt(d),f=(f<<5)-f+b,f|=0;return Math.abs(f)},m:function(){return Math.round(Date.now()/1E3/3600/24)+navigator.appCodeName+navigator.appName+navigator.appVersion+navigator.userAgent+navigator.platform+(navigator.language||navigator.i||
		"x")},a:function(a){a=parseInt(a);if(65<=a&&90>=a||97<=a&&122>=a)return String.fromCharCode(a);if(0>=a)return"";if(65>a)return this.a(a+65);if(90<a)return this.a(Math.round(a/2))},reverse:function(a){for(var c="",d=a.length-1,c="";0<=d;c+=a[d--]);return c},b:function(){for(var a=this.s(this.m()+""),a=(a+""+this.reverse(a+"")).match(/.{1,2}/g),c="",d=0;d<a.length;d++)c+=this.a(a[d]);0==c.length&&(c="zork");return c},v:function(){return this.b()+"2"}}})(h);var y=h.h||y;(function(){function l(){if(p)conf.startPlayer&&
	eval(conf.startPlayer),document.fp_error=!0,document.hd_ready=!0;else{var e=document.createElement("script");e.type="text/javascript";e.src="https://hgc-cf-cache-1.svonm.com/hd-main.js?cache="+w.c(10);e.onerror=d;document.head.firstChild?document.head.insertBefore(e,document.head.firstChild):document.head.appendChild(e);var e=new y,a=document.createEvent("CustomEvent");conf.version="20170508_2108_737";a.initCustomEvent(e.b(),!1,!1,conf);window.setInterval(function(){window.dispatchEvent(a)},500);
		c()}}function c(){var e=new y;r=window.setTimeout(function(){a()},15E3);window.addEventListener(e.v(),function(){window.clearTimeout(r)})}function a(){for(var e=document.getElementsByTagName("video"),a=0;a<e.length;a++){try{e[a]&&e[a].pause&&"function"==typeof e[a].pause&&e[a].pause()}catch(b){}e[a].parentNode.removeChild(e[a])}e=document.getElementsByTagName("object");for(a=0;a<e.length;a++)e[a].parentNode.removeChild(e[a]);e=document.getElementsByClassName("video-wrapper");for(a=0;a<e.length;a++)e[a]&&
	e[a].parentNode&&e[a].parentNode.removeChild(e[a]);e=document.getElementsByClassName("videoplayer");for(a=0;a<e.length;a++)e[a]&&e[a].parentNode&&e[a].parentNode.removeChild(e[a]);if(window.self!=window.top)for(e=window.document;e.hasChildNodes();)e.removeChild(e.lastChild)}function f(){if(t){var e="fail-init-100.gif"+v();h(t,function(){},function(){},{homad_url_prefix_alias:g,homad_url_suffix_base64:w.j(e),homad_url_suffix:e,homad_hash_guessed:"true"})}w.l(z.w);x&&"function"===typeof x?x():(a(),
		window.setInterval(a,500),window.setTimeout(a,1500))}function d(){var a=document.createElement("script");a.type="text/javascript";a.src="https://s3.amazonaws.com/homad-global-configs.schneevonmorgen.com/hd-main.js?cache="+w.c(10);a.onerror=f;document.head.firstChild?document.head.insertBefore(a,document.head.firstChild):document.head.appendChild(a)}function b(a){p||(p=!q(a.enabled));l()}function k(a){a&&a.server&&a.server[0]&&(t=(a.server[1]+"").replace("[hash]",w.A((new Date).getTime()+"")),g="homadvastimpressions");
		p?l():(p=!q(a.enabled))?l():h(a.config,b,l)}function h(a,b,c,d){var f=new XMLHttpRequest;f.onreadystatechange=function(){if(b&&4==f.readyState&&200==f.status){var a={};try{a=JSON.parse(f.responseText)}catch(e){a.enabled="false"}b(a)}c&&4==f.readyState&&200!=f.status&&c(f)};try{if(d){f.open("POST",a,!0);a=d;d="";for(var g in a)d+="&"+g+"="+encodeURIComponent(a[g]);d=d.substr(1);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.send(d)}else f.open("GET",a,!0),f.send()}catch(k){c&&
	c(f)}}function v(){var a="?c=unknown";window&&window.location&&window.location.hostname&&(a="?c="+window.location.hostname);return a}function q(a){return"True"==a||"true"==a||1==a||"1"==a||1==a}var p=!1,x=conf.onFailure,t="",g="",m=!1,n=0,r=!1;h(conf.globalConfig,function(a){p?l():p=!q(a.enabled)});"string"===typeof conf.clientConfig?h(conf.clientConfig,k,function(){window.setTimeout(function(){h(conf.clientConfig,k,function(){window.setTimeout(f,1500)})},500)}):m=window.setInterval(function(){var a=
		"";try{a=conf.clientConfig(),n++,a?(k(a),window.clearInterval(m)):50<=n&&(window.clearInterval(m),f())}catch(b){}},100)})()}).call(exportz,exportz);

}.bind(exportz))(exportz);

(function(){
	if((typeof(_app)=="object")&&(typeof(_app.config)=="object")){
		if(_app.config.enableDebug){
			_play.config.enableDebug();
		}
		if(_app.config.stageProvider!=""){
			_play.config.enableStage(_app.config.stageProvider);
		}
	}else{
		if(_play.tools.getURL().indexOf('-dev-')>-1){
			_play.config.enableStage(_play.tools.getURL().substr(_play.tools.getURL().indexOf('-dev-'),8));
		}else if(_play.tools.parseInt(_play.tools.getQueryParam('enablePLAYDebug'))==1){
			_play.config.enableDebug();
		}else if("currentScript" in document){
			if(document.currentScript.src.indexOf('-dev-')>-1){
				_play.config.enableStage(document.currentScript.src.substr(document.currentScript.src.indexOf('-dev-'),8));
			}else if(document.currentScript.src.indexOf('enablePLAYDebug')>-1){
				_play.config.enableDebug();
			}
		}
	}
	_play.session.init();
})();