PageSourceSearch

https://www.moov-africa.tv/_nuxt/BCdR9ulW.js

js moov-africa.tv collected 2026-10-02 16:11:10 UTC 27,110 bytes, 1 lines download raw bytes

1import{b8 as y}from"./N7dC8Bi1.js";class f{constructor(e){e?this._date=new Date(e):this._date=new Date}get date(){return this._date}get time(){return this._date.getTime()}get hours(){return this._date.getHours()}get minutes(){return this._date.getMinutes()}formatHoursMinutesLoc(){let e=this.hours,t=this.minutes;return e<10&&(e="0"+e),t<10&&(t="0"+t),e+":"+t}}class T extends cast.framework.QueueBase{constructor(){super(),this.items=[]}initialize(e){if(e){let t=e.queueData;if(!t){t=new cast.framework.messages.QueueData;const s=new cast.framework.messages.QueueItem;s.media=e.media,t.items=[s]}return t}}setItems(e){this.items=[],e.forEach(t=>{const s=new cast.framework.messages.QueueItem;s.media=new cast.framework.messages.MediaInformation,s.media.streamType=cast.framework.messages.StreamType.BUFFERED,s.media.metadata=new cast.framework.messages.MovieMediaMetadata,s.media.metadata.title=t.metadata.title,s.media.metadata.synopsis=t.metadata.description,s.customData=t,this.items.push(s)})}nextItems(e){const t=this.items[e-1];if(t){const s=window.receiver,a=new s.framework.messages.ErrorData(s.framework.messages.ErrorType.LOAD_FAILED),i={idAsset:t.customData.id,idAudioLang:t.customData.idAudioLang,idSubtitleLang:t.customData.idSubtitleLang};return s.request.post("readAsset",i).then(r=>r.status?(s.onReadAssetSuccess(r,t),i.asUrl=!0,s.request.post("getVodLicense",i).then(n=>n.status?(s.onGetVodLicenseSuccess(n,t),t):a).catch(n=>(console.log(n),a))):a).catch(r=>(console.log(r),a))}}prevItems(e){return[this.items[0]]}}class A{constructor(){this.config={url:"",key:""},this.lastAuthToken="",this.lastProfileToken=""}post(e,t){return new Promise((s,a)=>{const i=new XMLHttpRequest,r=this.config.url+"/proxy/"+e;i.open("POST",r),i.setRequestHeader("X-AN-WebService-IdentityKey",this.config.key),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.lastAuthToken&&i.setRequestHeader("X-AN-WebService-CustomerAuthToken",this.lastAuthToken),this.lastProfileToken&&i.setRequestHeader("X-AN-WebService-ProfileToken",this.lastProfileToken),i.onload=()=>{if(i.status>=200&&i.status<300){const n=JSON.parse(i.response);n.status&&n.result&&n.result.newAuthToken&&this.setLastAuthToken(n.result.newAuthToken),s(n)}else a(i.statusText)},i.send(this.objectToQuery(t))})}get(e){return new Promise((t,s)=>{const a=new XMLHttpRequest,i=this.config.url+e;a.open("GET",i),a.setRequestHeader("X-AN-WebService-IdentityKey",this.config.key),this.lastAuthToken&&a.setRequestHeader("X-AN-WebService-CustomerAuthToken",this.lastAuthToken),a.onload=()=>{if(a.status>=200&&a.status<300){const r=JSON.parse(a.response);t(r)}else s(a.statusText)},a.send()})}getJson(e){return new Promise((t,s)=>{const a=new XMLHttpRequest;a.open("GET",e),a.responseType="json",a.onload=()=>{a.status>=200&&a.status<300?t(a.response):s(a.statusText)},a.send()})}objectToQuery(e){const t=encodeURIComponent,s=[];for(const a in e){const i=e[a];if(i)if(i instanceof Array)for(let r=0;r<i.length;r++)s.push(t(a)+"[]="+t(i[r]));else s.push(t(a)+"="+(i instanceof Object?JSON.stringify(i):t(i)))}return s.join("&").replace(/%20/g,"+")}setTokens(e){this.setLastAuthToken(e.authToken),e.profileToken&&this.setLastProfileToken(e.profileToken)}setConfig(e){this.config=e}setLastAuthToken(e){this.lastAuthToken=e}setLastProfileToken(e){this.lastProfileToken=e}}class I{constructor(e){this._ctx=e}get ctx(){return this._ctx}ellipsizeText(e,t){e.style.transition="",e.style.opacity="0",e.innerHTML=t,setTimeout(()=>{const s=e.innerHTML.split(" ");let a=0;for(;e.scrollHeight>e.offsetHeight&&a<500;)s.pop(),e.innerHTML=s.join(" ")+"...",a++;e.style.transition="opacity .2s linear",e.style.opacity="1"},400)}formatDurationHoursMinutes(e){const t=Math.floor(e/60),s=e%60,a=(s<10?"0":"")+s;return(t?t+"h":"")+(a?a+"mn":"")}isLocalWeb(){return navigator.platform==="Linux x86_64"||navigator.platform==="Win32"}}const g="gecko-chromecast";class b{constructor({translations:e,baseUrl:t,apiKey:s,drmProtection:a,drmProvider:i,maxInactivity:r,displayWatermark:n,debug:o}){this.request=new A,this.utils=new I,this.framework=cast.framework,this.context=this.framework.CastReceiverContext.getInstance(),this.castDebugLogger=cast.debug.CastDebugLogger.getInstance(),this.playerManager=this.context.getPlayerManager(),this.castMediaPlayer=document.getElementById("castMediaPlayer"),this.controls=this.framework.ui.Controls.getInstance(),this.playbackConfig=new this.framework.PlaybackConfig,this.castReceiverOptions=new this.framework.CastReceiverOptions,this.config={apiKey:s,drmProvider:i,drmProtection:a,maxInactivity:r,debug:o,displayWatermark:n},this.translations=e,this.baseUrl=t,this.media={},this.previousMedia={},this.paused=!1,this.firstPlayingDone=!1,this.isProxyMessage=!1,this.highlightedTimeout=null,this.positionMsgInterval=null,this.queue=new T,this.eventCodeEnum={REQUEST_LOAD:{LIVE:1,VOD_MOVIE:1001,VOD_SERIES:1001,VOD_CATCHUP:1001},PLAYING:{LIVE:2,VOD_MOVIE:1002,VOD_SERIES:1002,VOD_CATCHUP:1002},SEEKING:{LIVE:4,VOD_MOVIE:1004,VOD_SERIES:1004,VOD_CATCHUP:1004},MEDIA_FINISHED:{VOD_MOVIE:1005,VOD_SERIES:1005,VOD_CATCHUP:1005},PAUSE:{VOD_MOVIE:1006,VOD_SERIES:1006,VOD_CATCHUP:1006},REQUEST_STOP:{LIVE:7,VOD_MOVIE:1007,VOD_SERIES:1007,VOD_CATCHUP:1007},RESUME:{LIVE:8,VOD_MOVIE:1008,VOD_SERIES:1008,VOD_CATCHUP:1008},ERROR:{LIVE:52,VOD_MOVIE:1052,VOD_SERIES:1052,VOD_CATCHUP:1052}},this.imageTypeEnum={VOD_MOVIE:512,VOD_SERIES:512,VOD_CATCHUP:511,LIVE:500},this.epgEvents=[],this.epgEventInterval=null,this.nextMedia={},this.initCommonStyle(),this.loadConfig()}loadConfig(){this.request.setConfig({url:this.baseUrl,key:this.config.apiKey}),this.initSkin(),this.initPlayer(),this.initControls(),this.config.debug&&this.initDebug(),this.start()}initCommonStyle(){const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href="/receiver/css/player.css",this.castMediaPlayer.shadowRoot.appendChild(e),this.utils.isLocalWeb()&&this.castMediaPlayer.shadowRoot.querySelector("#castPlayer").classList.add("localWeb")}initDebug(){console.log("DEBUG MODE = ",this.config.debug),this.context.addEventListener(this.framework.system.EventType.READY,()=>{this.castDebugLogger.debugOverlayElement_||(this.castDebugLogger.setEnabled(!0),this.castDebugLogger.showDebugLogs(!0))}),this.castDebugLogger.loggerLevelByEvents={"cast.framework.events.category.CORE":this.framework.LoggerLevel.INFO,"cast.framework.events.EventType.MEDIA_STATUS":this.framework.LoggerLevel.DEBUG},this.castDebugLogger.loggerLevelByTags||(this.castDebugLogger.loggerLevelByTags={}),this.castDebugLogger.loggerLevelByTags[g]=this.framework.LoggerLevel.DEBUG}initSkin(){setTimeout(()=>{this.initSplash(),this.initOverlay(),setTimeout(()=>{this.castMediaPlayer.style.visibility="visible"},1)},250)}initSplash(){var t;const e=this.castMediaPlayer.shadowRoot.querySelector(".splash");if(e){const s=document.createElement("div");s.setAttribute("class","logo"),e.appendChild(s);const a=document.createElement("div");a.setAttribute("class","readyToCast");const i=document.createElement("div");i.setAttribute("class","chromecastActivated"),a.appendChild(i);const r=document.createElement("span");r.setAttribute("class","label"),r.innerText=(t=this.translations)==null?void 0:t.PLAYER_LABEL_READY_TO_CAST,a.appendChild(r),e.a
1ppendChild(a)}}initOverlay(){const e=this.castMediaPlayer.shadowRoot.querySelector(".overlay");if(e){const i=document.createElement("div");i.setAttribute("id","customMetadata"),i.setAttribute("class","customMetadata");const r=document.createElement("img");r.setAttribute("class","channelLogo"),r.setAttribute("id","channelLogo"),i.appendChild(r),i.appendChild(this.generateAssetNode("currentlyPlaying"));const n=document.createElement("div");n.setAttribute("id","synopsis"),n.setAttribute("class","synopsis"),i.appendChild(n),i.appendChild(this.generateAssetNode("nextPlaying"));const o=document.createElement("span");o.setAttribute("id","channelName"),o.setAttribute("class","channelName"),i.appendChild(o),e.appendChild(i)}const t=this.castMediaPlayer.shadowRoot.querySelector(".controlsTimelineLabels"),s=document.createElement("span");s.innerText="/";const a=this.castMediaPlayer.shadowRoot.querySelector("#castControlsTotalTime");t&&t.insertBefore(s,a),this.utils.isLocalWeb()&&this.manageOverlayDisplay()}initPlayer(){this.castReceiverOptions.maxInactivity=this.config.maxInactivity,this.playerManager.addEventListener(this.framework.events.category.CORE,this.onEvent.bind(this)),this.playerManager.addEventListener(this.framework.events.EventType.ERROR,t=>{this.config.debug&&(this.castDebugLogger.error(g,"Detailed Error Code - "+t.detailedErrorCode),t&&t.detailedErrorCode===905&&this.castDebugLogger.error(g,"LOAD_FAILED: Verify the load request is set up properly and the media is able to play."))}),this.playerManager.setMessageInterceptor(this.framework.messages.MessageType.LOAD,t=>this.onLoad(t));const e=document.createElement("span");e.setAttribute("id","message"),e.setAttribute("class","message"),this.castMediaPlayer.shadowRoot.querySelector("#castPlayer").appendChild(e)}initControls(){this.controls.clearDefaultSlotAssignments(),this.controls.assignButton(this.framework.ui.ControlsSlot.SLOT_1,this.framework.ui.ControlsButton.QUEUE_PREV),this.controls.assignButton(this.framework.ui.ControlsSlot.SLOT_2,this.framework.ui.ControlsButton.CAPTIONS),this.controls.assignButton(this.framework.ui.ControlsSlot.SLOT_3,this.framework.ui.ControlsButton.SEEK_FORWARD_15),this.controls.assignButton(this.framework.ui.ControlsSlot.SLOT_4,this.framework.ui.ControlsButton.QUEUE_NEXT)}initPlaybackConfig(e){const t=(e==null?void 0:e.vendor)||this.config.drmProvider;this.playbackConfig.autoResumeDuration=5,this.playbackConfig.licenseUrl=e.licenseUrl,this.playbackConfig.protectionSystem=this.config.drmProtection==="widevine"?this.framework.ContentProtection.WIDEVINE:this.config.drmProtection,this.playbackConfig.licenseRequestHandler=s=>(t==="castlabs"?(s.withCredentials=!1,s.headers["x-dt-auth-token"]=e.bearer):t==="vualto"?s.headers["X-VUDRM-TOKEN"]=decodeURIComponent(e.bearer):(s.withCredentials=!0,s.headers.authorization="Bearer "+e.bearer),s),this.playbackConfig.licenseHandler=s=>{if(t==="castlabs"){this.castDebugLogger.debug(g,`licenseHandler: ${JSON.stringify(s)}`);try{const a=JSON.parse(new TextDecoder().decode(s));return a.data=shaka.util.Uint8ArrayUtils.fromBase64(a.license),a.data}catch{return null}}else return s}}start(){this.castReceiverOptions.playbackConfig=this.playbackConfig,this.config.debug&&this.castDebugLogger.info(g,`autoResumeDuration set to: ${this.playbackConfig.autoResumeDuration}`),this.castReceiverOptions.supportedCommands=this.framework.messages.Command.ALL_BASIC_MEDIA|this.framework.messages.Command.QUEUE_PREV|this.framework.messages.Command.QUEUE_NEXT|this.framework.messages.Command.STREAM_TRANSFER,this.context.start(this.castReceiverOptions)}onLoad(e){var i,r,n,o,c,l;const t=(l=(c=(o=(n=(r=(i=this.castMediaPlayer)==null?void 0:i.shadowRoot)==null?void 0:r.querySelector)==null?void 0:n.call(r,".player tv-overlay"))==null?void 0:o.shadowRoot)==null?void 0:c.querySelector)==null?void 0:l.call(c,".tv-overlay .watermark");t&&(t.style.display="none"),this.config.debug&&this.castDebugLogger.debug(g,`loadRequestData: ${JSON.stringify(e)}`);const s=new this.framework.messages.ErrorData(this.framework.messages.ErrorType.LOAD_FAILED);if(!e||!e.media)return s.reason=this.framework.messages.ErrorReason.INVALID_REQUEST,error;const a=e.customData||e.media.customData;
1if(a&&(a!=null&&a.authToken)){if(this.request.setTokens(a),a.media){if(this.nextMedia={},this.manageOverlayDisplay(),this.config.displayWatermark&&!this.castMediaPlayer.shadowRoot.querySelector("#watermark")){const d=document.createElement("span");d.style="position: absolute; transform: rotate(-90deg) translateX(-50%) translateY(0%); transform-origin: top left; top: 50%; left: 0; color: var(--watermark-color); font-size: var(--watermark-size);",d.setAttribute("id","watermark"),d.setAttribute("class","watermark"),d.textContent=a.watermark,this.castMediaPlayer.shadowRoot.querySelector("#castPlayer .foreground").appendChild(d)}switch(e.media.hlsSegmentFormat=this.framework.messages.HlsSegmentFormat.TS,this.media.streamType){case"VOD_MOVIE":case"VOD_CATCHUP":case"VOD_SERIES":return this.startVodFlow(e,s);case"LIVE":return this.startChannelFlow(e,s)}}}else return s.reason=this.framework.messages.ErrorReason.INVALID_REQUEST,s}startVodFlow(e,t){const s={idAsset:this.media.id,idAudioLang:this.media.idAudioLang,idSubtitleLang:this.media.idSubtitleLang};return this.request.post("readAsset",s).then(async a=>{var i;if(console.info(`[DUX Receiver] readAsset result: ${JSON.stringify(a)}`),a.status){e.media.contentUrl=a.result.url;const r=await fetch(a.result.url);return e.media.contentUrl=r.redirected?r.url:a.result.url,(i=a.result.url)!=null&&i.includes(".m3u8")?(this.castReceiverOptions.useShakaForHls=!0,e.media.contentType="application/x-mpegurl"):this.castReceiverOptions.useShakaForHls=!1,s.asUrl=!0,this.request.post("getVodLicense",s).then(n=>(console.info(`[DUX Receiver] getVodLicense result: ${JSON.stringify(n)}`),n.status?(this.onGetVodLicenseSuccess(n,e),e):(this.showMessage(n.error,"error",!0),t))).catch(n=>(console.log(n),t))}else return this.showMessage(a.error,"error",!0),t}).catch(a=>(console.log(a),t))}startChannelFlow(e,t){var i,r;const s={idChannel:this.media.id},a=(e==null?void 0:e.customData)||((i=e==null?void 0:e.media)==null?void 0:i.customData);return this.epgEvents=(r=a==null?void 0:a.media)!=null&&r.epgEvents?a.media.epgEvents:[],this.launchEpgEventInterval(),this.request.post("channelStream",s).then(async n=>{var o;if(console.info(`[DUX Receiver] channelStream result: ${JSON.stringify(n)}`),n.status){const c=await fetch(n.result.url);return e.media.contentUrl=c.redirected?c.url:n.result.url,(o=n.result.url)!=null&&o.includes(".m3u8")?(this.castReceiverOptions.useShakaForHls=!0,e.media.contentType="application/x-mpegurl"):this.castReceiverOptions.useShakaForHls=!1,s.asUrl=!0,this.request.post("askLicenseWV",s).then(l=>{var d;return console.info(`[DUX Receiver] askLicenseWV result: ${JSON.stringify(l)}`),l.status?(this.onAskLicenseWVSuccess(l,e),e):((d=l==null?void 0:l.error)==null?void 0:d.code)===-2370?e:(this.showMessage(l.error,"error",!0),t)}).catch(l=>(console.log(l),t))}else return this.showMessage(n.error,"error",!0),t}).catch(n=>(console.log(n),t))}onEvent(e){var i,r,n;e.sendEvent=!0;const t=[],s=Object.assign({},e);switch(s.type="SEEKING",e.type){case"REQUEST_EDIT_TRACKS_INFO":this.manageTracks(e.requestData),t.push(e);break;case"REQUEST_LOAD":{this.hideMessage();const o=((i=e==null?void 0:e.requestData)==null?void 0:i.customData)||((n=(r=e==null?void 0:e.requestData)==null?void 0:r.media)==null?void 0:n.customData);o?(o.authToken&&this.request.setTokens(o),this.media=o.media,this.firstPlayingDone=!1,t.push(e)):this.media={}}break;case"SEEKING":if(this.firstPlayingDone){const o=this.castMediaPlayer.shadowRoot.querySelector("#castControlsProgress");o&&(o.classList.add("highlighted"),this.clearHighlightedTimeout(),this.highlightedTimeout=setTimeout(()=>{o.classList.remove("highlighted")},2500)),t.push(e)}break;case"PAUSE":e.ended?e.sendEvent=!1:(this.paused=!0,this.clearPositionMsgInterval(),t.push(e));break;case"PLAYING":if(this.paused?e.type="RESUME":(this.media.streamType!=="LIVE"&&this.firstPlayingDone&&(e.sendEvent=!1),this.previousMedia=Object.assign({},this.media)),this.firstPlayingDone===!1){const o=[];this.media.preferredSubtitleLang&&o.push(this.media.preferredSubtitleLang),this.media.preferredAudioLang&&o.push(this.media.preferredAudioLang),this.manageTracks({activeTrackIds:o})}this.firstPlayingDone=!0,this.paused=!1,this.clearPositionMsgInterval(),this.positionMsgInterval=y(()=>{this.msg({type:"SEEKING",currentMediaTime:this.playerManager.getCurrentTimeSec()},this.media)},3e4),t.push(e);break;case"MEDIA_FINISHED":e.endedReason&&e.endedReason!=="END_OF_STREAM"&&(s.sendEvent=!1,e.sendEvent=!1),this.clearPositionMsgInterval(),t.push(s),t.push(e);break;case"REQUEST_STOP":this.clearPositionMsgInterval(),t.push(e);break;case"ERROR":this.showMessage({code:e.detailedErrorCode},"error"),this.clearPositionMsgInterval(),t.push(e),this.castMediaPlayer.shadowRoot.querySelector("#watermark").style.display="none";break;default:t.push(e);break}const a=e.type==="MEDIA_FINISHED"?this.previousMedia:this.media;t.forEach(o=>{o.sendEvent&&this.eventCodeEnum[o.type]&&this.eventCodeEnum[o.type][this.media.streamType]&&this.msg(o,a),console.log(o)})}manageOverlayDisplay(){const e=this.castMediaPlayer.shadowRoot.querySelector(".overlay");e&&(this.utils.isLocalWeb()&&this.generateMockedMetadata(),e.setAttribute("class","overlay"),e.classList.add(this.media.streamType),this.generateMetadata(),this.clearEpgEventInterval())}generateAssetNode(e){const t=document.createElement("div");t.setAttribute("id",e),t.setAttribute("class","asset");const s=document.createElement("img");s.setAttribute("class","assetImage"),s.setAttribute("id",e+"Image"),s.onerror=()=>{s.src="res/images/default_image.png"};const a=document.createElement("div");a.setAttribute("class","assetMetadata");const i=document.createElement("span");i.setAttribute("class","playingInfo"),i.setAttribute("id",e+"PlayingInfo");const r=document.createElement("span");r.setAttribute("class","startEndTime"),r.setAttribute("id",e+"StartEndTime");const n=document.createElement("span");n.setAttribute("class","title"),n.setAttribute("id",e+"Title");const o=document.createElement("span");o.setAttribute("class","subtitle"),o.setAttribute("id",e+"Subtitle");const c=document.createElement("span");return c.setAttribute("class","additionalInfo"),c.setAttribute("id",e+"AdditionalInfo"),a.appendChild(i),a.appendChild(r),a.appendChild(n),a.appendChild(o),a.appendChild(c),t.appendChild(s),t.appendChild(a),t}generateAssetNodeMetadata(e,t,s){var n,o;const a=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"PlayingInfo");a&&(a.innerText=s);const i=(n=this.translations)==null?void 0:n.PLAYER_LABEL_NO_INFORMATION_AVAILABLE;if(t.metadata){if(t.streamType==="LIVE"){const h=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"StartEndTime");if(h){const u=parseInt(t.metadata.startutc)*1e3,p=parseInt(t.metadata.endutc)*1e3;if(u&&p){let E=new f(u).formatHoursMinutesLoc()+" - "+new f(p).formatHoursMinutesLoc();t.metadata.duration&&(E+=" ("+this.utils.formatDurationHoursMinutes(t.metadata.duration)+")"),h.innerText=E}else h.innerText=i}}const c=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"Title");c&&this.utils.ellipsizeText(c,t.metadata.title?t.metadata.title:i);const l=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"Subtitle");l&&(t.metadata.subtitle?t.streamType==="VOD_SERIES"?this.utils.ellipsizeText(l,"S"+t.metadata.season+" EP"+t.metadata.episode+" : "+t.metadata.subtitle):this.utils.ellipsizeText(l,t.metadata.subtitle):l.innerText="");const d=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"AdditionalInfo");if(d){const h=t.metadata.duration?this.utils.formatDurationHoursMinutes(t.metadata.duration):(o=this.translations)==null?void 0:o.PLAYER_LABEL_NA,u=t.metadata.moralityLevel&&parseInt(t.metadata.moralityLevel)!==0?t.metadata.moralityLevel+"+":"";d.innerText=h+(u?" I "+u:"")}}const r=this.castMediaPlayer.shadowRoot.querySelector("#"+e+"Image");if(r){const c=t.streamType==="LIVE"?t.metadata.AD_IMAGEID?t.metadata.AD_IMAGEID:"":t.id;c?(r.src=this.baseUrl+"/proxy/imgdata?type="+this.imageTypeEnum[t.streamType]+"&objectId="+c+"&format_w=250&format_h=140&languageId=eng",r.style.display="block"):(r.src="",r.style.display="none")}}generateMetadata(){var e,t,s,a;switch(this.manageNextPlayingDisplay(!1),this.media.streamType){case"VOD_MOVIE":case"VOD_CATCHUP":{this.generateAssetNodeMetadata("currentlyPlaying",this.media,(e=this.translations)==null?void 0:e.PLAYER_LABEL_CURRENTLY_PLAYING);const i=this.castMediaPlayer.shadowRoot.querySelector("#synopsis");i&&this.utils.ellipsizeText(i,this.media.metadata.description?this.media.metadata.description:"");break}case"VOD_SERIES":{this.generateAssetNodeMetadata("currentlyPlaying",this.media,(t=this.translations)==null?void 0:t.PLAYER_LABEL_CURRENTLY_PLAYING);const i=this.queue.items&&this.queue.items.length?this.queue.items[0]:null;i&&(this.manageNextPlayingDisplay(!0),this.generateAssetNodeMetadata("nextPlaying",i.media,(s=this.translations)==null?void 0:s.PLAYER_LABEL_NEXT_EPISODE));break}case"LIVE":{const i=this.castMediaPlayer.shadowRoot.querySelector("#channelName");
1i&&(i.innerText=this.media.metadata.localizeNumber+" I "+this.media.metadata.name);const r=this.castMediaPlayer.shadowRoot.querySelector("#channelLogo");r&&(r.src=this.baseUrl+"/proxy/imgdata?type=100&objectId="+this.media.id+"&format_w=80&format_h=80&languageId=eng"),this.generateAssetNodeMetadata("currentlyPlaying",this.media,(a=thisthis.translations)==null?void 0:a.PLAYER_LABEL_ON_NOW);break}}}manageNextPlayingDisplay(e){const t=this.castMediaPlayer.shadowRoot.querySelector("#nextPlaying");t&&(t.style.display=e?"flex":"none")}launchEpgEventInterval(){this.epgEvents.length&&(this.epgEvents.sort((e,t)=>e.startUtc<t.startUtc?-1:1),this.epgEvents.forEach(e=>{e.startUtc=e.startUtc*1e3,e.endUtc=e.endUtc*1e3}),this.getEpgEvents(),this.epgEventInterval=y(()=>{this.getEpgEvents()},6e4))}getEpgEvents(){const e=new f().time,t=this.epgEvents.find(s=>e>=s.startUtc&&e<=s.endUtc);t&&t.idEvent!==this.media.idEvent&&this.request.get("/cms/epg/event/eng/"+t.idEvent).then(s=>{if(s.result){let a=s.result.program;this.updateMedia(this.media,a);const i=this.epgEvents.find(r=>e<r.startUtc);i?this.request.get("/cms/epg/event/eng/"+i.idEvent).then(r=>{var n;this.generateMetadata(),r.result?(a=r.result.program,this.updateMedia(this.nextMedia,a),this.nextMedia&&Object.keys(this.nextMedia).length&&(this.manageNextPlayingDisplay(!0),this.generateAssetNodeMetadata("nextPlaying",this.nextMedia,(n=this.translations)==null?void 0:n.PLAYER_LABEL_NEXT))):this.nextMedia={}}).catch(r=>{this.nextMedia={},this.generateMetadata(),console.log(r)}):(this.nextMedia={},this.generateMetadata())}}).catch(s=>{console.log(s)})}updateMedia(e,t){const s=JSON.parse(t.directMetadata);e.id=this.media.id,e.idEvent=t.idEvent,e.idAudioLang=this.media.idAudioLang,e.idSubtitleLang=this.media.idSubtitleLang,e.metadata={title:t.title,moralityLevel:this.media.metadata.moralityLevel,duration:t.duration?t.duration/1e3/60:null,name:this.media.metadata.name,localizeNumber:this.media.metadata.localizeNumber,AD_IMAGEID:s.AD_IMAGEID,startutc:t.startUtc,endutc:t.endUtc},e.streamType=this.media.streamType}generateMockedMetadata(){if(this.media.streamType="LIVE",this.media.id=9,this.media.idAudioLang="eng",this.media.idSubtitleLang="non",this.media.metadata={channelType:"OTT",title:"Big Buck Bunny",duration:125,moralityLevel:"12",description:"Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself.",name:"LAB Arte DASH",localizeNumber:"26",AD_IMAGEID:"8819942186113859572",startutc:"1600083300000",endutc:"1600090500000"},this.media.streamType!=="LIVE"){const e=this.castMediaPlayer.shadowRoot.querySelector("#castControlsCurTime");e&&(e.innerText="45:42");const t=this.castMediaPlayer.shadowRoot.querySelector("#castControlsTotalTime");t&&(t.innerText="109:56")}}showMessage(e,t,s){var a;if(e&&!this.isProxyMessage){const i=this.castMediaPlayer.shadowRoot.querySelector("#message");if(i){let r="";switch(t){case"error":r=((a=this.translations)==null?void 0:a.PLAYER_LABEL_ERROR_OCCURRED)+e.code+")";break;case"success":r=e.message;break;case"warning":r=e.message;break}r&&(this.isProxyMessage=!!s,i.innerText=r,i.setAttribute("class","message visible "+t),setTimeout(()=>{this.hideMessage()},1e4))}}}hideMessage(){const e=this.castMediaPlayer.shadowRoot.querySelector("#message");e&&e.classList.remove("visible"),this.isProxyMessage=!1}manageTracks(e){var t,s,a;if(e.activeTrackIds){const i=this.playerManager.getAudioTracksManager(),r=this.playerManager.getTextTracksManager();if(e.activeTrackIds.length){e.activeTrackIds.length===1&&e.activeTrackIds.unshift("none");const n=r.getTracks();typeof e.activeTrackIds[0]=="string"&&e.activeTrackIds[0]!=="none"&&(e.activeTrackIds[0]=(t=n.find(h=>h.language===e.activeTrackIds[0]))==null?void 0:t.trackId);const o=e.activeTrackIds[0];o&&o!=="none"?n.find(u=>u.trackId===o)&&r.setActiveByIds([o]):r.setActiveByIds([]);const c=i.getTracks();typeof e.activeTrackIds[1]=="string"&&(e.activeTrackIds[1]=(s=c.find(h=>h.language===e.activeTrackIds[1]))==null?void 0:s.trackId);const l=i.getActiveId(),d=e.activeTrackIds[1];d&&d!==l&&c.find(u=>u.trackId===d)&&i.setActiveById(d)}else{if(i.getTracks()){const n=(a=i.getTracks()[0])==null?void 0:a.trackId;i.setActiveById(n)}r.setActiveByIds([])}}}clearHighlightedTimeout(){this.highlightedTimeout&&(clearTimeout(this.highlightedTimeout),this.highlightedTimeout=null)}clearPositionMsgInterval(){this.positionMsgInterval&&(clearInterval(this.positionMsgInterval),this.positionMsgInterval=null)}clearEpgEventInterval(){this.epgEventInterval&&(clearInterval(this.epgEventInterval),this.epgEventInterval=null),this.nextMedia={}}onGetVodLicenseSuccess(e,t){var s;e.result.url&&this.initPlaybackConfig({licenseUrl:e.result.url,bearer:e.result.licParam.sessionToken||e.result.licParam.token,vendor:(s=e.result.vend
1or)==null?void 0:s.toLowerCase()})}onAskLicenseWVSuccess(e,t){var s;e.result.url&&this.initPlaybackConfig({licenseUrl:e.result.url,bearer:e.result.licParam.sessionToken||e.result.licParam.token,vendor:(s=e.result.vendor)==null?void 0:s.toLowerCase()})}msg(e,t){const s={level:"INFO",code:this.eventCodeEnum[e.type][t.streamType],classification:"",applicationId:"CHROMECAST-RECEIVER",context:{}};switch(t.streamType){case"VOD_MOVIE":case"VOD_SERIES":case"VOD_CATCHUP":switch(s.classification="VOD+CATCHUP",s.context.assetId=t.id,e.type){case"REQUEST_LOAD":s.context.from=4;break;case"SEEKING":case"PAUSE":case"RESUME":case"REQUEST_STOP":s.context.position=e.currentMediaTime,s.context.unit="seconds";break;case"ERROR":s.level="ERROR",s.context.reason={httpCode:null,playerCode:e.detailedErrorCode,message:null,containerFormatNotSupported:!1,videoCodecNotSupported:!1,audioCodecNotSupported:!1,casRelated:!1,drmRelated:!1};break}break;case"LIVE":switch(s.classification="LINEAR",s.context.channelId=t.id,e.type){case"REQUEST_LOAD":s.context.throughNanoCdn=null,s.context.frequency=null;break;case"PLAYING":s.context.audioLanguage=t.idAudioLang,s.context.subtitleLanguage=t.i
1dSubtitleLang,s.context.audioCodec=null,s.context.videoCodec=null,s.context.technology="dash";break;case"SEEKING":s.context.livePosition=new f().time,s.context.bufferStartPosition=null,s.context.playbackPosition=null;break;case"PAUSE":case"RESUME":case"REQUEST_STOP":s.context.position=e.currentMediaTime;break;case"ERROR":s.level="ERROR",s.context.reason={httpCode:null,playerCode:e.detailedErrorCode,message:null,containerFormatNotSupported:!1,videoCodecNotSupported:!1,audioCodecNotSupported:!1,casRelated:!1,drmRelated:!1};break}break}this.request.post("msg",s).catch(a=>{console.log(a)})}}export{b as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.