PageSourceSearch

https://www.rtlplusz.hu/player-thirdparty-heartbeat-v2-engine-ed2ec8b87eeed344.bundle.js

js rtlplusz.hu collected 2026-10-02 14:35:07 UTC 10,955 bytes, 2 lines download raw bytes

1(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[5839],{44196(e,t,i){var s=i(44681),n=i(16298);e.exports=function(e,t){return e&&s(e,n(t))}},99302(e,t,i){"use strict";i.d(t,{S:()=>c});var s=i(64756),n=i(20941),r=i(34434),o=i(15494),a=i(29644),h=i(52043);const l=e=>e&&e.UID?{uid:e.UID,uidType:"gigya"}:{uid:s.R.get("localDeviceId"),uidType:"deviceid"},u=(0,h.n)("heartbeat");class d extends a.V{apiType="heartbeatv2";init(){this.isInitialized||(this.isInitialized=!0,this.basePath=`platforms/${s.R.get("platformCode")}/notify`,this.platformCode=s.R.get("platformCode"),this.monitoring=u)}createSession({sessionData:e=null,user:t=null,headers:i={}}={}){if(!e||!e.clipType)throw new Error("You should provide a non null sessionData");const s=(e=>{try{return["live","startover"].includes(e)}catch{throw new Error("Something is wrong with the clipType")}})(e.clipType),n="session"+(s?"_live":""),r=this.getRouteUrl(n),o={platformCode:this.platformCode,...l(t),...e};return this.fetch(r,{method:"POST",body:o,headers:i}).then(({sessionId:e})=>({sessionId:e,sendView:this.sendView({user:t,isLive:s,sessionId:e})}))}sendView({user:e=null,isLive:t=!1,sessionId:i=null}={}){if("boolean"!=typeof t||!i)throw new Error("Something went wrong during the session creation");return async(r,a=!1)=>{if(!r)throw new Error("You should provide a non null viewData");const h="view"+(t?"_live":""),u=this.getRouteUrl(h),c={platformCode:this.platformCode,...l(e),...r,sessionId:i},p=await o.L.getToken(),m={Authorization:`Bearer ${p}`};if(a){if(navigator.sendBeacon&&window.FormData&&"function"==typeof window.URL){const e=new URL(u);e.searchParams.append("authorization",p),e.searchParams.append("customerName",s.R.get("customerCode")),e.searchParams.append("clientRelease",s.R.get("appVersion"));const t=new FormData;return Object.keys(c).forEach(e=>t.append(e,c[e])),navigator.sendBeacon(e.href,t)}return(0,n.G)(u,c,m)}return this.monitoring(d.prototype,"sendView",{value:()=>this.fetch(u,{method:"POST",body:c,headers:m})}).value()}}}!function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,i,o):n(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([r.q,u],d.prototype,"createSession",null);const c=new d},20941(e,t,i){"use strict";var s=i(44196),n=i.n(s);i.d(t,["G",0,(e,t,i)=>{const s=new XMLHttpRequest;return s.open("POST",e,!1),s.setRequestHeader("Content-Type","application/json"),n()(i,(e,t)=>{s.setRequestHeader(t,e)}),s.send(JSON.stringify(t))}])},82935(e,t,i){"use strict";i.d(t,{A:()=>n});var s=i(15645);class n{constructor(){this.name="default-engine"}init(e,t,i,s){this.onError({reason:"Engine init method should be implemented."})}track(e,t){const i=`on${(0,s.qF)(e)}`;(0,s.fp)(this[i])&&this[i](t)}release(){this.layoutData=null,this.options=null}onError(e,t){const{reason:i}=t||{};console.error("ThirdParty DefaultEngine Error:",e,i)}isActive(){return!1}}},67638(e,t,i){"use strict";i.d(t,{default:()=>p});var s=i(99302),n=i(31523),r=i(31530),o=i(82935),a=i(8704),h=i(15508);const l="NOT_SEEKING",u="SEEKING",d="WAIT_FOR_PLAY";class c extends o.A{constructor(){super(...arguments),this.name=h.g.HEARTBEATV2,this.currentTime=null,this.speed=null,this.polling=null,this.sessionId=null,this.seekingState=l,this.firstHitTimestamp=null,this.lastSequenceTimeCode=null,this.sendView=async()=>({}),this.sequenceNumber=-1,this.metrics={},this.timecodeListener=null,this.sessionIdListener=null,this.updateSessionClipType=async e=>{const t="live"===this.layoutData.session.clipType?"startover":"live",i={...this.layoutData.session,clipType:t},s={...this.options,startTime:e};await this.reInit({...this.layoutData,session:i},s,{onTimeCodeChange:this.timecodeListener,onSessionIdChange:this.sessionIdListener})}
1,this.getSafeTimeCode=e=>this.isLive()?this.firstHitTimestamp?Math.round(Math.max(e-this.firstHitTimestamp,0)):(this.firstHitTimestamp=e,this.lastSequenceTimeCode=e,0):Math.round(Math.min(Math.max(e,0),this.layoutData.session.clipDuration??0)),this.saveTimeCode=async(e,t=!1)=>{if(!this.isActive())return void this.polling?.stop();const i=this.currentTime??0,s=this.getSafeTimeCode(i),n=this.lastSequenceTimeCode??0;let o=e;void 0===o&&(o=this.isLive()?Math.max(0,Math.round(i-n)):Math.max(0,Math.round(s-n))),o>this.layoutData.polling*(this.speed??1)&&(o=0),this.sequenceNumber++;try{const e={tc:s,tcRelative:o,sequenceNumber:this.sequenceNumber,...this.metrics};if(this.isLive()){const t=this.getTimecode();e.timestamp=t,this.lastSequenceTimeCode=t}else this.lastSequenceTimeCode=s;const i={...this.layoutData.view,...e},n=await this.sendView(i,t);this.onSendViewSuccess(s,n),this.polling?.update(1e3*this.layoutData.polling)}catch(e){if(!function(e){return"object"==typeof e&&null!==e&&"status"in e&&"number"==typeof e.status}(e))return void r.U.options.logger.warn("thirdPartyPlayerService","Heartbeatv2","saveTimeCode",e);[403,498,429,423].includes(e.status)&&(this.setCurrentSessionId(null),this.polling?.stop()),r.U.options.logger.warn("thirdPartyPlayerService","Heartbeatv2","saveTimeCode",e.message)}},this.shouldUpdateClipType=e=>{const t=(new Date).getTime()/1e3;return this.layoutData.session.clipType!==(e>t-50?"live":"startover")},this.createCslError=e=>{let t=n.eo.HV;switch(e.error_code){case"NUMBER_OF_ALLOWED_CONCURRENT_STREAMS_EXCEEDED":t=n.eo.Sb;break;case"USER_HAS_NO_CSL_ACCESS":t=n.eo.MP}return new n.Mk(n.LY.iS,t,!0,"CSL",e.message??"",JSON.stringify(e))},this.onSendViewSuccess=(e,t)=>{!this.isLive()&&this.layoutData.session.clipId&&this.timecodeListener?.(this.layoutData.session.clipId,e);const i=t?.view_information?.csl??{allowed:!0};i.allowed||r.U.onError(this.createCslError(i),{type:n.LY.iS,details:n.eo.Sb,fatal:!0,context:"CSL",reason:n.eo.Sb,content:i.message,name:this.name})}}setCurrentSessionId(e){this.sessionId=e,this.sessionIdListener?.(this.sessionId)}async init(e,t,i){try{this.layoutData=e,this.options=t,this.initListeners(i),this.polling=new a.A(1e3*e.polling,this.saveTimeCode);const n=this.options?.startTime??0;this.currentTime=n,this.seekingState=n&&!this.isLive()?u:l,this.firstHitTimestamp=n,this.lastSequenceTimeCode=n,this.sequenceNumber=-1,this.metrics={},window.__MOCK__&&Object.defineProperty(window,"heartbeatInstance",{value:this});const{sessionId:r,sendView:o}=await s.S.createSession({sessionData:e.session,user:{UID:t.userId}});this.sendView=o,this.setCurrentSessionId(r),e.session.clipId&&this.timecodeListener?.(e.session.clipId,n)}catch(e){this.polling?.stop(),this.setCurrentSessionId(null),this.removeListeners();const t=e instanceof Error?e.message:"Heartbeat v2 service failed to init.";r.U.options.logger.warn("thirdPartyPlayerService","Heartbeatv2","init",t)}}isActive(){return!!this.sessionId}isLive(){return!!this.layoutData?.session?.clipType&&["live","startover"].includes(this.layoutData.session.clipType)}initListeners(e){e&&(e.onTimeCodeChange&&(this.timecodeListener=e.onTimeCodeChange),e.onSessionIdChange&&(this.sessionIdListener=e.onSessionIdChange))}removeListeners(){this.timecodeListener=null,this.sessionIdListener=null}hasSentFirstPlayEvent(){return this.sequenceNumber>-1}isSeeking(){return this.seekingState===d||this.seekingState===u}async onPlaying(e){this.seekingState!==d&&this.seekingState!==u?(this.setCurrentTime(e.currentTime),this.setMetrics(e.metrics),this.isLive()&&this.shouldUpdateClipType(e.currentTime)?await this.updateSessionClipType(e.currentTime):this.polling?.trigger()):this.seekingState=l}onTimeUpdate(e){if(this.seekingState===u)return;this.seekingState=l;const t=this.metrics;if(this.setCurrentTime(e.currentTime),this.setMetrics(e.metrics),this.setSpeed(e.speed),!this.polling?.isStarted())return this.polling?.start(),void this.polling?.trigger();t.bitrate!==this.metrics.bitrate&&this.polling?.trigger()}onSeeking(){this.seekingState===l&&this.polling?.trigger(),this.seekingState=u}onPause(){this.seekingState===u||this.layoutData.session.clipDuration&&(this.currentTime??0)===Math.round(this.layoutData.session.clipDuration)||this.polling?.trigger()}async onSeeked(e){this.seekingState=d,this.isLive()&&this.shouldUpdateClipType(e.currentTime)?await this.updateSessionClipType(e.currentTime):(this.setCurrentTime(e.currentTime),this.setMetrics(e.metrics),this.polling?.trigger(0))}onEnded(){this.release()}getTimecode(){return this.isLive()?Math.round(Math.max(this.options?.progress?.startTimestamp??0,Math.min(this.currentTime??0,this.options?.progress?.endTimestamp??Number.MAX_SAFE_INTEGER))):Math.round(this.currentTime??0)}setCurrentTime(e){this.currentTime=e}setSpeed(e){this.speed=e}setMetrics(e){if(!e)return;this.metrics={};const t=e=>"number"==typeof e&&e>=0,i=e;t(i.bitrate)&&(this.metrics.bitrate=i.bitrate),t(i.bufferLength)&&(this.metrics.bufferSize=Math.round(i.bufferLength)),t(i.networkBandwidth)&&(this.metrics.bandwidth=Math.min(Math.round(i.networkBandwidth),Number.MAX_SAFE_INTEGER)),t(i.droppedFrames)&&(this.metrics.droppedFrames=i.droppedFrames),t(i.videoHeight)&&(this.metrics.resolution=i.videoHeight)}async reInit(e,t,i){this.setCurrentSessionId(null),this.removeListeners(),this.sequenceNumber=-1,this.firstHitTimestamp=null,this.currentTime=null,this.polling=null,this.metrics={},await this.init(e,t,i)}async onUpdatePlayerConfig(e){if(!this.isLive())return;if(!this.options)return;const{analytics:t,startTimestamp:i,endTimestamp:s,currentTime:n}=e,r=t?.["heartbeat-v2"];if(!r)return;let o=this.layoutData.session.clipType;this.shouldUpdateClipType(n)&&(o="live"===this.layoutData.session.clipType?"startover":"live");const a={...r,session:{...r.session,clipType:o}},h={...this.options,progress:{startTimestamp:i??0,endTimestamp:s??Number.MAX_SAFE_INTEGER},startTime:n};await this.reInit(a,h,{onTimeCodeChange:this.timecodeListener,onSessionIdChange:this.sessionIdListener})}release(){this.polling&&(this.isActive()&&this.hasSentFirstPlayEvent()&&this.polling.trigger(void 0,!0),this.polling.stop()),this.polling=null,this.setCurrentSessionId(null),this.removeListeners(),this.sequenceNumber=-1,this.firstHitTimestamp=null,this.currentTime=null,this.metrics={},this.options=null}}const p=new c},8704(e,t,i){"use strict";i.d(t,{A:()=>n});var s=i(79513);class n{constructor(e,t){this.interval=e,this.handler=t,this.intervalId=null}isStarted(){return!!this.intervalId}start(){this.isStarted()&&this.stop(),this.intervalId=setInterval(this.handler,this.interval)}trigger(...e){if(this.isStarted()){this.stop();try{this.handler(...e)}catch(e){s.A.warn("Polling","Error when triggering handler",e)}this.start()}}stop(){clearInterval(this.intervalId),this.intervalId=null}update(e){this.interval!==e&&(this.interval=e,clearInterval(this.intervalId),this.intervalId=setInterval(this.handler,this.interval))}}}}]);
2//# sourceMappingURL=sourcemaps/player-thirdparty-heartbeat-v2-engine-ed2ec8b87eeed344.bundle.js.map

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.