mediamelon-js-react-native-sdk 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MMReactNativeVideoSDK=exports.MMPlayerState=exports.MMCustomAdapter=void 0;var _payloadKeyMap,_react=_interopRequireWildcard(require("react")),_excluded=["source","mmOptions"];function _interopRequireWildcard(t,e){if("function"==typeof WeakMap)var i=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(t,e){if(!e&&t&&t.__esModule)return t;var n,a,o={__proto__:null,default:t};if(null===t||"object"!=_typeof2(t)&&"function"!=typeof t)return o;if(n=e?r:i){if(n.has(t))return n.get(t);n.set(t,o)}for(var s in t)"default"!==s&&{}.hasOwnProperty.call(t,s)&&((a=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,s))&&(a.get||a.set)?n(o,s,a):o[s]=t[s]);return o})(t,e)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},_extends.apply(null,arguments)}function _objectWithoutProperties(t,e){if(null==t)return{};var i,r,n=_objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)i=a[r],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_toPropertyKey(r.key),r)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _typeof2(t){return _typeof2="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},_typeof2(t)}function _defineProperty2(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==_typeof2(e)?e:e+""}function _toPrimitive(t,e){if("object"!=_typeof2(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=_typeof2(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var MMChunkInformation=function(t,e,i,r,n,a,o,s){var d={};return d.trackIdx=void 0===t?-1:t,d.trackIdx=void 0===t?-1:t,d.bitrate=void 0===e?-1:e,d.sequence=void 0===i?-1:i,d.startTime=void 0===n?-1:n,d.startByte=void 0===o?-1:o,d.endByte=void 0===s?-1:s,d.duration=void 0===a?-1:a,d.initStartByte=-1,d.initEndByte=-1,d.resourceURL=r||null,d},MMRepresentation=function(t,e,i,r,n,a){var o={};return o.trackIdx=t||0,o.bitrate=e||0,o.width=i||0,o.height=r||0,o.codecIdentifier=n||{},o.segmentInfo=a||[],o},MMPresentationInfo=function(t,e,i,r){var n={};return 1===t&&(t=!0),n.isLive=t||!1,n.duration=e||-1,n.representationArray=i||[],n.contentType=r||"",n},MMAdState=Object.freeze({AD_BLOCKED:1,AD_IMPRESSION:2,AD_STARTED:3,AD_PLAYING:4,AD_CLICKED:5,AD_PAUSED:6,AD_RESUMED:7,AD_SKIPPED:8,AD_COMPLETED:9,AD_ERROR:10,AD_REQUEST:11,AD_PLAY:12,AD_BUFFERING:13,AD_MIDPOINT:14,AD_FIRST_QUARTILE:15,AD_THIRD_QUARTILE:16,AD_ENDED:17}),MMAdInfo=function(){var t={adClient:void 0,adId:void 0,adDuration:0,adPosition:void 0,adIsLinear:!1,adCreativeType:void 0,adServer:void 0,adResolution:void 0,adPodIndex:void 0,adPositionInPod:void 0,adPodLength:void 0,isBumper:!1,adScheduledTime:-1,adCreativeId:void 0,adUrl:void 0,adTitle:void 0,adBitrate:void 0};return t},MMPlayerState=exports.MMPlayerState=Object.freeze({PLAYING:1,PAUSED:2,STOPPED:3}),SeekState=Object.freeze({SeekStarted:1,SeekCompleted:2,Playing:3}),MMQBRMode=Object.freeze({QBRModeDisabled:"QBRDisabled",QBRModeQuality:"QBRQuality",QBRModeBitsave:"QBRBitsave",QBRModeCostsave:"QBRCostsave"}),MMConnectionInfo=Object.freeze({Cellular:"Cellular",Cellular_2G:"Cellular_2G",Cellular_3G:"Cellular_3G",Cellular_4G:"Cellular_4G",Cellular_LTE:"Cellular_LTE",Cellular_5G:"Cellular_5G",NotReachable:"WebNotReachable",Wifi:"Wifi",WiredNetwork:"WiredNetwork"}),payloadKeyMap=(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap={timestamp:"t",pbTime:"pt",playDur:"pd",interval:"i",version:"v",qubitData:"qd",streamID:"sd",custId:"ci",dataSrc:"dsr",playerName:"pn",sessionId:"si",domainName:"dn",streamURL:"su",playerVersion:"pv",pb:"pb",pm:"pm",experimentName:"exn",subPropertyId:"spi",viewSessionId:"vsi",basePlayerName:"bpn",basePlayerVersion:"bpv",subscriberId:"sbi",subscriberType:"sbt",subscriberTag:"sg",assetId:"ai",assetName:"an",videoId:"vi",mode:"m",isLive:"il",pId:"pi",sst:"sst",sourceType:"sct",parentCustId:"pci",streamMode:"sm",mediaType:"mt",sourceHostName:"shn",streamInfo:"sif",totalDuration:"td",maxRes:"xr",minRes:"nr",maxFps:"xf",minFps:"nf",numOfProfile:"np",streamFormat:"sf",videoTrack:"vk",subtitleTrack:"sk",audioTrack:"ak",isVDSActive:"iv",isSubtitleActive:"is",contentMetadata:"cm"},"assetId","ai"),"assetName","an"),"videoId","vi"),"contentType","ct"),"drmProtection","dp"),"episodeNumber","en"),"genre","g"),"season","se"),"seriesTitle","st"),"videoType","vt"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"segInfo","sgi"),"res","r"),"cbrBitrate","cb"),"vCodec","vc"),"aCodec","ac"),"downloadRate","dr"),"timestamp","t"),"qbrBitrate","qb"),"qbrQual","qq"),"cbrQual","cq"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"dur","du"),"fps","f"),"seqNum","sn"),"startTime","s"),"profileNum","pfn"),"lastTS","lts"),"cbrSize","cz"),"qbrSize","qz"),"cbrProfileNum","cp"),"bufferLength","bl"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"pbEventInfo","pe"),"event","e"),"desc","dsc"),"id","id"),"pbTime","pt"),"playbackStatus","ps"),"pbInfo","pif"),"timestamp","t"),"bwInUse","bu"),"pbTime","pt"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"progressMark","gm"),"latency","l"),"buffWait","bw"),"buffWaitType","bwt"),"sumBuffWait","sb"),"sumBuffWaitCIRR","sbc"),"sumBuffWaitVRT","sbv"),"sumBuffWaitAAD","sba"),"frameloss","fl"),"upShiftCount","us"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"downShiftCount","ds"),"pauseDuration","ud"),"sdkInfo","sdi"),"sdkVersion","sv"),"hFileVersion","hv"),"sdkType","skt"),"clientInfo","cif"),"appName","apn"),"appVersion","apv"),"deviceMarketingName","dm"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"scrnRes","sr"),"deviceId","di"),"deviceCapabilities","dc"),"cdn","c"),"operator","op"),"nwType","nt"),"wifissid","ws"),"wifidatarate","wd"),"signalstrength","ss"),"platform","p"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"location","l"),"device","d"),"brand","br"),"model","ml"),"videoQuality","vq"),"userAgent","ua"),"browserVersion","bv"),"browser","b"),"version","v"),"clientIP","cip"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"playerRes","pr"),"asn","asn"),"adInfo","aif"),"adId","id"),"adClient","cl"),"adCreative","c"),"adCreativeId","cid"),"adCreativeType","ct"),"adDuration","d"),"adInterval","i"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"adPosition","p"),"adLinear","al"),"adSystem","s"),"adPodIndex","pi"),"adPodPosition","pp"),"adPodLength","pl"),"adResolution","r"),"adBitrate","b"),"adTitle","t"),"adUrl","u"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"isBumper","ib"),"appEventInfo","aei"),"eventName","en"),"eventType","et"),"eventData","ed"),"currentScreen","cs"),"isGraceFul","ig"),"userInfo","ui"),"profileId","pid"),"userType","tp"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"userTag","tg"),"userData","d"),"referralId","rid"),"referralData","rd"),"diagnostics","di"),"customTags","ctg")),MMOverridableMetric=Object.freeze({Latency:"Latency",ServerAddress:"CDN",DurationWatched:"DurationWatched",streamURL:"streamURL"}),MMSTREAMSMARTERCONSTANTS={SDK_REGISTER_URL:"https://register.mediamelon.com/mm-apis/register/",SDK_CONFIG:{sdkVersion:"JSSDKv4.6.0_",hintFileVersion:"2.0.0",EP_SCHEMA_VERSION:"2.0.0",platform:"Browser",qmetric:!0,statistics:!1,log_level:2},SDK_BUILD_VERSION:"17032021"},MMMD5=function(t){var e=function(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i},i=function(t,i,r,n,a,o){return e((s=e(e(i,t),e(n,o)))<<(d=a)|s>>>32-d,r);var s,d},r=function(t,e,r,n,a,o,s){return i(e&r|~e&n,t,e,a,o,s)},n=function(t,e,r,n,a,o,s){return i(e&n|r&~n,t,e,a,o,s)},a=function(t,e,r,n,a,o,s){return i(e^r^n,t,e,a,o,s)},o=function(t,e,r,n,a,o,s){return i(r^(e|~n),t,e,a,o,s)},s=function(t){return function(t){var e,i="",r=32*t.length;for(e=0;e<r;e+=8)i+=String.fromCharCode(t[e>>5]>>>e%32&255);return i}(function(t,i){var s,d,u,h,_;t[i>>5]|=128<<i%32,t[14+(i+64>>>9<<4)]=i;var f=1732584193,p=-271733879,c=-1732584194,S=271733878;for(s=0;s<t.length;s+=16)d=f,u=p,h=c,_=S,f=r(f,p,c,S,t[s],7,-680876936),S=r(S,f,p,c,t[s+1],12,-389564586),c=r(c,S,f,p,t[s+2],17,606105819),p=r(p,c,S,f,t[s+3],22,-1044525330),f=r(f,p,c,S,t[s+4],7,-176418897),S=r(S,f,p,c,t[s+5],12,1200080426),c=r(c,S,f,p,t[s+6],17,-1473231341),p=r(p,c,S,f,t[s+7],22,-45705983),f=r(f,p,c,S,t[s+8],7,1770035416),S=r(S,f,p,c,t[s+9],12,-1958414417),c=r(c,S,f,p,t[s+10],17,-42063),p=r(p,c,S,f,t[s+11],22,-1990404162),f=r(f,p,c,S,t[s+12],7,1804603682),S=r(S,f,p,c,t[s+13],12,-40341101),c=r(c,S,f,p,t[s+14],17,-1502002290),p=r(p,c,S,f,t[s+15],22,1236535329),f=n(f,p,c,S,t[s+1],5,-165796510),S=n(S,f,p,c,t[s+6],9,-1069501632),c=n(c,S,f,p,t[s+11],14,643717713),p=n(p,c,S,f,t[s],20,-373897302),f=n(f,p,c,S,t[s+5],5,-701558691),S=n(S,f,p,c,t[s+10],9,38016083),c=n(c,S,f,p,t[s+15],14,-660478335),p=n(p,c,S,f,t[s+4],20,-405537848),f=n(f,p,c,S,t[s+9],5,568446438),S=n(S,f,p,c,t[s+14],9,-1019803690),c=n(c,S,f,p,t[s+3],14,-187363961),p=n(p,c,S,f,t[s+8],20,1163531501),f=n(f,p,c,S,t[s+13],5,-1444681467),S=n(S,f,p,c,t[s+2],9,-51403784),c=n(c,S,f,p,t[s+7],14,1735328473),p=n(p,c,S,f,t[s+12],20,-1926607734),f=a(f,p,c,S,t[s+5],4,-378558),S=a(S,f,p,c,t[s+8],11,-2022574463),c=a(c,S,f,p,t[s+11],16,1839030562),p=a(p,c,S,f,t[s+14],23,-35309556),f=a(f,p,c,S,t[s+1],4,-1530992060),S=a(S,f,p,c,t[s+4],11,1272893353),c=a(c,S,f,p,t[s+7],16,-155497632),p=a(p,c,S,f,t[s+10],23,-1094730640),f=a(f,p,c,S,t[s+13],4,681279174),S=a(S,f,p,c,t[s],11,-358537222),c=a(c,S,f,p,t[s+3],16,-722521979),p=a(p,c,S,f,t[s+6],23,76029189),f=a(f,p,c,S,t[s+9],4,-640364487),S=a(S,f,p,c,t[s+12],11,-421815835),c=a(c,S,f,p,t[s+15],16,530742520),p=a(p,c,S,f,t[s+2],23,-995338651),f=o(f,p,c,S,t[s],6,-198630844),S=o(S,f,p,c,t[s+7],10,1126891415),c=o(c,S,f,p,t[s+14],15,-1416354905),p=o(p,c,S,f,t[s+5],21,-57434055),f=o(f,p,c,S,t[s+12],6,1700485571),S=o(S,f,p,c,t[s+3],10,-1894986606),c=o(c,S,f,p,t[s+10],15,-1051523),p=o(p,c,S,f,t[s+1],21,-2054922799),f=o(f,p,c,S,t[s+8],6,1873313359),S=o(S,f,p,c,t[s+15],10,-30611744),c=o(c,S,f,p,t[s+6],15,-1560198380),p=o(p,c,S,f,t[s+13],21,1309151649),f=o(f,p,c,S,t[s+4],6,-145523070),S=o(S,f,p,c,t[s+11],10,-1120210379),c=o(c,S,f,p,t[s+2],15,718787259),p=o(p,c,S,f,t[s+9],21,-343485551),f=e(f,d),p=e(p,u),c=e(c,h),S=e(S,_);return[f,p,c,S]}(function(t){var e,i=[];for(i[(t.length>>2)-1]=void 0,e=0;e<i.length;e+=1)i[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)i[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return i}(t),8*t.length))},d=function(t){return s(unescape(encodeURIComponent(t)))},u=function(t){return function(t){var e,i,r="0123456789abcdef",n="";for(i=0;i<t.length;i+=1)e=t.charCodeAt(i),n+=r.charAt(e>>>4&15)+r.charAt(15&e);return n}(d(t))};return{mm_md5:function(t){return u(t)},hexMD5:u,rawMD5:d}};function _defineEnumerableProperties(t,e){for(var i in e){(a=e[i]).configurable=a.enumerable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,i,a)}if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n++){var a,o=r[n];(a=e[o]).configurable=a.enumerable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,o,a)}return t}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _typeof(t){return _typeof="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},_typeof(t)}var MMAdvertisentInformation={_adClient:void 0,_adId:void 0,_adPosition:void 0,_adDuration:void 0,_adResolution:void 0,_adLinear:void 0,_adCreativeType:void 0,_adServer:void 0,_prevAdState:void 0,_playSent:!1,_adCreativeId:void 0,_adTitle:void 0,_adBitrate:void 0,_adUrl:void 0,_adPlaybackStartWallClockTime:0,_adplaydur:0,_adPlaybackTime:0,_adLastPlayingEventTimeStamp:-1,_adLastAdEventTimeStamp:-1,_isBumper:!1,_adPodIndex:-2,_adPodLength:-1,_adPositionInPod:-1,_adScheduledTime:-1},MMExperienceProbeState=Object.freeze({IDLE:0,INITIALIZED:1,ONLOAD_SENT:2,STARTED:3,STOPPED:4,ERROR:5}),ExperienceProbe=function(){var t,e,i,r,n,a,o,s,d,u,h,_,f,p;return _defineProperty(f=_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2({_httpUtil:void 0,_playerName:void 0,_customerID:void 0,_subscriberID:void 0,_hashSubscriberID:!1,_assetID:void 0,_assetName:void 0,_videoId:void 0,_contentMetadata:void 0,_domainName:void 0,_component:void 0,_inProgress:!1,_simulatedEndedSent:!1,_mode:null,_modeFromResponse:null,_timerObj:null,_timerObj2:null,_timerTimestampSynchro:null,_regStatus:"",_enableVideoQoE:!0,_enableAdQoE:!0,_sdkVersion:"",_hintFileVersion:"",_playDur:0,_latencyStartTime:0,_enableEP:!1,_KAdKeepAliveInterval:5e3,_adInformation:Object.create(MMAdvertisentInformation),_flagStartLatencyViaPlayer:!1,_statsMetric:{version:"1.0.0",qubitData:[]},_recordIndex:0,_upshiftCount:0,_downshiftCount:0,_pbTime:0,_progressMark:0,_totalDuration:0,_buffWait:0,_sumBuffWait:0,_sumBuffWaitCIRR:0,_buffWaitType:"",_sumBuffWaitVRT:0,_sumBuffWaitAAD:0,_prevPlayerState:0,_isVideoPaused:!1,_seekState:0,_EPState:0,_pauseStartTime:0,_pauseDuration:0,_initLatency:0,_adPlaybackTime:0,_bufferLength:0,_downloadRate:0,_downloadRateCount:0,_avgDownloadRate:0,_networkType:"",adClient:"",adURL:"",adDuration:0,adPosition:0,adLinear:!1,_adServer:"",_adCreativeMime:"",_wifiDataRate:0,frameLoss:0,_wifiSignalStrenth:0,_wifiSSID:"",_presentationWidth:0,_presentationHeight:0,_videoQuality:"",_experimentName:void 0,_subPropertyId:void 0,_viewSessionId:void 0,_basePlayerName:void 0,_basePlayerVersion:void 0,_deviceCapabilities:void 0,_deviceID:void 0,_playbackStatus:void 0,_bufferStartTime:0,_isBufferingState:!1,prevBitrate:0,newBitrate:0,_playerBrand:"",_playerModel:"",_playerVersion:"",_appName:"",_playerRes:"",_appVersion:"",_deviceType:"",_deviceBrand:"",_deviceModel:"",_deviceOs:"",_deviceOsVersion:"",_deviceOperator:"",_deviceMarketingName:"",_timeShift:0,_timeDeltaInMs:0,_isFirstBatch:!0,_eventToSend:[],_SESEventToSend:[],deviceIdStarz:"",_statsToSend:[],_epocTime:0,_setState:!1,_qoeMetric:{},_bwExtSet:!1,_prevSegInfo:{},_segINfoStatus:!1,_prevAudioTrack:"NA",_prevSubtitleTrack:"OFF",_cfVal:0,_maxSteps:0,_maxStepUp:0,_maxStepDown:0,_maxEventsInQ:40,_eventCount:0,_onLoadSentAtTS:0,_lastStatsPostedAtTS:0,_statsMonitorStartedAtTS:0,_bufferingCount:0,_subscriberType:void 0,_subscriberTag:void 0,_adLoadTime:0,_adStartEpocTime:0,_adBuffWaitForInterval:0,_adSumBuffWait:0,_adPauseStartTime:0,_adPauseDuration:0,_adPauseDurationToOffsetFromInterval:0,_adLoadStartTime:0,_segRepeatationCount:0,_httpPostTimeout:9e4,sessionId:"",_eventMetric:{version:"1.0.0",qubitData:[]},attributes:{UPSHIFTCOUNT:"upShiftCount",DOWNSHIFTCOUNT:"downShiftCount",SDKBOOTTIME:"sdkBootuptime",STREAMFORMAT:"streamFormat",MEDIATYPE:"mediaType",SOURCETYPE:"sourceType",SDKVERSION:"sdkVersion",HFILEVERSION:"hFileVersion",ISLIVE:"isLive",DATASOURCE:"dataSrc",CUSTID:"custId",SESSIONID:"sessionId",SST:"sst",CDN:"cdn",ASN:"asn",HOSTNAME:"sourceHostName",PBTIME:"pbTime",OPERATOR:"operator",NETWORKTYPE:"nwType",WIFISSID:"wifissid",WIFIDATERATE:"wifidatarate",SIGNALSTRENGTH:"signalstrength",PLATFORM:"platform",LOCATION:"location",SCREENRES:"scrnRes",BANDWIDTH:"bwInUse",LATENCY:"latency",BUFFERING:"buffWait",BUFFERINGTYPE:"buffWaitType",SUMBUFFERING:"sumBuffWait",SUMBUFFERINGCIRR:"sumBuffWaitCIRR",SUMBUFFERINGVRT:"sumBuffWaitVRT",SUMBUFFERINGAAD:"sumBuffWaitAAD",PLAYDUR:"playDur",FRAMELOSS:"frameloss",ASSETID:"assetId",ASSETNAME:"assetName",VIDEOID:"videoId",STREAMURL:"streamURL",PLAYERVERSION:"playerVersion",PLAYERBRAND:"pb",PLAYERMODEL:"pm",MINRES:"minRes",MAXRES:"maxRes",MAXFPS:"maxFps",MINFPS:"minFps",NUMPROFILE:"numOfProfile",TOTALDURATION:"totalDuration",RESOLUTION:"res",QBRBITRATE:"qbrBitrate",CBRBITRATE:"cbrBitrate",QBRQUALITY:"qbrQual",CBRQUALITY:"cbrQual",DURATION:"dur",FPS:"fps",SEQNUM:"seqNum",STARTTIME:"startTime",PROFILENUM:"profileNum",LASTTS:"lastTS",CBRSIZE:"cbrSize",QBRSIZE:"qbrSize",PAUSEDURATION:"pauseDuration",SUBSCRIBERID:"subscriberId",DOMAINNAME:"domainName",PLAYERNAME:"playerName",QBRSDKMODE:"mode",DEVICETYPE:"device",DEVICEBRAND:"brand",DEVICEMODEL:"model",DEVICEMARKETINGNAME:"deviceMarketingName",OSVERSION:"version",SUBSCRIBERTYPE:"subscriberType",SUBSCRIBERTAG:"subscriberTag",CONTENTTYPE:"contentType",DRMPROTECTION:"drmProtection",EPISODENUMBER:"episodeNumber",GENRE:"genre",SEASON:"season",SERIESTITLE:"seriesTitle",VIDEOTYPE:"videoType",VIDEOTRACK:"videoTrack",SUBTITLETRACK:"subtitleTrack",AUDIOTRACK:"audioTrack",ISVDSACTIVE:"isVDSActive",ISSUBTITLEACTIVE:"isSubtitleActive",PROGRESSMARK:"progressMark",APPNAME:"appName",PLAYERRES:"playerRes",APPVERSION:"appVersion",VIDEOQUALITY:"videoQuality",DEVICECAPABILITIES:"deviceCapabilities",DEVICEID:"deviceId",PLAYBACKSTATUS:"playbackStatus",EXPERIMENTNAME:"experimentName",SUBPROPERTYID:"subPropertyId",VIEWSESSIONID:"viewSessionId",BASEPLAYERNAME:"basePlayerName",BASEPLAYERVERSION:"basePlayerVersion"},_producerURL:void 0,_secondaryProducerList:[],_producerURLSES:void 0,sesRequirements:void 0,profiledIdSES:void 0,index:0},"deviceIdStarz",""),"_postInterval",10),"_customTag",{}),"_baseServerTimeStampMS",0),"_prevBitrate",-1),"_streamUrl",""),"_initLatancy",0),"_adPauseStartTime",0),_defineProperty(f,"_adEpocTime",0),_defineProperty(f,"setEPState",(function(t){this._EPState=t})),_defineProperty(f,"getEPState",(function(){return this._EPState})),_defineProperty(f,"getQbrMode",(function(){return this._mode})),_defineProperty(f,"isValidStateTransition",(function(t){return!0})),_defineProperty(f,"setRegistrationStatus",(function(t){this._regStatus=t})),_defineProperty(f,"getRegistrationStatusWithBackend",(function(){return this._regStatus})),(p={})[t="postInterval"]=p[t]||{},p[t].set=function(t){this._postInterval=t},p[e="postInterval"]=p[e]||{},p[e].get=function(){return this._postInterval},p[i="recordIndex"]=p[i]||{},p[i].set=function(t){this._recordIndex=t},p[r="recordIndex"]=p[r]||{},p[r].get=function(){return this._recordIndex},p[n="upShiftCount"]=p[n]||{},p[n].set=function(t){this._upshiftCount=t},p[a="upshiftCount"]=p[a]||{},p[a].get=function(){return this._upshiftCount},p[o="downShiftCount"]=p[o]||{},p[o].set=function(t){this._downshiftCount=t},p[s="downshiftCount"]=p[s]||{},p[s].get=function(){return this._downshiftCount},p[d="qoeMetric"]=p[d]||{},p[d].set=function(t){this._qoeMetric=t},p[u="qoeMetric"]=p[u]||{},p[u].get=function(){return this._qoeMetric},p[h="eventMetric"]=p[h]||{},p[h].set=function(t){this._eventMetric=t},p[_="eventMetric"]=p[_]||{},p[_].get=function(){return this._eventMetric},_defineProperty(f,"registerMMSmartStreaming",(function(t,e,i,r,n,a,o){this._playerName=t,this._customerID=e,this._subscriberID=i,this._domainName=r,this._subscriberType=n,this._subscriberTag=a,void 0!==o&&(this._hashSubscriberID=o)})),_defineProperty(f,"updateSubscriberID",(function(t){this._subscriberID=t})),_defineProperty(f,"updateSubscriber",(function(t,e,i){this._subscriberID=t,this._subscriberType=e,this._subscriberTag=i})),_defineProperty(f,"initializeSession",(function(t,e,i,r){return this._mode=t,this._httpUtil&&(this._httpUtil.cleanUp(),this._httpUtil=void 0),this._producerURL=void 0,this._secondaryProducerList=[],this._producerURLSES=void 0,this.deviceIdStarz="",this.index=0,this.setRegistrationStatus("PENDING"),this._statsMetric.version=this._eventMetric.version=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.EP_SCHEMA_VERSION,this._streamUrl=e,this._assetID=r.assetId,this._assetName=r.assetName,this._videoId=r.videoId,this._contentMetadata=r,this.setSESURL("https://mediamelon-builds.s3.amazonaws.com/MM-RELEASE-BUILDS/1185727140/files/endPoint.json"),this.initialize(),this.registerSdkWithBackend(t)})),_defineProperty(f,"registerSdkWithBackend",(function(t){var e=MMSTREAMSMARTERCONSTANTS.SDK_REGISTER_URL+this._customerID,i=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG;return i.component=this._component,i.mode=t,this._httpUtil=new HttpUtil,this._httpUtil.doGet(e,i)})),_defineProperty(f,"getProfiledIdforToolbox",(function(){if(this.sesRequirements){var t=this.sesRequirements.JWT,e=new XMLHttpRequest;e.open("GET",this.sesRequirements.toolboxEndpoint_profiledId,!0),e.setRequestHeader("Access-Control-Allow-Origin","*"),e.setRequestHeader("Authorization","JWT "+t),e.onerror=function(){console.log("Error while getting profiledId for Toolbox")};var i=this;e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE){var t=e.status;if(0===t||t>=200&&t<400){var r=e.response;try{i.profiledId=JSON.parse(r).result[0].id}catch(t){console.log("JSON format incorrect for profiledId -Toolbox")}}else console.log("Error while getting profiledId for Toolbox - HTTP error",t)}},e.send()}})),_defineProperty(f,"sendHearbeatToStarz",(function(){if(this.sesRequirements){var t=this.sesRequirements.sid,e=parseFloat(this._pbTime.toFixed(2)),i=this.sesRequirements.cid,r=new XMLHttpRequest;r.open("POST",this._producerURLSES+"PLAYBACK_UPDATE",!0),r.timeout=this._httpPostTimeout,r.setRequestHeader("Access-Control-Allow-Origin","*"),r.setRequestHeader("Content-type","application/json");var n=this.sesRequirements.starzEndpoint.split("track/")[1],a={apiKey:n.substring(0,n.length-1),eventType:"",deviceId:this.deviceIdStarz};a.eventType="PLAYBACK_UPDATE",a.properties={session_id:t,affiliate_name:"Dish_MX_SES",content_id:i,position_milliseconds:1e3*e};var o=JSON.stringify(a);r.onerror=function(){console.log("Error in sending heartbeat to starz")},r.send(o)}})),_defineProperty(f,"sendHeartbeatToToolbox",(function(){if(this._producerURLSES&&this.profiledId&&this.sesRequirements&&!this.sesRequirements.isStarz){this.index+=1;var t=this.index,e=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES].split("x"),i=(e[0],e[1],{content:{id:this.sesRequirements.cid,drmType:"com.widevine.alpha",formatType:"application/dash+xml"},events:[],playback:{position:parseFloat(this._pbTime.toFixed(2)),timeSpent:this.getPlayDur(),bitrate:this._prevSegInfo.cbrBitrate},user:{profiledId:this.profiledId},playerID:this.deviceIdStarz}),r={name:"StreamingProgress",number:t};i.events.push(r);var n=JSON.stringify(i),a=new XMLHttpRequest;a.open("POST",this._producerURLSES),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Access-Control-Allow-Origin","*"),a.setRequestHeader("Accept","application/json");var o=this.sesRequirements.JWT;a.setRequestHeader("Authorization","JWT "+o),a.onerror=function(){console.log("Error while sending heartbeat to Toolbox")},a.send(n)}})),_defineProperty(f,"packageToolBoxEvent",(function(t,e){if(this.sesRequirements&&!this.sesRequirements.isStarz){this.sesRequirements.isToolbox&&""==this.sesRequirements.toolboxEndpoint_profiledId&&this.getProfiledIdforToolbox();var i=t;if("ONLOAD"!==i&&"COMPLETE"!==i&&"SEEKED"!==i&&"BUFFERING"!==i&&"VideoPlaybackQualityChanged"!==i&&"ERROR"!==i&&"SEEKING"!==i&&"BUFFERING_FINISHED"!==i){var r="firstquartile"===i?25:"midpoint"===i?50:"thirdquartile"===i?75:"complete"===i?95:"ended"===i?99:"COMPLETE"===i?100:"progressmark"===i?10:void 0;this.index+=1;var n=this.index,a=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES].split("x"),o=(a[0],a[1],{content:{id:this.sesRequirements.cid,drmType:"com.widevine.alpha",formatType:"application/dash+xml"},events:[],playback:{position:parseFloat(this._pbTime.toFixed(2)),timeSpent:this.getPlayDur(),bitrate:this._prevSegInfo.cbrBitrate},user:{profiledId:this.profiledId},playerID:this.deviceIdStarz});if("START"===i||"PAUSE"===i||"RESUME"===i){var s={name:i.toLowerCase(),number:n};return o.events.push(s),JSON.stringify(o)}if("SES_ERROR"===i){var d={name:"playbackError",value:{errorCode:e.code,errorMessage:e.name}};return o.events.push(d),JSON.stringify(o)}var u={name:i,value:r,number:n};return o.events.push(u),JSON.stringify(o)}}})),_defineProperty(f,"sendEventToToolbox",(function(){if(this.sesRequirements&&!this.sesRequirements.isStarz&&this._producerURLSES&&this.profiledId){this._SESEventToSend.length;for(var t=this.sesRequirements.JWT,e=0;e<this._SESEventToSend.length;e++){var i=new XMLHttpRequest;i.open("POST",this._producerURLSES,!0),i.timeout=this._httpPostTimeout,i.setRequestHeader("Access-Control-Allow-Origin","*"),i.setRequestHeader("Content-type","application/json"),i.setRequestHeader("Authorization","JWT "+t),i.setRequestHeader("Accept","application/json"),i.onerror=function(){console.log("Error while sending event to Toolbox")},i.send(this._SESEventToSend[e]),this._SESEventToSend[e]=null}this._SESEventToSend=[]}})),_defineProperty(f,"GenerateDeviceIdStarz",(function(){return""})),_defineProperty(f,"packageStarzEvent",(function(t,e){if(this.sesRequirements&&!this.sesRequirements.isToolbox){var i=this.sesRequirements.sid,r=parseFloat(this._pbTime.toFixed(2)),n=this._playerBrand,a=this._playerVersion,o=this._deviceOs,s=this._deviceOsVersion,d=this._deviceBrand,u=this._deviceModel,h=this.sesRequirements.cid,_="Dish_MX",f=this.sesRequirements.starzEndpoint.split("track/")[1],p={apiKey:f.substring(0,f.length-1),eventType:"",deviceId:this.deviceIdStarz};if("VideoPlaybackQualityChanged"===t)return p.eventType="VIDEO_PLAYBACK_QUALITY_CHANGED",p.properties={session_id:i,target_quality_resolution:e.targetQuality.width+"X"+e.targetQuality.height,target_quality_bitrate:e.targetQuality.bitrate},JSON.stringify(p);var c=t;return"PAUSE"===c||"RESUME"===c||"COMPLETE"===c||"SEEKING"===c||"SEEKED"===c||"ENDED"===c?("PAUSE"===c?(p.eventType="PLAYBACK_PAUSED",p.properties={session_id:i,paused_position_milliseconds:1e3*r}):"RESUME"===c?(p.eventType="PLAYBACK_RESUMED",p.properties={session_id:i,resumed_position_milliseconds:1e3*r}):"COMPLETE"===c||"ENDED"===c?(p.eventType="PLAYBACK_FINISHED",p.properties={session_id:i,end_time_milliseconds:1e3*r}):"SEEKING"===c?(p.eventType="SEEK_STARTED",p.properties={session_id:i,start_position_milliseconds:1e3*r}):"SEEKED"===c&&(p.eventType="SEEK_FINISHED",p.properties={session_id:i,end_position_milliseconds:1e3*r}),JSON.stringify(p)):"ONLOAD"===c?(p.eventType="PLAYER_READY",p.properties={session_id:i,player_name:n,player_version:a,os_name:o,os_version:s,platform_name:d,platform_version:u,device_type:"PC",content_id:h},JSON.stringify(p)):"downloadFinished"===c?(p.eventType="DOWNLOAD_FINISHED",p.properties={session_id:i,http_status:e.httpStatus,success:e.success,download_time:e.downloadTime,size:e.size,attempt:e.attempt,max_attempts:e.maxAttempts,download_Type:e.downloadType},JSON.stringify(p)):"SES_ERROR"===c?(p.eventType="ERROR",p.properties={session_id:i,error_details:{code:e.code,message:e.name,content_id:h,detail:e.data},user_residency_country:"NA",user_residency_region:"NA",catalog_partner:_},JSON.stringify(p)):"SES_WARNING"===c?(p.eventType="WARNING",p.properties={session_id:i,warning_details:{code:e.code,name:e.name,timestamp:e.timestamp,data:e.data,message:e.message}},JSON.stringify(p)):"BUFFERING_FINISHED"===c?(p.eventType="BUFFERING_FINISHED",p.properties={session_id:i},JSON.stringify(p)):"BUFFERING"===c?(p.eventType="BUFFERING_STARTED",p.properties={session_id:i},JSON.stringify(p)):"START"===c?(p.eventType="PLAYBACK_STARTED",p.properties={session_id:i,startup_time_milliseconds:this._initLatency,content_id:h,affiliate_name:"Dish_MX_SES",type:"Play Button",user_residency_country:"NA",user_residency_region:"NA",catalog_partner:_},JSON.stringify(p)):void 0}})),_defineProperty(f,"sendEventToStarz",(function(){if(this.sesRequirements&&!this.sesRequirements.isToolbox&&this._producerURLSES){this._SESEventToSend.length;for(var t=0;t<this._SESEventToSend.length;t++){var e=new XMLHttpRequest,i=JSON.parse(this._SESEventToSend[t]),r=this._producerURLSES+i.eventType;e.open("POST",r,!0),e.timeout=this._httpPostTimeout,e.setRequestHeader("Access-Control-Allow-Origin","*"),e.setRequestHeader("Content-type","application/json"),e.onerror=function(){console.log("Error while sending payload to Starz")},e.send(this._SESEventToSend[t]),this._SESEventToSend[t]=null}return this._SESEventToSend=[],0}})),_defineProperty(f,"reportRegistrationSuccess",(function(t){var e,i;this.setRegistrationStatus("SUCCESS"),this._modeFromResponse=t.mode,this.setCfVal(t.cfVal),void 0!==t.maxStepsUp&&(isNaN(t.maxStepsUp)||(e=t.maxStepsUp)),void 0!==t.maxStepsDown&&(isNaN(t.maxStepsDown)||(i=t.maxStepsDown)),void 0===e&&void 0===i&&void 0!==t.maxSteps&&(isNaN(t.maxSteps)||(e=i=t.maxSteps)),void 0!==t.secProdList&&t.secProdList.length>0&&Array.isArray(t.secProdList)&&this.reportSecondaryProducerList(t.secProdList),this.setMaxSteps(e,i),this.reportServerTimeStamp(t.timestamp),this.reportProducer(t.producerURL,t.statsInterval),this.monitorRegistration(),this._inProgress=!0,this._simulatedEndedSent=!1})),_defineProperty(f,"setSDKQoEConfig",(function(t,e){void 0!==t&&(this._enableVideoQoE=t),void 0!==e&&(this._enableAdQoE=e)})),_defineProperty(f,"reportRegistrationFailure",(function(){this.setRegistrationStatus("FAILED"),this._producerURL=void 0,this._secondaryProducerList=[],this._modeFromResponse=null,this._postInterval=-1,this._eventToSend=[],this._SESEventToSend=[],this._statsToSend=[],this.stopMonitoring()})),_defineProperty(f,"reportRenditionChange",(function(t,e){var i={},r=!1;if(e.cbrBitrate&&e.cbrBitrate!==t.cbrBitrate){t.cbrBitrate?e.cbrBitrate>t.cbrBitrate?this.upShift():this.downShift():t.cbrBitrate=0;var n="Prev: "+t.cbrBitrate+", New: "+e.cbrBitrate;i.Bitrate=n,r=!0}if(e.res&&e.res!==t.res){t.res||(t.res="0x0");var a="Prev: "+t.res+", New: "+e.res;i.Res=a,r=!0}if(e.vCodec&&e.vCodec!==t.vCodec){t.vCodec||(t.vCodec="NA");var o="Prev: "+t.vCodec+", New: "+e.vCodec;i.VCodec=o,r=!0}if(e.aCodec&&e.aCodec!==t.aCodec){t.aCodec||(t.aCodec="NA");var s="Prev: "+t.aCodec+", New: "+e.aCodec;i.ACodec=s,r=!0}if(e.fps&&e.fps!==t.fps){t.fps||(t.fps="0.0");var d="Prev: "+t.fps+", New: "+e.fps;i.FPS=d,r=!0}return r&&(i=JSON.stringify(i),this.notifyEvent("RENDITION_CHANGE",i,"RENDITION_CHANGE",this._pbTime)),r})),_defineProperty(f,"addCustomSegInfo",(function(t){this.reportRenditionChange(this._prevSegInfo,t)&&(t.timestamp=this.getCorrectedCurrentTimeinMs(),this._downloadRate>0&&(t.downloadRate=parseFloat((1024*this._downloadRate).toFixed(2))),this._statsMetric.qubitData[this._recordIndex].segInfo.push(t),this._prevSegInfo=t,this._segINfoStatus=!0)})),_defineProperty(f,"addSegInfo",(function(t){if(this._prevSegInfo){if(-1!=t.seqNum&&this._prevSegInfo.seqNum==t.seqNum&&this._prevSegInfo.startTime===t.startTime&&this._prevSegInfo.cbrBitrate===t.cbrBitrate&&this._segRepeatationCount++<10)return;if(this._prevSegInfo.cbrBitrate===t.cbrBitrate&&this._prevSegInfo.res===t.res)return}t.cbrBitrate&&(this._downloadRate>0&&(t.downloadRate=parseFloat((1024*this._downloadRate).toFixed(2))),this._bufferLength>=0&&(t.bufferLength=parseInt(this._bufferLength)),t.cbrSize?t.dur<0&&(t.cbrSize=t.qbrSize=0):t.dur>0?t.cbrSize=t.qbrSize=t.dur*t.cbrBitrate:t.cbrSize=t.qbrSize=0,t.timestamp=this.getCorrectedCurrentTimeinMs(),void 0!==t.qbrBitrate&&delete t.qbrBitrate,void 0!==t.qbrQual&&delete t.qbrQual,void 0!==t.cbrQual&&delete t.cbrQual,void 0!==t.dur&&delete t.dur,void 0!==t.seqNum&&delete t.seqNum,void 0!==t.startTime&&delete t.startTime,void 0!==t.fps&&delete t.fps,void 0!==t.profileNum&&delete t.profileNum,void 0!==t.cbrProfileNum&&delete t.cbrProfileNum,void 0!==t.qbrSize&&delete t.qbrSize,void 0!==t.bufferLength&&delete t.bufferLength,void 0!==t.cbrSize&&t.cbrSize<=0&&delete t.cbrSize,void 0!==t.vCodec&&""===t.vCodec&&delete t.vCodec,void 0!==t.aCodec&&""===t.aCodec&&delete t.aCodec,this.reportRenditionChange(this._prevSegInfo,t),this._statsMetric.qubitData[this._recordIndex].segInfo.push(t),this._prevSegInfo=t.constructor===Array?t[length-1]:t,this._segINfoStatus=!0,this._segRepeatationCount=0)})),_defineProperty(f,"setBandwidth",(function(t){void 0!==t&&t>0&&(this._downloadRate=t/1024,this._downloadRateCount=this._downloadRateCount+1,this._avgDownloadRate=this._downloadRate+this._avgDownloadRate)})),_defineProperty(f,"reportBufferLength",(function(t){t>=0&&(this._bufferLength=t)})),_defineProperty(f,"clearAdInfo",(function(){delete this._eventMetric.qubitData[this._recordIndex].adInfo})),_defineProperty(f,"setCustomTag",(function(t,e){void 0===this._eventMetric.qubitData[this._recordIndex].customTags&&(this._eventMetric.qubitData[this._recordIndex].customTags={}),void 0===this._statsMetric.qubitData[this._recordIndex].customTags&&(this._statsMetric.qubitData[this._recordIndex].customTags={});var i=this._eventMetric.qubitData[this._recordIndex].customTags;i[t]=e,this._eventMetric.qubitData[this._recordIndex].customTags=i,this._statsMetric.qubitData[this._recordIndex].customTags=i})),_defineProperty(f,"reportContentMetadata",(function(t){void 0!==t.assetId&&null!==t.assetId&&this.setContentMetadata(this.attributes.ASSETID,t.assetId),void 0!==t.assetName&&null!==t.assetName&&this.setContentMetadata(this.attributes.ASSETNAME,t.assetName),t.videoId&&this.setContentMetadata(this.attributes.VIDEOID,t.videoId),t.contentType&&this.setContentMetadata(this.attributes.CONTENTTYPE,t.contentType),t.drmProtection&&this.setContentMetadata(this.attributes.DRMPROTECTION,t.drmProtection),t.episodeNumber&&this.setContentMetadata(this.attributes.EPISODENUMBER,t.episodeNumber),t.genre&&this.setContentMetadata(this.attributes.GENRE,t.genre),t.season&&this.setContentMetadata(this.attributes.SEASON,t.season),t.seriesTitle&&this.setContentMetadata(this.attributes.SERIESTITLE,t.seriesTitle),t.videoType&&this.setContentMetadata(this.attributes.VIDEOTYPE,t.videoType)})),_defineProperty(f,"setContentMetadata",(function(t,e){null!=e&&(this._statsMetric.qubitData[this._recordIndex].contentMetadata[t]=e,this._eventMetric.qubitData[this._recordIndex].contentMetadata[t]=e)})),_defineProperty(f,"reportNetworkType",(function(t){t&&(this._networkType=t,this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType))})),_defineProperty(f,"reportDeviceType",(function(t){this._deviceType=t})),_defineProperty(f,"setCfVal",(function(t){this._cfVal=t})),_defineProperty(f,"getCfVal",(function(){return this._cfVal})),_defineProperty(f,"setMaxSteps",(function(t,e){t>=0&&(this._maxStepUp=t),e>=0&&(this._maxStepDown=e)})),_defineProperty(f,"getMaxStepsToSwitch",(function(){return[this._maxStepUp,this._maxStepDown]})),_defineProperty(f,"reportWifiSSID",(function(t){t&&(this._wifiSSID=t,this.setClientInfo(this.attributes.WIFISSID,this._wifiSSID))})),_defineProperty(f,"reportWifiSignalStrenthPercentage",(function(t){t&&(this._wifiSignalStrenth=t,this.setClientInfo(this.attributes.SIGNALSTRENGTH,this._wifiSignalStrenth))})),_defineProperty(f,"reportWifiDataRate",(function(t){t&&(this._wifiDataRate=t,this.setClientInfo(this.attributes.WIFIDATERATE,this._wifiDataRate))})),_defineProperty(f,"reportServerTimeStamp",(function(t){this._baseServerTimeStampMS=t,this.setCurrentTimeDelta()})),_defineProperty(f,"reportProducer",(function(t,e){this._producerURL=t,this._postInterval=e})),_defineProperty(f,"reportSecondaryProducerList",(function(t){this._secondaryProducerList=t})),_defineProperty(f,"reportProducerForSES",(function(t){this._producerURLSES=t,this.deviceIdStarz=this.GenerateDeviceIdStarz()})),_defineProperty(f,"reportMode",(function(t){this._mode=t,this.setStreamID(this.attributes.QBRSDKMODE,this._mode),this.sendEventInfo()})),_defineProperty(f,"reportAssetID",(function(t,e,i){t&&(this._assetID=t),e&&(this._assetName=e),i&&(this._videoId=i)})),_defineProperty(f,"reportPresentationSize",(function(t,e){this._presentationWidth=t,this._presentationHeight=e})),_defineProperty(f,"reportFrameLoss",(function(t){this.frameloss=t,this.setPBStats(this.attributes.FRAMELOSS,this.frameloss)})),_defineProperty(f,"reportABRSwitch",(function(t,e){})),_defineProperty(f,"monitorRegistration",(function(){this.sendEventInfo(),this.sendQueuedStats()})),_defineProperty(f,"sendQueuedStats",(function(){if(void 0!==this._producerURL){for(var t=0;t<this._statsToSend.length;t++){var e=this._statsToSend[t],i=!1;if("undefined"!=typeof pako)try{e=pako.gzip(e),i=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var r=new XMLHttpRequest;r.open("POST",this._producerURL,!0),r.timeout=this._httpPostTimeout,r.setRequestHeader("Content-type","application/json"),i&&r.setRequestHeader("Content-Encoding","gzip"),r.send(e),this._lastStatsPostedAtTS=this.getCurrentTimeinMs(),this._statsToSend[t]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(e,i)}this._statsToSend=[]}})),_defineProperty(f,"reportPlayerInfo",(function(t,e,i){this._playerBrand=t,this._playerModel=e,this._playerVersion=i})),_defineProperty(f,"reportAppInfo",(function(t,e){this._appName=t,this._appVersion=e})),_defineProperty(f,"reportPlayerResolution",(function(t){this._playerRes=t,this.setClientInfo(this.attributes.PLAYERRES,this._playerRes)})),_defineProperty(f,"reportDeviceCapabilities",(function(t){this._deviceCapabilities=t})),_defineProperty(f,"reportVideoQuality",(function(t){this._videoQuality=t})),_defineProperty(f,"reportExperimentName",(function(t){this._experimentName=t,this.setStreamID(this.attributes.EXPERIMENTNAME,this._experimentName)})),_defineProperty(f,"reportSubPropertyId",(function(t){this._subPropertyId=t,this.setStreamID(this.attributes.SUBPROPERTYID,this._subPropertyId)})),_defineProperty(f,"reportViewSessionId",(function(t){this._viewSessionId=t,this.setStreamID(this.attributes.VIEWSESSIONID,this._viewSessionId)})),_defineProperty(f,"reportBasePlayerInfo",(function(t,e){this._basePlayerName=t,this._basePlayerVersion=e,this.setStreamID(this.attributes.BASEPLAYERNAME,this._basePlayerName),this.setStreamID(this.attributes.BASEPLAYERVERSION,this._basePlayerVersion)})),_defineProperty(f,"reportManifestLoaded",(function(t){this.notifyEvent("MANIFEST_LOADED","Manifest Load Complete","MANIFEST_LOADED",this._pbTime)})),_defineProperty(f,"reportDeviceId",(function(t){this._deviceID=t})),_defineProperty(f,"reportDeviceInfo",(function(t,e,i,r,n,a,o,s){t&&(this._deviceBrand=t),e&&(this._deviceModel=e),i&&(this._deviceOs=i),r&&(this._deviceOsVersion=r),n&&(this._deviceOperator=n),o&&(this._presentationWidth=o),s&&(this._presentationHeight=s),a&&(this._deviceMarketingName=a),this.setScreenRes()})),_defineProperty(f,"reportMetricValue",(function(t,e){t===MMOverridableMetric.Latency?(this._initLatency=parseFloat(e.toFixed(2)),this._flagStartLatencyViaPlayer=!0):t===MMOverridableMetric.ServerAddress?this.setClientInfo(this.attributes.CDN,e):t===MMOverridableMetric.DurationWatched||(t===MMOverridableMetric.streamURL?this.setStreamID(this.attributes.STREAMURL,e):t===MMOverridableMetric.drmType&&this.setContentMetadata(this.attributes.DRMPROTECTION,e))})),_defineProperty(f,"reportAdBufferingStarted",(function(){if(this._adInformation){if(!this._adInformation._playSent||this._isBufferingState)return;this._isBufferingState=!0;var t=this.getCurrentTimeinMs();populateAdRelatedInfo(t),this._bufferStartTime=t,this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_BUFFERING","Ad Buffering started","AD_BUFFERING",null),_adInformation._adLastAdEventTimeStamp=t}})),_defineProperty(f,"reportAdBufferingCompleted",(function(){if(this._adInformation){if(!_adInformation._playSent||0==this._isBufferingState)return;if(this._playbackStatus="AD_BUFFERING_COMPLETE",this._isBufferingState=!1,this._prevPlayerState===MMPlayerState.PLAYING){var t=this.getCurrentTimeinMs();this._bufferStartTime&&(this._adBuffWaitForInterval=t-this._bufferStartTime,this._adSumBuffWait=this._adSumBuffWait+this._adBuffWaitForInterval,this.setPBStats(this.attributes.BUFFERING,this._adBuffWaitForInterval),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this._bufferStartTime=0)}}})),_defineProperty(f,"reportBufferingStarted",(function(){this.getEPState()!==MMExperienceProbeState.STARTED||this._isBufferingState||(this._isBufferingState=!0,this._bufferStartTime=this.getCurrentTimeinMs(),this._bufferingCount++,this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD),this.notifyEvent("BUFFERING_START","Playback Buffering Started","BUFFERING_START",this._pbTime))})),_defineProperty(f,"reportBufferingCompleted",(function(){this.getEPState()===MMExperienceProbeState.STARTED&&(this.notifyEvent("BUFFERING_COMPLETE","Playback Buffering Completed","BUFFERING_COMPLETE",this._pbTime),this._isBufferingState=!1,this.setBuffering())})),_defineProperty(f,"reportEventWithValue",(function(t,e){this.notifyEvent(t,e,t,this._pbTime)})),_defineProperty(f,"reportUserInitiatedPlayback",(function(){var t=this.getCurrentTimeinMs();this.getEPState()===MMExperienceProbeState.INITIALIZED?(this._latencyStartTime=t,this.notifyEvent("ONLOAD","Player Initializing..","ONLOAD",0),this.notifyPackager("ONLOAD"),this.setEPState(MMExperienceProbeState.ONLOAD_SENT)):console.log("Warn: State not valid")})),_defineProperty(f,"reportPlayerState",(function(t){var e=this.getEPState(),i=this.getCurrentTimeinMs();this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD);var r=!1;switch(t){case MMPlayerState.PLAYING:if(this._seekState=SeekState.Playing,this._isVideoPaused=!1,this._prevPlayerState==MMPlayerState.PAUSED&&e===MMExperienceProbeState.ONLOAD_SENT&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._pauseStartTime=0,this.notifyEvent("RESUME","Playback resumed","RESUME",this._pbTime),this.startMonitoring(),r=!0),e===MMExperienceProbeState.ONLOAD_SENT){if(!this._flagStartLatencyViaPlayer){var n=i-this._latencyStartTime;this._pauseDuration>0&&(n-=this._pauseDuration),this._initLatency=n,this._initLatency<0&&(this._initLatency=0)}this._epocTime=i,this.setPBStats(this.attributes.LATENCY,this._initLatency),this.setEPState(MMExperienceProbeState.STARTED),this.notifyPackager("START"),this.notifyEvent("START","Playback Start","START",this._pbTime),this._latencyStartTime=0,this.startMonitoring(),r=!0}else if(e===MMExperienceProbeState.STARTED&&this._prevPlayerState===MMPlayerState.PAUSED)this._pauseStartTime&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._epocTime+=this._pauseDuration,this._pauseStartTime=0,this._bufferStartTime=i,this.notifyEvent("RESUME","Playback resumed","RESUME",this._pbTime),this.notifyPackager("RESUME"),this.startMonitoring(),r=!0);else if(e===MMExperienceProbeState.STOPPED&&this._prevPlayerState===MMPlayerState.STOPPED){var a=this.getStreamInfo(),o=this.getStreamId(),s=this._mode;this.reset(),this.initialize(),this.reportMode(s),this.setPresentationStreamInfo(a.maxRes,a.minRes,a.maxFps,a.minFps,a.numOfProfile,a.streamFormat),this.setVideoDuration(a.totalDuration),this.setPresentationType(o.isLive),this.setEPState(MMExperienceProbeState.INITIALIZED),this.reportUserInitiatedPlayback(),this.reportPlayerState(MMPlayerState.PLAYING),this.setEPState(MMExperienceProbeState.STARTED),r=!0}break;case MMPlayerState.PAUSED:e!==MMExperienceProbeState.STARTED&&e!==MMExperienceProbeState.ONLOAD_SENT||(this.sendQBRStats(),this._pauseStartTime=i,this.notifyEvent("PAUSE","Playback Paused","PAUSE",this._pbTime),this.notifyPackager("PAUSE"),this._isVideoPaused=!0,r=!0);break;case MMPlayerState.STOPPED:if(!0===this._simulatedEndedSent||e===MMExperienceProbeState.STOPPED||void 0===this._prevPlayerState||this._prevPlayerState===MMPlayerState.STOPPED)break;this.sendQBRStats(),this._pauseStartTime>0&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._epocTime+=this._pauseDuration,this._pauseStartTime=0,this._pauseDuration=0),this._totalDuration<=0||this._pbTime<.9*this._totalDuration?(this.notifyEvent("ENDED","Playback completion","ENDED",this._pbTime),this.notifyPackager("ENDED")):(this.notifyEvent("COMPLETE","Playback completion","COMPLETE",this._pbTime),this.notifyPackager("COMPLETE")),this.stopMonitoring(),this._inProgress=!1,this.setEPState(MMExperienceProbeState.STOPPED),r=!0;break;default:return void MMLogger.log("INFO","Unknown State")}r&&(this._prevPlayerState=t)})),_defineProperty(f,"reportError",(function(t,e){this.setPlaybackPos(e),this.getEPState()>=MMExperienceProbeState.ONLOAD_SENT&&this.notifyEvent("ERROR",t,"ERROR",this._pbTime)})),_defineProperty(f,"isValid",(function(t){return null!=t&&t.length})),_defineProperty(f,"reportResolutionChange",(function(t){})),_defineProperty(f,"reportVolumeChange",(function(t){this.notifyEvent("VOLUME_CHANGE",t,"VOLUME_CHANGE",this._pbTime)})),_defineProperty(f,"reportPlaybackRateChange",(function(){this.notifyEvent("RATE_CHANGE","Playback Rate Changed","RATE_CHANGE",this._pbTime)})),_defineProperty(f,"reportDurationChange",(function(){this.notifyEvent("DURATION_CHANGE","Playback Duration Changed","DURATION_CHANGE",this._pbTime)})),_defineProperty(f,"reportPlayerSeekStarted",(function(){this._seekState=SeekState.SeekStarted,this.notifyEvent("SEEK_START","Playback Seek Started","SEEK_START",this._pbTime)})),_defineProperty(f,"reportPlayerSeekCompleted",(function(t){var e=this.getCurrentTimeinMs();this.getEPState()===MMExperienceProbeState.STARTED&&(this._pauseStartTime&&(this._epocTime+=e-this._pauseStartTime),this.setPlaybackPos(t),this._seekState=SeekState.SeekCompleted,this.notifyEvent("SEEK_COMPLETE","Playback Seek Completed","SEEK_COMPLETE",t/1e3),this.notifyPackager("SEEKED"),this._pauseStartTime&&(this._epocTime-=e-this._pauseStartTime))})),_defineProperty(f,"reset",(function(){this._inProgress&&this.getEPState()===MMExperienceProbeState.STARTED&&(this.reportPlayerState(MMPlayerState.STOPPED),this._inProgress=!1,this._simulatedEndedSent=!0),this._mode=null,this._bufferLength=0,this._downloadRate=0,this._downloadRateCount=0,this._avgDownloadRate=0,this._isFirstBatch=!0,this._eventCount=0,this._onLoadSentAtTS=0,this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=0,this._bufferingCount=0,this._recordIndex=0,this._prevBitrate=-1,this._upshiftCount=0,this._pbTime=0,this._progressMark=0,this._downshiftCount=0,this._playDur=0,this._baseServerTimeStampMS=0,this._totalDuration=0,this._buffWait=0,this._sumBuffWait=0,this._sumBuffWaitCIRR=0,this._buffWaitType="",this._sumBuffWaitVRT=0,this._sumBuffWaitAAD=0,this._initLatency=0,this._latencyStartTime=0,this._enableEP=!1,this._flagStartLatencyViaPlayer=!1,this._prevPlayerState=void 0,this._isVideoPaused=!1,this._prevSegInfo={},this._prevAudioTrack="NA",this._prevSubtitleTrack="OFF",this._pauseStartTime=0,this._pauseDuration=0,this._adPlaybackTime=0,this.adDuration=0,this.adPosition=0,this._bufferStartTime=0,this._isBufferingState=!1,this.newBitrate=0,this._epocTime=0,this._qoeMetric={},this._statsMetric.qubitData=[],this._eventMetric.qubitData=[],this._statsMetric.qubitData.push(this.QBRMetricTemplate()),this._eventMetric.qubitData.push(this.EventMetricTemplate()),this._eventToSend=[],this._SESEventToSend=[],this.deviceIdStarz="",this._statsToSend=[],this.sessionId="",this._segRepeatationCount=0,this._maxSteps=0,this._maxStepUp=0,this._maxStepDown=0,this.index=0,this.setEPState(MMExperienceProbeState.IDLE)})),_defineProperty(f,"initialize",(function(){this.setStreamID(this.attributes.CUSTID,parseInt(this._customerID)),this.setStreamID(this.attributes.DATASOURCE,"Player"),this.setStreamID(this.attributes.PLAYERNAME,this._playerName),this.sessionId=this.getSessionId(),this.deviceIdStarz=this.GenerateDeviceIdStarz(),this.setStreamID(this.attributes.SESSIONID,this.sessionId),this.setStreamID(this.attributes.DOMAINNAME,this.getDomainName()),this.setStreamID(this.attributes.STREAMURL,this._streamUrl),this.setStreamID(this.attributes.PLAYERVERSION,this._playerVersion),this.setStreamID(this.attributes.PLAYERBRAND,this._playerBrand),this.setStreamID(this.attributes.PLAYERMODEL,this._playerModel),this.setStreamID(this.attributes.SUBPROPERTYID,this._subPropertyId),this.setStreamID(this.attributes.EXPERIMENTNAME,this._experimentName),this.setStreamID(this.attributes.VIEWSESSIONID,this._viewSessionId),this.setStreamID(this.attributes.BASEPLAYERNAME,this._basePlayerName),this.setStreamID(this.attributes.BASEPLAYERVERSION,this._basePlayerVersion),this.setSDKInfo(this.attributes.SDKVERSION,this._sdkVersion),this.setSDKInfo(this.attributes.HFILEVERSION,this._hintFileVersion),this.setClientInfo(this.attributes.DEVICETYPE,this._deviceType),this.setClientInfo(this.attributes.DEVICEBRAND,this._deviceBrand),this.setClientInfo(this.attributes.DEVICEMODEL,this._deviceModel),this.setClientInfo(this.attributes.OSVERSION,this._deviceOsVersion),this.setClientInfo(this.attributes.PLATFORM,this._deviceOs),this.setClientInfo(this.attributes.OPERATOR,this._deviceOperator),this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType),this.setClientInfo(this.attributes.WIFISSID,this._wifiSSID),this.setClientInfo(this.attributes.WIFIDATERATE,this._wifiDataRate),this.setClientInfo(this.attributes.SIGNALSTRENGTH,this._wifiSignalStrenth),this.setClientInfo(this.attributes.APPNAME,this._appName),this.setClientInfo(this.attributes.APPVERSION,this._appVersion),this.setClientInfo(this.attributes.PLAYERRES,this._playerRes),this.setClientInfo(this.attributes.DEVICEMARKETINGNAME,this._deviceMarketingName),this.setSubscriberID(),this.setSubscriberType(),this.setSubscriberTag(),this.setAssetID(),this.reportContentMetadata(this._contentMetadata),this.setScreenRes(),this.setEPState(MMExperienceProbeState.INITIALIZED)})),_defineProperty(f,"getSessionId",(function(){(new Date).getTime();var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx-".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t+=(new Date).getTime()})),_defineProperty(f,"getDomainName",(function(){return this.isValid(this._domainName)||(this._domainName=this.getDefaultDomainName()),this._domainName})),_defineProperty(f,"getDefaultDomainName",(function(){return""})),_defineProperty(f,"isEmpty",(function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0})),_defineProperty(f,"getCustomTag",(function(t){return this._customTag[t]})),_defineProperty(f,"notifyPackager",(function(t,e){var i;this.sesRequirements&&(this&&this.sesRequirements.isToolbox&&((i="SES_ERROR"===t||"SES_WARNING"===t?this.packageToolBoxEvent(t,e):this.packageToolBoxEvent(t,this._pbTime))&&this._SESEventToSend.push(i),this.sendEventToToolbox()),this&&this.sesRequirements.isStarz&&((i="VideoPlaybackQualityChanged"===t||"SES_ERROR"===t||"downloadFinished"===t||"SES_WARNING"===t?this.packageStarzEvent(t,e):this.packageStarzEvent(t,this._pbTime))&&this._SESEventToSend.push(i),this.sendEventToStarz()))})),_defineProperty(f,"setSESRequirements",(function(t){this.sesRequirements=t})),_defineProperty(f,"setSESURL",(function(t){if(this.sesRequirements){var e=new XMLHttpRequest;e.open("GET",t,!0);var i=this;e.onload=function(){if(200===e.status){var t=JSON.parse(e.response);i.sesRequirements.isToolbox?(i.reportProducerForSES(t.toolboxEndpoint_events),i.sesRequirements.toolboxEndpoint_events=t.toolboxEndpoint_events,i.sesRequirements.toolboxEndpoint_profiledId=t.toolboxEndpoint_profiledId,i.getProfiledIdforToolbox()):i.sesRequirements.isStarz&&(i.reportProducerForSES(t.starzEndpoint),i.sesRequirements.starzEndpoint=t.starzEndpoint)}else console.log("Error while fetching MM URL tracker file "+e.response)},e.send()}})),_defineProperty(f,"notifyEvent",(function(t,e,i,r){if("object"===_typeof(e)&&(e="Unknown error took place: "+e),"FAILED"!==this._regStatus&&this&&this._eventMetric&&this._eventMetric.qubitData&&!(this._recordIndex<0)&&this._eventMetric.qubitData[this._recordIndex]&&this._eventMetric.qubitData[this._recordIndex].clientInfo&&this.attributes&&this.attributes.SCREENRES){this._eventMetric.playDur=this.getPlayDur();var n=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES];0!==t.indexOf("AD_")?this.clearAdInfo():(void 0!==this._adInformation._adResolution&&(this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES]=this._adInformation._adResolution),this._eventMetric.playDur=parseInt(this.getAdPlayDur())),r=r?parseFloat(r):parseFloat(0),this._eventMetric.playDur||(this._eventMetric.playDur=0),this._eventMetric.qubitData[this._recordIndex].pbEventInfo.event=t,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.desc=e,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.id=i,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.pbTime=parseFloat(r.toFixed(2)),this._qoeMetric.timestamp=this._eventMetric.timestamp=this.getCorrectedCurrentTimeinMs(),this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,this._qoeMetric[this.attributes.PROGRESSMARK]=parseFloat(this._progressMark.toFixed(2))),this._eventMetric.interval=this._postInterval,this._eventMetric.pbTime=parseFloat(r.toFixed(2)),Object.keys(this._qoeMetric).length&&this._eventMetric.qubitData[this._recordIndex].pbInfo.push(this._qoeMetric),this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.BUFFERING)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.BUFFERING],this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.UPSHIFTCOUNT)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.UPSHIFTCOUNT],this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.DOWNSHIFTCOUNT)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.DOWNSHIFTCOUNT];var a=JSON.parse(JSON.stringify(this._eventMetric));this._eventToSend.push(a),this.sendEventInfo(),this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES]=n,this._eventMetric.qubitData[this._recordIndex].adInfo=void 0,this._eventMetric.qubitData[this._recordIndex].pbEventInfo={},this._eventMetric.qubitData[this._recordIndex].pbInfo=[],this._playbackStatus=t,this._qoeMetric.hasOwnProperty(this.attributes.LATENCY)&&delete this._qoeMetric[this.attributes.LATENCY],this._qoeMetric.hasOwnProperty(this.attributes.PAUSEDURATION)&&delete this._qoeMetric[this.attributes.PAUSEDURATION]}})),_defineProperty(f,"downShift",(function(){this._downshiftCount++})),_defineProperty(f,"upShift",(function(){this._upshiftCount++})),_defineProperty(f,"getInitialDelay",(function(){return this._initLatency})),_defineProperty(f,"getBuffWait",(function(){return this._sumBuffWait})),_defineProperty(f,"getBufferingCount",(function(){return this._bufferingCount})),_defineProperty(f,"setStreamID",(function(t,e){null!=e&&(this._statsMetric.qubitData[this._recordIndex].streamID[t]=e,this._eventMetric.qubitData[this._recordIndex].streamID[t]=e)})),_defineProperty(f,"setMode",(function(t){void 0!==t&&String(t).length>0&&(statsMetric.qubitData[this._recordIndex].streamID.mode=t,eventMetric.qubitData[this._recordIndex].streamID.mode=t)})),_defineProperty(f,"setClientInfo",(function(t,e){this._eventMetric.qubitData&&(void 0===this._eventMetric.qubitData[this._recordIndex].clientInfo&&(this._eventMetric.qubitData[this._recordIndex].clientInfo={}),void 0===this._statsMetric.qubitData[this._recordIndex].clientInfo&&(this._statsMetric.qubitData[this._recordIndex].clientInfo={}),e&&(this._statsMetric.qubitData[this._recordIndex].clientInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].clientInfo[t]=e))})),_defineProperty(f,"setPlaybackPos",(function(t){this._pbTime=t/1e3})),_defineProperty(f,"getPlaybackPos",(function(){return this._pbTime})),_defineProperty(f,"setPBStats",(function(t,e){if(t!==this.attributes.LATENCY){var i={};i.timestamp=this.getCorrectedCurrentTimeinMs(),i[t]=parseFloat(e.toFixed(2)),i[this.attributes.PBTIME]=parseFloat(this._pbTime.toFixed(2)),this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,i[this.attributes.PROGRESSMARK]=parseFloat(this._progressMark.toFixed(2))),t===this.attributes.BUFFERING&&(i[this.attributes.BUFFERINGTYPE]=this._buffWaitType),this._statsMetric.qubitData[this._recordIndex].pbInfo.push(i)}(e||t==this.attributes.LATENCY)&&(this._qoeMetric[t]=parseFloat(e.toFixed(2)))})),_defineProperty(f,"setBufPBEvent",(function(t,e){e&&(t in this._qoeMetric&&t===this.attributes.BUFFERING?this._qoeMetric[t]=parseInt(e):this._qoeMetric[t]=e)})),_defineProperty(f,"setSDKInfo",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].sdkInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].sdkInfo[t]=e)})),_defineProperty(f,"getPBStats",(function(t){return this._qoeMetric[t]})),_defineProperty(f,"setDiagnostics",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].diagnostics[t]=e)})),_defineProperty(f,"setStreamInfo",(function(t,e){void 0!==t&&void 0!==e&&(this._statsMetric.qubitData[this._recordIndex].streamInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].streamInfo[t]=e)})),_defineProperty(f,"getStreamInfo",(function(){return this._statsMetric.qubitData[this._recordIndex].streamInfo})),_defineProperty(f,"getStreamId",(function(){return this._statsMetric.qubitData[this._recordIndex].streamID})),_defineProperty(f,"setSegInfo",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].segInfo[t]=e)})),_defineProperty(f,"setScreenRes",(function(){var t="";(this.isValid(this._presentationHeight)&&this.isValid(this._presentationWidth)||this._presentationHeight>0&&this._presentationWidth>0)&&(t=this._presentationWidth+"x"+this._presentationHeight),this.setClientInfo(this.attributes.SCREENRES,t),this.setClientInfo(this.attributes.VIDEOQUALITY,this._videoQuality),this.setClientInfo(this.attributes.DEVICEID,this._deviceID),this._deviceCapabilities&&this.setClientInfo(this.attributes.DEVICECAPABILITIES,this._deviceCapabilities)})),_defineProperty(f,"setAssetID",(function(){void 0!==this._assetID&&null!==this._assetID&&this.setStreamID(this.attributes.ASSETID,this._assetID),void 0!==this._assetName&&null!==this._assetName&&this.setStreamID(this.attributes.ASSETNAME,this._assetName),this._videoId&&this.setStreamID(this.attributes.VIDEOID,this._videoId)})),_defineProperty(f,"uuidv4_subscriberID",(function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))})),_defineProperty(f,"setSubscriberID",(function(){this._subscriberID&&(this._hashSubscriberID?this.setStreamID(this.attributes.SUBSCRIBERID,MMMD5().mm_md5(this._subscriberID)):this.setStreamID(this.attributes.SUBSCRIBERID,this._subscriberID))})),_defineProperty(f,"setSubscriberType",(function(){this._subscriberType&&this.setStreamID(this.attributes.SUBSCRIBERTYPE,this._subscriberType)})),_defineProperty(f,"setSubscriberTag",(function(){this._subscriberTag&&this.setStreamID(this.attributes.SUBSCRIBERTAG,this._subscriberTag)})),_defineProperty(f,"setVideoDuration",(function(t){t&&(this._totalDuration=t,this.setStreamInfo(this.attributes.TOTALDURATION,parseFloat(t.toFixed(2))))})),_defineProperty(f,"reportStreamInfo",(function(t,e,i){t&&this.setStreamInfo(this.attributes.STREAMFORMAT,t),e&&this.setStreamID(this.attributes.MEDIATYPE,e),i&&this.setStreamID(this.attributes.SOURCETYPE,i)})),_defineProperty(f,"reportNetworkInfo",(function(t,e,i,r,n){n&&(this._deviceOperator=n),r&&(this._networkType=r),this.setClientInfo(this.attributes.CDN,t),this.setClientInfo(this.attributes.ASN,e),this.setClientInfo(this.attributes.HOSTNAME,i),this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType),this.setClientInfo(this.attributes.OPERATOR,this._deviceOperator)})),_defineProperty(f,"setPresentationType",(function(t){this.setStreamID(this.attributes.ISLIVE,t)})),_defineProperty(f,"setPresentationStreamInfo",(function(t,e,i,r,n,a){this.setStreamInfo(this.getAttribute().MAXRES,t),this.setStreamInfo(this.getAttribute().MINRES,e),this.setStreamInfo(this.getAttribute().MAXFPS,parseFloat(i)),this.setStreamInfo(this.getAttribute().MINFPS,parseFloat(r)),this.setStreamInfo(this.getAttribute().NUMPROFILE,n),a&&this.setStreamInfo(this.getAttribute().STREAMFORMAT,a)})),_defineProperty(f,"reportTrackinfo",(function(t,e,i,r,n){var a=e;if(n||(a="OFF"),this.setStreamInfo(this.getAttribute().VIDEOTRACK,t),this.setStreamInfo(this.getAttribute().SUBTITLETRACK,a),this.setStreamInfo(this.getAttribute().AUDIOTRACK,i),this.setStreamInfo(this.getAttribute().ISVDSACTIVE,r),this.setStreamInfo(this.getAttribute().ISSUBTITLEACTIVE,n),a&&a!=this._prevSubtitleTrack){var o="Prev: "+this._prevSubtitleTrack+", New: "+a;this.notifyEvent("SUBTITLE_CHANGE",o,"SUBTITLE_CHANGE",this._pbTime),this._prevSubtitleTrack=a}if(i&&i.length>0&&i!=this._prevAudioTrack){o="Prev: "+this._prevAudioTrack+", New: "+i;this.notifyEvent("AUDIO_CHANGE",o,"AUDIO_CHANGE",this._pbTime),this._prevAudioTrack=i}})),_defineProperty(f,"reportComponent",(function(t){this._component=t})),_defineProperty(f,"reportSDKVersion",(function(t){this._sdkVersion=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.sdkVersion+t})),_defineProperty(f,"getSDKVersion",(function(){return this._sdkVersion})),_defineProperty(f,"reportHintFileVersion",(function(t){this._hintFileVersion=t})),_defineProperty(f,"setBuffering",(function(){var t=this.getCurrentTimeinMs();this._bufferStartTime&&(this._buffWait=t-this._bufferStartTime,this._sumBuffWait=this._sumBuffWait+this._buffWait,this._seekState===SeekState.SeekStarted||this._seekState===SeekState.SeekCompleted?(this._sumBuffWaitVRT=this._sumBuffWaitVRT+this._buffWait,this._buffWaitType="VRT"):(this._sumBuffWaitCIRR=this._sumBuffWaitCIRR+this._buffWait,this._buffWaitType="CIRR"),this.setPBStats(this.attributes.BUFFERING,this._buffWait),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD),this._bufferStartTime=0)})),_defineProperty(f,"setCurrentTimeDelta",(function(){var t=(new Date).getTime();this._baseServerTimeStampMS&&(this._baseServerTimeStampMS>t?(this._timeShift=-1,this._timeDeltaInMs=this._baseServerTimeStampMS-t):(this._timeShift=1,this._timeDeltaInMs=t-this._baseServerTimeStampMS))})),_defineProperty(f,"getCorrectedCurrentTimeinMs",(function(){var t=(new Date).getTime();return this._timeShift>0?t-this._timeDeltaInMs:t+this._timeDeltaInMs})),_defineProperty(f,"getCurrentTimeinMs",(function(){return(new Date).getTime()})),_defineProperty(f,"setPostInterval",(function(t){this._postInterval=t})),_defineProperty(f,"stopMonitoring",(function(){this._enableEP=!1,this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=0,this._timerObj&&clearInterval(this._timerObj),this._timerObj2&&clearInterval(this._timerObj2),this._timerObj=null,this._timerObj2=null,this._timerTimestampSynchro&&clearInterval(this._timerTimestampSynchro),this._timerTimestampSynchro=null})),_defineProperty(f,"startMonitoringForSES",(function(){this.sesRequirements&&(this&&this.sesRequirements.isToolbox&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHeartbeatToToolbox.bind(this),3e5)),this&&this.sesRequirements.isStarz&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHearbeatToStarz.bind(this),6e4)))})),_defineProperty(f,"startMonitoring",(function(){"SUCCESS"===this._regStatus&&(this._enableEP=!0,null===this._timerObj&&this.getEPState()===MMExperienceProbeState.STARTED&&this._postInterval>0&&this._producerURL&&(this._timerObj=setInterval(this.sendQBRStats.bind(this),1e3*this._postInterval),this.sesRequirements&&this.sesRequirements.isToolbox&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHeartbeatToToolbox.bind(this),3e5)),this.sesRequirements&&this.sesRequirements.isStarz&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHearbeatToStarz.bind(this),6e4))),this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=this.getCurrentTimeinMs())})),_defineProperty(f,"getChecksum",(function(t,e,i){var r=MMMD5().mm_md5(t+e+i+this._eventCount);return this._eventCount++,r.substr(8,8)+r.substr(24,8)+r.substr(0,8)+r.substr(16,8)})),_defineProperty(f,"cloneAndReplaceAttributes",(function t(e){var i={};for(var r in e)if(e.hasOwnProperty(r)){var n=void 0!==payloadKeyMap[r]?payloadKeyMap[r]:r,a=e[r];Array.isArray(a)?i[n]=a.map((function(e){return"object"===_typeof2(e)&&null!==e?t(e):e})):"object"===_typeof2(a)&&null!==a?i[n]=t(a):i[n]=a}return i})),_defineProperty(f,"sendEventInfo",(function(){if(void 0!==this._producerURL){if("FAILED"!==this._regStatus){for(var t=0;t<this._eventToSend.length;t++){var e=this._eventToSend[t];if(e&&e.qubitData[this._recordIndex].streamID){if(!0===this._isFirstBatch?(e.timestamp=this.getCorrectedCurrentTimeinMs(),e.qubitData[this._recordIndex].pbInfo[0].timestamp=e.timestamp,e.qubitData[this._recordIndex].streamID.mode=this._mode,e.interval=this._postInterval):(isNaN(e.timestamp)||void 0===e.timestamp||null===e.timestamp)&&(e.timestamp=this.getCorrectedCurrentTimeinMs()),"ONLOAD"===e.qubitData[this._recordIndex].pbEventInfo.event)this._onLoadSentAtTS=e.timestamp,this._modeFromResponse&&(e.qubitData[this._recordIndex].streamID.mode=this._modeFromResponse);else if("BUFFERING"!==e.qubitData[this._recordIndex].pbEventInfo.event&&"SEEKED"!==e.qubitData[this._recordIndex].pbEventInfo.event)this._modeFromResponse&&(e.qubitData[this._recordIndex].streamID.mode=this._modeFromResponse);else{if(null===this._mode)return;e.qubitData[this._recordIndex].streamID.mode=this._mode}if(this._onLoadSentAtTS&&"START"===e.qubitData[this._recordIndex].pbEventInfo.event){if(null===this._mode)return;if(this._modeFromResponse=this._mode,-1===this._totalDuration&&void 0===e.qubitData[this._recordIndex].streamID.isLive&&(e.qubitData[this._recordIndex].streamID.isLive=!0),void 0===e.qubitData[this._recordIndex].streamID.isLive&&this._totalDuration>=0&&(e.qubitData[this._recordIndex].streamID.isLive=!1),void 0===e.qubitData[this._recordIndex].streamID.isLive)return;e.qubitData[this._recordIndex].streamID.mode=this._mode}if(0===e.qubitData[this._recordIndex].pbEventInfo.event.indexOf("AD_")&&(e.qubitData[this._recordIndex].streamID.mode=void 0),0===e.qubitData[this._recordIndex].pbEventInfo.event.indexOf("AD_")){if(!this._enableAdQoE)return void(this._eventToSend[t]=null)}else if(!this._enableVideoQoE)return void(this._eventToSend[t]=null);console.log("EVENT == ",e.qubitData[this._recordIndex].pbEventInfo.event),e.qubitData[this._recordIndex].streamID.pId=this.getChecksum(this._customerID,this.sessionId,e.timestamp),this._onLoadSentAtTS>0&&(e.qubitData[this._recordIndex].streamID.sst=this._onLoadSentAtTS);var i=this.cloneAndReplaceAttributes(e),r=JSON.stringify(i),n=!1;if("undefined"!=typeof pako)try{r=pako.gzip(r),n=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var a=new XMLHttpRequest;a.open("POST",this._producerURL,!0),a.timeout=this._httpPostTimeout,a.setRequestHeader("Content-type","application/json"),n&&a.setRequestHeader("Content-Encoding","gzip"),a.send(r),this._eventToSend[t]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(r,n)}}this._isFirstBatch=!1,this._eventToSend=[]}}else this._eventToSend.length>this._maxEventsInQ&&this._eventToSend.splice(this._maxEventsInQ-4,2)})),_defineProperty(f,"sendQBRStats",(function(){if("FAILED"!==this._regStatus&&this._enableVideoQoE&&("PENDING"===this._regStatus||this._enableEP&&this.getEPState()===MMExperienceProbeState.STARTED)){if(!1===this._bwExtSet){var t=this._avgDownloadRate/this._downloadRateCount;!isNaN(t)&&t>0&&this.setPBStats(this.attributes.BANDWIDTH,t),this._downloadRateCount=0,this._avgDownloadRate=0}if(this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,this.setPBStats(this.attributes.PROGRESSMARK,parseFloat(this._progressMark.toFixed(2)))),!1===this._segINfoStatus&&!this._isVideoPaused){if(this._statsMetric&&this._statsMetric.pbTime>-1&&parseFloat(this._statsMetric.pbTime.toFixed(2))===parseFloat(this._pbTime.toFixed(2)))return;this._prevSegInfo&&this._prevSegInfo.cbrBitrate?(this._prevSegInfo.timestamp=this.getCorrectedCurrentTimeinMs(),this._prevSegInfo.dur=-1,this._prevSegInfo.cbrSize=this._prevSegInfo.qbrSize=0,this._statsMetric.qubitData[this._recordIndex].segInfo.push(this._prevSegInfo)):this._statsMetric.qubitData[this._recordIndex].segInfo=[]}this._segINfoStatus=!1,this._bwExtSet=!1,this._statsMetric.timestamp=this.getCorrectedCurrentTimeinMs(),this._statsMetric.pbTime=parseFloat(this._pbTime.toFixed(2)),this._isVideoPaused||(this._statsMetric.playDur=this.getPlayDur());var e=this._statsMonitorStartedAtTS?this.getCurrentTimeinMs()-this._statsMonitorStartedAtTS:0;if(e=this._lastStatsPostedAtTS?this.getCurrentTimeinMs()-this._lastStatsPostedAtTS:e,this._statsMetric.interval=parseInt(e?e/1e3:0),"PENDING"!==this._regStatus&&!this._statsMetric.interval)return;this._upshiftCount>0&&this.setPBStats(this.attributes.UPSHIFTCOUNT,this._upshiftCount),this._downshiftCount>0&&this.setPBStats(this.attributes.DOWNSHIFTCOUNT,this._downshiftCount),this._statsMetric.qubitData[this._recordIndex].streamID.pId=this.getChecksum(this._customerID,this.sessionId,this._statsMetric.timestamp),this._onLoadSentAtTS>0&&(this._statsMetric.qubitData[this._recordIndex].streamID.sst=this._onLoadSentAtTS);var i=this._statsMetric;this._isVideoPaused&&(i=this.convertStatsToPingPayload(i));var r=this.cloneAndReplaceAttributes(i),n=JSON.stringify(r);if(this._statsMetric.qubitData[this._recordIndex].segInfo=[],this._statsMetric.qubitData[this._recordIndex].pbInfo=[],this._statsToSend.push(n),void 0!==this._producerURL){for(var a=0;a<this._statsToSend.length;a++){var o=this._statsToSend[a],s=!1;if("undefined"!=typeof pako)try{o=pako.gzip(o),s=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var d=new XMLHttpRequest;d.open("POST",this._producerURL,!0),d.timeout=this._httpPostTimeout,d.setRequestHeader("Content-type","application/json"),s&&d.setRequestHeader("Content-Encoding","gzip"),d.send(o),this._lastStatsPostedAtTS=this.getCurrentTimeinMs(),this._statsToSend[a]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(o,s)}this._statsToSend=[]}else this._statsToSend.length>this._maxEventsInQ&&this._statsToSend.splice(this._maxEventsInQ-4,2)}})),_defineProperty(f,"convertStatsToPingPayload",(function(t){var e=t.qubitData[0].streamID,i={};e&&(e.custId&&(i[this.attributes.CUSTID]=e[this.attributes.CUSTID]),e.sessionId&&(i[this.attributes.SESSIONID]=e[this.attributes.SESSIONID]),e.pId&&(i.pId=e.pId),e.sst&&(i.sst=e.sst),e.subscriberId&&(i[this.attributes.SUBSCRIBERID]=e[this.attributes.SUBSCRIBERID]),i[this.attributes.DATASOURCE]="Player-ping");var r=JSON.parse(JSON.stringify(t));return r.qubitData=[{streamID:i}],r})),_defineProperty(f,"sendDataToSecondaryProducerList",(function(t,e){var i=this;try{this._secondaryProducerList.forEach((function(r){var n=new XMLHttpRequest;n.open("POST",r,!0),n.timeout=i._httpPostTimeout,n.setRequestHeader("Content-type","application/json"),e&&n.setRequestHeader("Content-Encoding","gzip"),n.send(t)}))}catch(t){console.error("MMError: Error sending data to secondary producer list: ",t)}})),_defineProperty(f,"getPlayDur",(function(){var t=this.getCurrentTimeinMs();return 0!==this._epocTime?t>this._epocTime&&(this._playDur=parseInt((t-this._epocTime)/1e3)):this._playDur=0,this._playDur})),_defineProperty(f,"getAdPlayDur",(function(){var t=0;return this._adInformation&&(t=this._adInformation._adPlayDur),t})),_defineProperty(f,"getAttribute",(function(){return this.attributes})),_defineProperty(f,"SegmentInfo",(function(t,e,i,r,n,a,o,s,d,u,h,_,f,p,c){return{res:t,qbrBitrate:void 0!==e&&e>0?e:0,cbrBitrate:void 0!==i&&i>0?i:0,qbrQual:void 0!==r?parseFloat(r.toFixed(2)):0,cbrQual:void 0!==n?parseFloat(n.toFixed(2)):0,dur:void 0!==a?a:0,seqNum:void 0!==o?o:0,startTime:void 0!==s?s:0,fps:void 0!==d?d:0,cbrProfileNum:void 0!==h?h:0,profileNum:void 0!==u?u:0,cbrSize:void 0!==_?Math.floor(_):0,qbrSize:void 0!==f?Math.floor(f):0,vCodec:void 0!==p?p:"",aCodec:void 0!==c?c:""}})),_defineProperty(f,"EventMetricTemplate",(function(){return{streamID:{},pbEventInfo:{},streamInfo:{},contentMetadata:{},sdkInfo:{},pbInfo:[]}})),_defineProperty(f,"QBRMetricTemplate",(function(){return{streamID:{},streamInfo:{},contentMetadata:{},segInfo:[],pbInfo:[],sdkInfo:{}}})),_defineProperty(f,"resetAdvertisementInfo",(function(){this._adInformation._adResolution=void 0,this._adInformation._adClient=void 0,this._adInformation._adId=void 0,this._adInformation._adDuration=void 0,this._adInformation._adPosition=void 0,this._adInformation._adLinear=void 0,this._adInformation._adCreativeType=void 0,this._adInformation._adServer=void 0,this._adInformation._prevAdState=void 0,this._adInformation._adPlaybackTime=void 0,this._adInformation._adCreativeId=void 0,this._adInformation._adTitle=void 0,this._adInformation._adBitrate=void 0,this._adInformation._adUrl=void 0,this._adInformation._playSent=!1,this._adInformation._adPlaybackStartWallClockTime=void 0,this._adInformation._adPlayDur=0,this._adInformation._adLastPlayingEventTimeStamp=-1,this._adInformation._adLastAdEventTimeStamp=-1,this._adInformation._isBumper=!1,this._adInformation._adPodIndex=-2,this._adInformation._adPodLength=-1,this._adInformation._adPositionInPod=-1,this._adInformation._adScheduledTime=-1,this._adEpocTime=0,this._adPauseStartTime=0,this._adStartEpocTime=0,this._adLoadTime=0,this._adStartEpocTime=0,this._adBuffWaitForInterval=0,this._adSumBuffWait=0,this._adPauseDuration=0,this._adPauseDurationToOffsetFromInterval=0,this._adLoadStartTime=0})),_defineProperty(f,"resetForNewAd",(function(){this._adInformation._prevAdState=null,this._adInformation._adPlaybackTime=-1,this._adInformation._playSent=!1,this._adInformation._adPlaybackStartWallClockTime=-1,this._adInformation._adLastPlayingEventTimeStamp=-1,this._adInformation._adLastAdEventTimeStamp=-1,this._adInformation._adPlayDur=0,this._adInformation._adPodIndex=-2,this._adInformation._adPodLength=-1,this._adInformation._adPositionInPod=-1,this._adInformation._adCreativeId=void 0,this._adInformation._adTitle=void 0,this._adInformation._adBitrate=void 0,this._adInformation._adUrl=void 0,this._adEpocTime=0,this._adPauseStartTime=0,this._adStartEpocTime=0,this._adLoadTime=0,this._adStartEpocTime=0,this._adBuffWaitForInterval=0,this._adSumBuffWait=0,this._adPauseDuration=0,this._adPauseDurationToOffsetFromInterval=0,this._adLoadStartTime=0})),_defineProperty(f,"sendAdPlayingEvent",(function(t,e){if(null!=this._adInformation&&this._adInformation._playSent&&this._adInformation._prevAdState!=MMAdState.AD_PAUSED){var i=parseInt((t-this._adInformation._adPlaybackStartWallClockTime)/1e3);(e||i>0&&i%(this._KAdKeepAliveInterval/1e3)==0)&&(this._adInformation._adPlaybackStartWallClockTime=t,this.populateAdRelatedInfo(t),this.notifyEvent("AD_PLAYING","AD KEEP ALIVE","AD_PLAYING",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastPlayingEventTimeStamp=t,this._adInformation._adLastAdEventTimeStamp=this.getCurrentTimeinMs())}})),_defineProperty(f,"resetAdInfoIfInitialState",(function(t){null==this._adInformation&&(this._adInformation=new MMAdvertisentInformation),t==MMAdState.AD_REQUEST||null==this._adInformation._prevAdState?(this.resetAdvertisementInfo(),this._adLoadStartTime=this._adPauseStartTime=this._adPauseDuration=this._adLoadTime=0,this._adBuffWaitForInterval=this._adSumBuffWait=0):t==MMAdState.AD_IMPRESSION&&this._adInformation._prevAdState!=MMAdState.AD_STARTED&&this._adInformation._prevAdState!=MMAdState.AD_REQUEST&&this._adInformation._prevAdState!=MMAdState.AD_IMPRESSION&&(this.resetForNewAd(),this._adLoadStartTime=this._adPauseStartTime=this._adPauseDuration=this._adLoadTime=0,this._adBuffWaitForInterval=this._adSumBuffWait=0);var e=Math.ceil(this._pbTime+3);null!=this._adInformation._adPosition&&null!=this._adInformation._adPosition||(this.getEPState()==MMExperienceProbeState.STARTED||this._pbTime<=1?this._adInformation._adPosition="pre":!this._adInformation.prevAdState&&this._adInformation.prevAdState!=MMPlayerState.STOPPED&&this._pbTime>0&&e<this._totalDuration?this._adInformation._adPosition="mid":(!this._adInformation.prevAdState&&this._adInformation.prevAdState==MMPlayerState.STOPPED||this._pbTime>0&&e>=this._totalDuration)&&(this._adInformation._adPosition="post")),this._adInformation._prevAdState=t})),_defineProperty(f,"populateAdRelatedInfo",(function(t){this._adInformation&&(void 0===this._eventMetric.qubitData[this._recordIndex].adInfo&&(this._eventMetric.qubitData[this._recordIndex].adInfo={}),void 0!==this._adInformation._adClient&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adClient=this._adInformation._adClient),void 0!==this._adInformation._adId&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adId=this._adInformation._adId),void 0!==this._adInformation._adDuration&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adDuration=parseFloat((this._adInformation._adDuration/1e3).toFixed(2))),void 0!==this._adInformation._adPosition&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPosition=this._adInformation._adPosition),void 0!==this._adInformation._adLinear&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adLinear=this._adInformation._adLinear),void 0!==this._adInformation._adCreativeType&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adCreativeType=this._adInformation._adCreativeType),void 0!==this._adInformation._adServer&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adSystem=this._adInformation._adServer),void 0!==this._adInformation._adResolution&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adResolution=this._adInformation._adResolution),void 0!==this._adInformation._adTitle&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adTitle=this._adInformation._adTitle),void 0!==this._adInformation._adBitrate&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adBitrate=this._adInformation._adBitrate),void 0!==this._adInformation._adUrl&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adUrl=this._adInformation._adUrl),void 0!==this._adInformation._adCreativeId&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adCreativeId=this._adInformation._adCreativeId),this._adInformation._adPodLength>0&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodLength=this._adInformation._adPodLength),this._adInformation._adPodIndex>=-1&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodIndex=this._adInformation._adPodIndex),this._adInformation._adPositionInPod>0&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodPosition=this._adInformation._adPositionInPod),this._eventMetric.qubitData[this._recordIndex].adInfo.isBumper=this._adInformation._isBumper,this._eventMetric.qubitData[this._recordIndex].adInfo.adInterval=this.getAdInterval(t))})),_defineProperty(f,"getAdInterval",(function(t){var e=0;return null!=this._adInformation&&this._adInformation._adLastAdEventTimeStamp>0&&(null!=this._adPauseStartTime&&this._adPauseStartTime>0&&(t=this._adPauseStartTime),e=1*(t-this._adInformation._adLastAdEventTimeStamp)/1e3),this._adPauseDurationToOffsetFromInterval>0&&(e-=this._adPauseDurationToOffsetFromInterval/1e3,this._adPauseDurationToOffsetFromInterval=0),this._adBuffWaitForInterval>0&&(e-=this._adBuffWaitForInterval/1e3,this._adInformation._adPlayDur+=this._adBuffWaitForInterval/1e3,this._adBuffWaitForInterval=0),e<0&&(e=0),this._adInformation._adPlayDur+=e,e})),_defineProperty(f,"millisecToSec",(function(t){return parseFloat(1*t/1e3).toFixed(2)})),_defineProperty(f,"reportAdState",(function(t){var e=this.getCurrentTimeinMs();switch(this.resetAdInfoIfInitialState(t),this.populateAdRelatedInfo(e),t){case MMAdState.AD_BLOCKED:this.notifyEvent("AD_BLOCK","Ad blocked","AD_BLOCK",0);break;case MMAdState.AD_IMPRESSION:this._adLoadStartTime=e,this._adPauseStartTime=-1,this.notifyEvent("AD_IMPRESSION","Ad impression has been made","AD_IMPRESSION",0);break;case MMAdState.AD_STARTED:case MMAdState.AD_PLAY:0==this._adInformation._playSent&&(this._adInformation._playSent=!0,this._adLoadStartTime>0&&(this.loadStartTime>0&&(this._adLoadStartTime,this.loadStartTime),this._adLoadTime=e-this._adLoadStartTime,this._adPauseDuration>0&&(this._adLoadTime-=this._adPauseDuration),this._adLoadTime<0&&(this._adLoadTime=0),this._adInformation._adPlayDur+=Math.ceil(this._adLoadTime/1e3)),this.populateAdRelatedInfo(e),this.setPBStats(this.attributes.LATENCY,this._adLoadTime),this.notifyEvent("AD_PLAY","Ad Playback started","AD_PLAY",0),this.adLoadStartTime=0,this._adInformation._adLastPlayingEventTimeStamp=this._adInformation._adPlaybackStartWallClockTime=this.getCurrentTimeinMs(),this._adInformation._adLastAdEventTimeStamp=this._adInformation._adLastPlayingEventTimeStamp);break;case MMAdState.AD_CLICKED:this.notifyEvent("AD_CLICK","Ad has been clicked","AD_CLICK",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_PAUSED:this.sendQBRStats(),this._adPauseStartTime=this.getCurrentTimeinMs(),this.notifyEvent("AD_PAUSED","Ad has been paused","AD_PAUSED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e,this._isVideoPaused=!0;break;case MMAdState.AD_RESUMED:this._adPauseStartTime>0&&(this._adPauseDuration=e-this._adPauseStartTime,this._adPauseDuration<0&&(this._adPauseDuration=0),this._adPauseDurationToOffsetFromInterval=this._adPauseDuration),this._isVideoPaused=!1,this.setPBStats(this.attributes.PAUSEDURATION,this._adPauseDuration),this.populateAdRelatedInfo(e),this.notifyEvent("AD_RESUMED","Ad has been resumed","AD_RESUMED",this.millisecToSec(this._adInformation._adPlaybackTime)),this.startMonitoring(),this._adInformation._adLastAdEventTimeStamp=e,this._adPauseStartTime=-1;break;case MMAdState.AD_SKIPPED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_SKIPPED","Ad has been skipped","AD_SKIPPED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_COMPLETED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this._adInformation._adDuration>0&&(this._adInformation._adPlaybackTime-90*this._adInformation._adDuration/100>=0||Math.abs(this._adInformation._adPlaybackTime-this._adInformation._adDuration)<2)?this.notifyEvent("AD_COMPLETE","Ad completed playing","AD_COMPLETE",this.millisecToSec(this._adInformation._adPlaybackTime)):this.notifyEvent("AD_ENDED","Ad ended","AD_ENDED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_ENDED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_ENDED","Ad ended","AD_ENDED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_ERROR:this.notifyEvent("AD_ERROR",event.message,"AD_ERROR",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_REQUEST:this.notifyEvent("AD_REQUEST","Ad has been requested","AD_REQUEST",0);break;case MMAdState.AD_PLAYING:this.sendAdPlayingEvent(e,!1);break;case MMAdState.AD_FIRST_QUARTILE:this.notifyEvent("AD_PLAYED_FIRST_QUARTILE","Ad reached first quartile","AD_PLAYED_FIRST_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_MIDPOINT:this.notifyEvent("AD_PLAYED_SECOND_QUARTILE","Ad reached midpoint","AD_PLAYED_SECOND_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_THIRD_QUARTILE:this.notifyEvent("AD_PLAYED_THIRD_QUARTILE","Ad reached third quartile","AD_PLAYED_THIRD_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e}})),_defineProperty(f,"reportAdError",(function(t,e){this.populateAdRelatedInfo(),null==e&&(e=this._adInformation._adPlaybackTime),void 0===e&&(e=0),this.notifyEvent("AD_ERROR",t,"AD_ERROR",this.millisecToSec(e))})),_defineProperty(f,"reportAdPlaybackTime",(function(t){if(t>=0&&this._adInformation){var e=this.getCurrentTimeinMs();this._adInformation._adPlaybackTime=t,this.sendAdPlayingEvent(e,!1)}})),_defineProperty(f,"reportAdInfo",(function(t){this._adInformation||(this._adInformation=new MMAdvertisentInformation),t&&(void 0!==t.adClient&&(this._adInformation._adClient=t.adClient),void 0!==t.adId&&(this._adInformation._adId=t.adId),void 0!==t.adDuration&&(this._adInformation._adDuration=t.adDuration),void 0!==t.adPosition&&(this._adInformation._adPosition=t.adPosition),void 0!==t.adIsLinear&&(t.adIsLinear?this._adInformation._adLinear="linear":this._adInformation._adLinear="nonlinear"),void 0!==t.adCreativeType&&(this._adInformation._adCreativeType=t.adCreativeType),void 0!==t.adServer&&(this._adInformation._adServer=t.adServer),void 0!==t.adResolution&&(this._adInformation._adResolution=t.adResolution),this._adInformation._isBumper=t.isBumper,t.adPodIndex>=-1&&(this._adInformation._adPodIndex=t.adPodIndex),t.adPodLength>0&&(this._adInformation._adPodLength=t.adPodLength),t.adPositionInPod>0&&(this._adInformation._adPositionInPod=t.adPositionInPod),t.adScheduledTime>=0&&(this._adInformation._adScheduledTime=t.adScheduledTime),void 0!==t.adUrl&&(this._adInformation._adUrl=t.adUrl),void 0!==t.adCreativeId&&(this._adInformation._adCreativeId=t.adCreativeId),void 0!==t.adTitle&&(this._adInformation._adTitle=t.adTitle),void 0!==t.adBitrate&&(this._adInformation._adBitrate=t.adBitrate))})),_defineProperty(f,"isQBRDisabled",(function(){return null===this._mode||"QBRDisabled-NoMetafile"==this._mode||this._mode==MMQBRMode.QBRModeDisabled||"QBRDisabled-QMetric"==this._mode||"QBRDisabled-NoPresentationInfo"==this._mode||"QBRDisabled-NoABR"==this._mode||"QBRDisabled-LiveSessionNotSupported"==this._mode||"QBRDisabled-ContentNotSupportedForQBR"==this._mode})),_defineEnumerableProperties(f,p),f},HttpUtil=function(){var t=new XMLHttpRequest,e=function(t){return"?"+Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")};return{doGet:function(i,r){return new Promise((function(n,a){void 0!==r&&(i+=e(r)),t.open("GET",i),t.timeout=25e3,t.onload=function(){200==t.status?n(t.response):a(Error(t.statusText))},t.onerror=function(){a(Error("Network Error"))},t.abort=function(){a(Error("NetRequest Aborted"))},t.ontimeout=function(){a(Error("NetRequest timeout"))},t.send()}))},cleanUp:function(){t&&4!=t.readyState&&t.abort()}}},QBRFactoryMaker=function(){var t,e=[],i=[];function r(t,e){for(var r in i){var n=i[r];if(n.context===t&&n.name===e)return n.instance}return null}function n(e,i,r,n){var o=a(r)[e];if(o){var s=o.instance;if(!o.override)return s.apply({context:r,factory:t},n);for(var d in s=s.apply({context:r,factory:t,parent:i},n))i.hasOwnProperty(d)&&(i[d]=s[d])}return i}function a(t){var i;return e.forEach((function(e){e===t&&(i=e)})),i||(i=e.push(t)),i}return t={extend:function(t,e,i,r){var n=a(r);!n[t]&&e&&(n[t]={instance:e,override:i})},getSingletonInstance:r,setSingletonInstance:function(t,e,r){for(var n in i){var a=i[n];if(a.context===t&&a.name===e)return void(i[n].instance=r)}i.push({name:e,context:t,instance:r})},getSingletonFactory:function(t){return function(e){var a;return void 0===e&&(e={}),{getInstance:function(){return a||(a=r(e,t.__dashjs_factory_name)),a||(a=n(t.__dashjs_factory_name,t.apply({context:e},arguments),e,arguments),i.push({name:t.__dashjs_factory_name,context:e,instance:a})),a}}}},getClassFactory:function(t){return function(e){return void 0===e&&(e={}),{create:function(){return n(t.__dashjs_factory_name,t.apply({context:e},arguments),e,arguments)}}}}},t}(),MMLogger=function(){var t=isNaN(MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.log_level)?2:MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.log_level,e={VERBOSE:6,DEBUG:5,INFO:4,ANALYZE:3,WARN:2,ERROR:1,OFF:0};return{setLogLevel:function(e){e<0&&(e=0),t=e},log:function(i,r){(function(t){for(var i in e)if(i===t)return e[i];return e.OFF})(i)<=t&&console.log("["+i+"] : "+r)}}}(),MMSmartStreamingImpl=function(){var t=!1,e=new ExperienceProbe,i=null,r=!1,n=function(t){r&&console.log("mmTrace:"+(new Date).getTime()+"::"+t)},a=function(r){if(null!=r&&(n(" setPresentationInformation In - live?"+r.isLive+" duration:"+r.duration+" repsCnt:"+r.representationArray.length),1===(i=r).isLive&&(i.isLive=!0),0===i.isLive&&(i.isLive=!1),t)){e.reportMode("QBRDisabled");var a=i.isLive?-1:i.duration/1e3;e.setVideoDuration(a),e.setPresentationType(i.isLive);var o="",s="",d=0,u=0,h=i.representationArray.length,_=i.contentType;if(h)for(var f=0;f<h;f++)i.representationArray[f].width&&i.representationArray[f].height&&i.representationArray[f].width>0&&i.representationArray[f].height>0&&((0===d||d>i.representationArray[f].width*i.representationArray[f].height)&&(s=i.representationArray[f].width+"x"+i.representationArray[f].height,d=i.representationArray[f].width*i.representationArray[f].height),(0===u||u<i.representationArray[f].width*i.representationArray[f].height)&&(o=i.representationArray[f].width+"x"+i.representationArray[f].height,u=i.representationArray[f].width*i.representationArray[f].height));e.setPresentationStreamInfo(o,s,0,0,h,_)}},o=function(t){var i=t.endByte>0?t.endByte-t.startByte:-1,r=void 0,n=void 0,a=t.duration>0?parseInt(t.duration/1e3):-1,o=t.startTime>0?t.startTime/1e3:-1;-1==t.trackIdx?-1!=t.bitrate&&(r=s(t.bitrate),n=d(t.bitrate)):(r=u(t.trackIdx),n=h(t.trackIdx));var _=void 0,f=void 0;return n&&n.video&&(f=n.video),n&&n.audio&&(_=n.audio),e.SegmentInfo(r,t.bitrate,t.bitrate,void 0,void 0,a,t.sequence,o,void 0,t.trackIdx,t.trackIdx,i,void 0,f,_)},s=function(t){var e=_(t),i=void 0;return void 0!==e&&void 0!==e.width&&void 0!==e.height&&e.width>0&&e.height>0&&(i=e.width+"x"+e.height),i},d=function(t){var e=_(t),i=void 0;return e&&(i=e.codecIdentifier),i},u=function(t){var e=f(t),i=void 0;return void 0!==e&&void 0!==e.width&&void 0!==e.height&&e.width>0&&e.height>0&&(i=e.width+"x"+e.height),i},h=function(t){var e=f(t),i=void 0;return e&&(i=e.codecIdentifier),i},_=function(t){var e=void 0;if(i)for(var r=0;r<i.representationArray.length;r++)if(i.representationArray[r].bitrate===t){e=i.representationArray[r];break}return e},f=function(t){var e=void 0;if(i)for(var r=0;r<i.representationArray.length;r++)if(i.representationArray[r].trackIdx===t){e=i.representationArray[r];break}return e};return{enableLogTrace:function(t){r=t},updateSubscriberID:function(t){e.updateSubscriberID(t)},updateSubscriber:function(t,i,r){e.updateSubscriber(t,i,r)},getRegistrationStatus:function(){return t},getRegistrationStatusWithBackend:function(){return e.getRegistrationStatusWithBackend()},registerMMSmartStreaming:function(i,r,a,o,s,d,u,h){n(" registerMMSmartStreaming In "+i+" "+r+" "+o+" "+s+" "+a),e.reset(),e.registerMMSmartStreaming(i,r,o,s,d,u,h),e.reportHintFileVersion(MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.hintFileVersion),e.reportComponent(a),t=!0},initializeSession:function(t,r,o,s){return n(" initializeSession In mode: "+t+" url:"+r+" metaurl: "+o+" contentMetadata:"+s),i=null,e.reset(),e.initializeSession(t,r,o,s).then((function(t){var r=JSON.parse(t);return void 0!==r.producerURL?(e.reportRegistrationSuccess(r),e.reportAssetID(s.assetID,s.assetName,s.videoId),a(i),MMLogger.log("VERBOSE"," initializing QEngine"),new Promise((function(t,i){MMLogger.log("VERBOSE","InitializeSession Success"),t(r),r&&e.setSDKQoEConfig(r.mmVideo,r.mmAd)}))):(e.reportRegistrationFailure(),e.reset(),new Promise((function(t,e){MMLogger.log("VERBOSE","Playback Registration Failed"),e("Playback Registration Failed.")})))})).catch((function(t){return"QBRSDK : QEngine cannot be initialized...."!=t?(t="Experience Probe Initialisation Failed.",e.reportRegistrationFailure(),e.reset()):t="MMSmartStreaming : QBR component cannot be initialized...",a(i),new Promise((function(e,i){MMLogger.log("VERBOSE",t),i(t)}))}))},setPresentationInformation:a,reportStreamInfo:function(t,i,r){e.reportStreamInfo(t,i,r)},reportNetworkInfo:function(t,i,r,n,a){e.reportNetworkInfo(t,i,r,n,a)},reportChunkRequest:function(i){if(t){n("reportChunkRequest In");var r=o(i);e.addSegInfo(r)}},reportDownloadRate:function(i){t&&(n(" reportDownloadRate In :"+i),e.setBandwidth(i))},reportBufferLength:function(i){t&&(n(" reportBufferLength In :"+i),e.reportBufferLength(i))},reportCustomMetadata:function(i,r){t&&(n(" reportCustomMetadata In"),e.setCustomTag(i,r))},reportPlaybackPosition:function(i){t&&(n(" reportPlaybackPosition In :"+i),e.setPlaybackPos(i))},reportNetworkType:function(i){t&&(n(" reportNetworkType In"),e.reportNetworkType(i))},reportMetricValue:function(i,r){t&&(n(" reportMetricValue In"),e.reportMetricValue(i,r))},reportDeviceInfo:function(t,i,r,a,o,s,d,u){n(" reportDeviceInfo In "),e.reportDeviceInfo(t,i,r,a,o,s,d,u),"CHROMECAST"===i?e.reportDeviceType("ChromeCast"):"SMARTTV"===i&&e.reportDeviceType("SmartTV")},reportPlayerInfo:function(t,i,r){n(" reportPlayerInfo In"),e.reportPlayerInfo(t,i,r)},reportAppInfo:function(t,i){n(" reportAppInfo In"),e.reportAppInfo(t,i)},reportPlayerResolution:function(t){n(" reportPlayerResolution In"),e.reportPlayerResolution(t)},reportDeviceCapabilities:function(t){n(" reportdeviceCapabilities In"),e.reportDeviceCapabilities(t)},reportVideoQuality:function(t){n(" reportVideoQuality In"),e.reportVideoQuality(t)},reportExperimentName:function(t){e.reportExperimentName(t)},reportSubPropertyId:function(t){e.reportSubPropertyId(t)},reportViewSessionId:function(t){e.reportViewSessionId(t)},reportBasePlayerInfo:function(t,i){e.reportBasePlayerInfo(t,i)},reportManifestLoaded:function(){n(" reportManifestLoaded In"),e.reportManifestLoaded()},reportDeviceId:function(t){n(" reportDeviceId In"),e.reportDeviceId(t)},reportPlayerState:function(t){n(" reportPlayerState In "+t),e.reportPlayerState(t)},notifyPackager:function(t,i){e.notifyPackager(t,i)},setSESRequirements:function(t){e.setSESRequirements(t)},setSESURL:function(t){e.setSESURL(t)},reportTrackinfo:function(t,i,r,n,a){e.reportTrackinfo(t,i,r,n,a)},reportUserInitiatedPlayback:function(){n(" reportUserInitiatedPlayback In "),e.reportUserInitiatedPlayback()},reportBufferingStarted:function(){n(" reportBufferingStarted In "),e.reportBufferingStarted()},reportBufferingCompleted:function(){n(" reportBufferingCompleted In "),e.reportBufferingCompleted()},reportEventWithValue:function(t,i){e.reportEventWithValue(t,i)},addCustomSegInfo:function(t){e.addCustomSegInfo(t)},reportABRSwitch:function(i,r){t&&e.isQBRDisabled()&&(n(" reportABRSwitch "+i+"->"+r),e.reportABRSwitch(i,r))},reportFrameLoss:function(i){t&&(n(" reportFrameLoss In "+i),e.reportFrameLoss(i))},reportPresentationSize:function(t,i){n("reportPresentationSize w:"+t+" h:"+i),e.reportPresentationSize(t,i)},reportError:function(i,r){t&&(n(" reportError In "+i),e.reportError(i,r))},reportPlayerSeekCompleted:function(i){t&&(n(" reportPlayerSeekCompleted In"),e.reportPlayerSeekCompleted(i))},reportPlayerSeekStarted:function(){t&&(n(" reportPlayerSeekStarted In"),e.reportPlayerSeekStarted())},reportResolutionChange:function(i){t&&(n(" reportResolutionChange In"),e.reportResolutionChange(i))},reportVolumeChange:function(i){t&&(n(" reportVolumeChange In"),e.reportVolumeChange(i))},reportPlaybackRateChange:function(){t&&(n(" reportPlaybackRateChange In"),e.reportPlaybackRateChange())},reportDurationChange:function(){t&&(n(" reportDurationChange In"),e.reportDurationChange())},reportSDKVersion:function(t){e.reportSDKVersion(t)},getSDKVersion:function(){return e.getSDKVersion()},reportWifiSSID:function(i){t&&(n(" reportWifiSSID In"),e.reportWifiSSID(i))},reportWifiSignalStrenthPercentage:function(i){t&&(n(" reportWifiSignalStrenthPercentage In"),e.reportWifiSignalStrenthPercentage(i))},reportWifiDataRate:function(i){t&&(n(" reportWifiDataRate In"),e.reportWifiDataRate(i))},reportAdInfo:function(i){t&&(n(" reportAdInfo "),i&&e.reportAdInfo(i))},reportAdError:function(t,i){n(" reportAdError "+t),e.reportAdError(t,i)},reportAdBufferingStarted:function(){n(" reportAdBufferingStarted In "),e.reportAdBufferingStarted()},reportAdBufferingCompleted:function(){n(" reportAdBufferingCompleted In "),e.reportAdBufferingCompleted()},reportAdPlaybackTime:function(i){t&&(n(" reportAdPlaybackTime "+i),e.reportAdPlaybackTime(i))},reportAdState:function(i){t&&(n(" reportAdState "+i),e.reportAdState(i))},reportComponent:function(i){t&&(n(" reportComponent "+i),e.reportComponent(i))},setRegistrationStatus:function(e){t=e},getSessionId:function(){if(t)return e.sessionId}}},MMSmartStreaming=function(){var t;return{createInstance:function(t){var e,i=Object.create((e=new MMSmartStreamingImpl,{getSDKVersion:function(){return e.getSDKVersion()},getRegistrationStatus:function(){return e.getRegistrationStatus()},getRegistrationStatusWithBackend:function(){return e.getRegistrationStatusWithBackend()},registerMMSmartStreaming:function(t,i,r,n,a,o,s,d){return e.registerMMSmartStreaming(t,i,r,n,a,o,s,d)},updateSubscriberID:function(t){return e.updateSubscriberID(t)},reportDeviceInfo:function(t,i,r,n,a,o,s,d){e.reportDeviceInfo(t,i,r,n,a,o,s,d)},reportPlayerInfo:function(t,i,r){e.reportPlayerInfo(t,i,r)},reportDeviceCapabilities:function(t){e.reportDeviceCapabilities(t)},reportAppInfo:function(t,i){e.reportAppInfo(t,i)},reportPlayerResolution:function(t){e.reportPlayerResolution(t)},reportVideoQuality:function(t){e.reportVideoQuality(t)},reportExperimentName:function(t){e.reportExperimentName(t)},reportSubPropertyId:function(t){e.reportSubPropertyId(t)},reportViewSessionId:function(t){e.reportViewSessionId(t)},reportBasePlayerInfo:function(t,i){e.reportBasePlayerInfo(t,i)},reportManifestLoaded:function(){e.reportManifestLoaded()},reportDeviceId:function(t){e.reportDeviceId(t)},initializeSession:function(t,i,r,n){return e.initializeSession(t,i,r,n)},setPresentationInformation:function(t){e.setPresentationInformation(t)},reportStreamInfo:function(t,i,r){e.reportStreamInfo(t,i,r)},reportNetworkInfo:function(t,i,r,n,a){e.reportNetworkInfo(t,i,r,n,a)},reportChunkRequest:function(t){e.reportChunkRequest(t)},reportDownloadRate:function(t){e.reportDownloadRate(t)},reportBufferLength:function(t){e.reportBufferLength(t)},reportCustomMetadata:function(t,i){e.reportCustomMetadata(t,i)},reportPlaybackPosition:function(t){e.reportPlaybackPosition(t)},reportNetworkType:function(t){e.reportNetworkType(t)},reportMetricValue:function(t,i){e.reportMetricValue(t,i)},reportBufferingStarted:function(){e.reportBufferingStarted()},reportBufferingCompleted:function(){e.reportBufferingCompleted()},reportEventWithValue:function(t,i){e.reportEventWithValue(t,i)},addCustomSegInfo:function(t){e.addCustomSegInfo(t)},reportUserInitiatedPlayback:function(){e.reportUserInitiatedPlayback()},reportPlayerState:function(t){e.reportPlayerState(t)},notifyPackager:function(t,i){e.notifyPackager(t,i)},setSESRequirements:function(t){e.setSESRequirements(t)},setSESURL:function(t){e.setSESURL(t)},reportABRSwitch:function(t,i){e.reportABRSwitch(t,i)},reportFrameLoss:function(t){e.reportFrameLoss(t)},reportPresentationSize:function(t,i){e.reportPresentationSize(t,i)},reportError:function(t,i){e.reportError(t,i)},reportPlayerSeekCompleted:function(t){e.reportPlayerSeekCompleted(t)},reportPlayerSeekStarted:function(){e.reportPlayerSeekStarted()},reportResolutionChange:function(t){e.reportResolutionChange(t)},reportVolumeChange:function(t){e.reportVolumeChange(t)},reportPlaybackRateChange:function(){e.reportPlaybackRateChange()},reportDurationChange:function(){e.reportDurationChange()},reportSDKVersion:function(t){e.reportSDKVersion(t)},reportWifiSSID:function(t){e.reportWifiSSID(t)},reportWifiSignalStrengthPercentage:function(t){e.reportWifiSignalStrenthPercentage(t)},reportWifiDataRate:function(t){e.reportWifiDataRate(t)},reportAdState:function(t){e.reportAdState(t)},reportAdInfo1:function(t,i,r,n,a,o,s,d){e.reportAdInfo(t,i,r,n,a,o,s,d)},reportAdInfo:function(t){e.reportAdInfo(t)},reportAdPlaybackTime:function(t){e.reportAdPlaybackTime(t)},reportAdError:function(t,i){e.reportAdError(t,i)},reportAdBufferingStarted:function(){e.reportAdBufferingStarted()},reportAdBufferingCompleted:function(){e.reportAdBufferingCompleted()},enableLogTrace:function(t){e.enableLogTrace(t)},updateSubscriber:function(t,i,r){return e.updateSubscriber(t,i,r)},setRegistrationStatus:function(t){e.setRegistrationStatus(t)},getSessionId:function(){return e.getSessionId()},reportTrackinfo:function(t,i,r,n,a){return e.reportTrackinfo(t,i,r,n,a)}}));return i.__dashjs_factory_name="MMSmartStreamingSdk",QBRFactoryMaker.setSingletonInstance(t,"MMSmartStreamingSdk",i),i},getInstance:function(e){if(void 0===e)return t||(t=this.createInstance(this));var i=QBRFactoryMaker.getSingletonInstance(e,"MMSmartStreamingSdk");return i||console.log("ERROR MMSDK Instance not created!"),i}}}(),mmStreamType=Object.freeze({DASH:"dash",HLS:"hls",MSS:"mss",MP4:"mp4"}),mmReactNativePlayerAdapter=function(){var t=Object.freeze({READY:0,PLAYING:1,PAUSED:2,STOPPED:3}),e=Object.freeze({IDLE:1,BUFFERING_STARTED:2,BUFFERING_COMPLETED:3}),i=Object.freeze({IDLE:1,SEEK_STARTED:2,SEEK_COMPLETED:3}),r=MMSmartStreaming.createInstance(this),n=!1,a=!1,o=void 0,s=void 0,d=e.IDLE,u=i.IDLE,h=!1,_=!1;r.reportSDKVersion("RN_1.3.1");var f=function(){d===e.BUFFERING_STARTED&&(r.reportBufferingCompleted(),d=e.BUFFERING_COMPLETED)},p=function(){o!==t.PLAYING&&o!==t.PAUSED||u!==i.SEEK_STARTED&&(r.reportPlayerSeekStarted(),u=i.SEEK_STARTED)},c=function(t){u===i.SEEK_STARTED&&(t||(t=s),r.reportPlayerSeekCompleted(t),u=i.SEEK_COMPLETED)},S=function(t){var e;return t&&(-1!==t.indexOf(".m3u8")?e="HLS":-1!==t.indexOf(".mpd")?e="DASH":-1!==t.indexOf("/Manifest")?e="MSS":-1!==t.indexOf("mp4")&&(e="MP4")),e};return{registerMMSmartStreaming:function(t,e,i,n,a,o,s){r.getRegistrationStatus()||r.registerMMSmartStreaming(t,e,"HTML5JSSDK",i,n,a,o,s)},reportPlayerInfo:function(t,e,i){r.reportPlayerInfo(t,e,i)},reportBasePlayerInfo:function(t,e){r.reportBasePlayerInfo(t,e)},reportAppInfo:function(t,e){r.reportAppInfo(t,e)},reportExperimentName:function(t){r.reportExperimentName(t)},reportSubPropertyId:function(t){r.reportSubPropertyId(t)},reportViewSessionId:function(t){r.reportViewSessionId(t)},initialize:function(t,_){if(!a){if(n=!1,a=!1,o=void 0,s=0,d=e.IDLE,u=i.IDLE,h=!1,console.log("MMSmartStreaming- "+r.getSDKVersion()),t&&""!==t||(t="NA"),r.initializeSession(MMQBRMode.QBRModeDisabled,t,"",_).catch((function(t){console.log("SDK Init Failed: "+t)})),!h){var f=S(t);r.reportStreamInfo(f,"",f),h=!0}a=!0}},reportUserInitiatedPlayback:function(){!1===n&&void 0===o&&(r.reportUserInitiatedPlayback(),o=t.READY,n=!0)},reportPresentationInfo:function(t,e,i){var n=MMPresentationInfo(t,e,i);r.setPresentationInformation(n)},reportPlayerState:function(t){},reportBufferingStarted:function(){o!==t.PLAYING&&o!==t.PAUSED||d!==e.BUFFERING_STARTED&&(r.reportBufferingStarted(),d=e.BUFFERING_STARTED)},reportBufferingCompleted:f,reportPlayerSeekStarted:p,reportPlayerSeekCompleted:c,reportPlaybackPosition:function(t){if(t&&t>0){var e=Math.abs(t-s);e>240&&e<=1500?(f(),c()):e>4e3&&p()}r.reportPlaybackPosition(t),s=t},reportDownloadRate:function(t){r.reportDownloadRate(t)},reportBandwidth:function(t){var e=MMChunkInformation(void 0,t,void 0,void 0,void 0,void 0,void 0,void 0);r.reportChunkRequest(e)},reportError:function(t){t&&r.reportError(t,s)},setDeviceInfo:function(t){t&&r.reportDeviceInfo(void 0,void 0,void 0,void 0,void 0,t,void 0,void 0)},reportDeviceId:function(t){t&&r.reportDeviceId(t)},reportCDN:function(t){t&&""!==t&&r.reportMetricValue(MMOverridableMetric.ServerAddress,t)},reportStreamInfo:function(t,e,i){r.reportStreamInfo(t,e,i),h=!0},enableLogTrace:function(t){null==t?t=!1:"boolean"==typeof t&&(_=t)},MMLog:function(t){_&&console.log("[MMLog] => "+t)},reportCustomPlayerState:function(e){if(void 0!==o)switch(e){case MMPlayerState.PLAYING:r.reportPlayerState(MMPlayerState.PLAYING),o=t.PLAYING;break;case MMPlayerState.PAUSED:o!==t.READY&&o!==t.PLAYING||(r.reportPlayerState(MMPlayerState.PAUSED),o=t.PAUSED);break;case MMPlayerState.STOPPED:o!==t.STOPPED&&(r.reportPlayerState(MMPlayerState.STOPPED),o=t.STOPPED);break;default:console.log("Invalid State")}}}},AdapterSingletonClass=_createClass((function t(){return _classCallCheck(this,t),void 0===t.instance&&(t.instance=mmReactNativePlayerAdapter()),t.instance}));_defineProperty2(AdapterSingletonClass,"instance",void 0);var MMCustomAdapter=exports.MMCustomAdapter=function(){var t=new AdapterSingletonClass;return{reportPlayerState:function(e){t.MMLog("reportPlayerState called with playerState: "+e),t.reportCustomPlayerState(e)}}},MMReactNativeVideoSDK=exports.MMReactNativeVideoSDK=function(t){return function(e){var i=e.source,r=e.mmOptions,n=_objectWithoutProperties(e,_excluded),a=new AdapterSingletonClass,o=r.register,s=o.customerId,d=o.subscriberId,u=o.subscriberType,h=o.subscriberTag,_=o.hashSubscriberId,f=o.playerName,p=o.playerBrand,c=o.playerModel,S=o.playerVersion,l=o.basePlayerName,m=o.basePlayerVersion,I=o.domainName,P=o.applicationName,E=o.applicationVersion,v=o.deviceMarketingName,y=r.contentMetadata,b=y.assetName,T=y.assetId,D=y.videoId,M=y.contentType,R=y.genre,A=y.drmProtection,g=y.episodeNumber,C=y.season,N=y.seriesTitle,B=y.isLive,L=r.streamInfo,O=L.mediaType,x=L.streamFormat,k=L.sourceType,U=r.subPropertyId,F=r.experimentName,q=r.viewSessionId,w=r.customTags,V=r.deviceId,W=r.cdn,G=r.enableLogTrace,K={assetName:b,assetId:T,videoId:D,contentType:M,genre:R,drmProtection:A,episodeNumber:g,season:C,seriesTitle:N,customTags:w},Q="";i&&i.uri&&(Q=i.uri),(0,_react.useEffect)((function(){a.registerMMSmartStreaming(f,s,d,I,u,h,_),a.reportPlayerInfo(p,c,S),a.reportAppInfo(P,E),a.setDeviceInfo(v),a.reportExperimentName(F),a.reportSubPropertyId(U),a.reportBasePlayerInfo(l,m),a.reportDeviceId(V),a.enableLogTrace(G)}),[]);var z=function(t,e){return function(){t&&t.apply(void 0,arguments),e&&e.apply(void 0,arguments)}};return _react.default.createElement(t,_extends({source:i,reportBandwidth:!0},n,{onLoadStart:z((function(){a.MMLog("onLoadStart called with mediaURL: "+Q),a.reportViewSessionId(q),a.initialize(Q,K),a.reportUserInitiatedPlayback(),a.reportCDN(W),a.reportStreamInfo(x,O,k)}),n.onLoadStart),onLoad:z((function(t){if(a.MMLog("onLoad called with mediaURL: "+Q),t){var e=B;e||(e=!1);var i=t.videoTracks,r=[];i&&Array.isArray(i)&&i.forEach((function(t,e){var i=MMRepresentation(e,t.bitrate,t.width,t.height,"");r.push(i)})),a.reportPresentationInfo(e,1e3*t.duration,r)}}),n.onLoad),onPlaybackRateChange:z((function(t){a.MMLog("onPlaybackRateChange called with playbackRate: "+t.playbackRate),t&&(0===t.playbackRate?(a.MMLog("Player State Changed to PAUSED inside onPlaybackRateChange"),a.reportPlayerState(MMPlayerState.PAUSED)):t.playbackRate>0&&a.reportPlayerState(MMPlayerState.PLAYING))}),n.onPlaybackRateChange),onProgress:z((function(t){a.MMLog("onProgress called with currentTime: "+t.currentTime),a.reportPlaybackPosition(1e3*t.currentTime)}),n.onProgress),onBuffer:z((function(t){a.MMLog("onBuffer called with isBuffering: "+t.isBuffering),t.isBuffering&&a.reportBufferingStarted()}),n.onBuffer),onError:z((function(t){if(a.MMLog("onError called with error: "+JSON.stringify(t)),t){var e=t.error||{},i="";e.errorCode&&(i+=e.errorCode+"_"),i+=(e.errorString||"Unknown Error")+"_",i+=JSON.stringify(e),a.reportError(i)}}),n.onError),onEnd:z((function(){a.MMLog("onEnd called"),a.reportPlayerState(MMPlayerState.STOPPED)}),n.onEnd),onBandwidthUpdate:z((function(t){a.MMLog("onBandwidthUpdate called with bitrate: "+t.bitrate),t.bitrate&&t.bitrate>0&&(a.reportDownloadRate(t.bitrate),a.reportBandwidth(t.bitrate))}),n.onBandwidthUpdate)}))}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MMReactNativeVideoSDK=exports.MMPlayerState=exports.MMCustomAdapter=void 0,exports.RenditionInfo=RenditionInfo;var _payloadKeyMap,_react=_interopRequireWildcard(require("react")),_excluded=["source","mmOptions"];function _interopRequireWildcard(t,e){if("function"==typeof WeakMap)var i=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(t,e){if(!e&&t&&t.__esModule)return t;var n,a,o={__proto__:null,default:t};if(null===t||"object"!=_typeof2(t)&&"function"!=typeof t)return o;if(n=e?r:i){if(n.has(t))return n.get(t);n.set(t,o)}for(var s in t)"default"!==s&&{}.hasOwnProperty.call(t,s)&&((a=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,s))&&(a.get||a.set)?n(o,s,a):o[s]=t[s]);return o})(t,e)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},_extends.apply(null,arguments)}function _objectWithoutProperties(t,e){if(null==t)return{};var i,r,n=_objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)i=a[r],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_toPropertyKey(r.key),r)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _typeof2(t){return _typeof2="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},_typeof2(t)}function _defineProperty2(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==_typeof2(e)?e:e+""}function _toPrimitive(t,e){if("object"!=_typeof2(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=_typeof2(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var MMChunkInformation=function(t,e,i,r,n,a,o,s){var d={};return d.trackIdx=void 0===t?-1:t,d.trackIdx=void 0===t?-1:t,d.bitrate=void 0===e?-1:e,d.sequence=void 0===i?-1:i,d.startTime=void 0===n?-1:n,d.startByte=void 0===o?-1:o,d.endByte=void 0===s?-1:s,d.duration=void 0===a?-1:a,d.initStartByte=-1,d.initEndByte=-1,d.resourceURL=r||null,d},MMRepresentation=function(t,e,i,r,n,a){var o={};return o.trackIdx=t||0,o.bitrate=e||0,o.width=i||0,o.height=r||0,o.codecIdentifier=n||{},o.segmentInfo=a||[],o},MMPresentationInfo=function(t,e,i,r){var n={};return 1===t&&(t=!0),n.isLive=t||!1,n.duration=e||-1,n.representationArray=i||[],n.contentType=r||"",n},MMAdState=Object.freeze({AD_BLOCKED:1,AD_IMPRESSION:2,AD_STARTED:3,AD_PLAYING:4,AD_CLICKED:5,AD_PAUSED:6,AD_RESUMED:7,AD_SKIPPED:8,AD_COMPLETED:9,AD_ERROR:10,AD_REQUEST:11,AD_PLAY:12,AD_BUFFERING:13,AD_MIDPOINT:14,AD_FIRST_QUARTILE:15,AD_THIRD_QUARTILE:16,AD_ENDED:17}),MMAdInfo=function(){var t={adClient:void 0,adId:void 0,adDuration:0,adPosition:void 0,adIsLinear:!1,adCreativeType:void 0,adServer:void 0,adResolution:void 0,adPodIndex:void 0,adPositionInPod:void 0,adPodLength:void 0,isBumper:!1,adScheduledTime:-1,adCreativeId:void 0,adUrl:void 0,adTitle:void 0,adBitrate:void 0};return t},MMPlayerState=exports.MMPlayerState=Object.freeze({PLAYING:1,PAUSED:2,STOPPED:3}),SeekState=Object.freeze({SeekStarted:1,SeekCompleted:2,Playing:3}),MMQBRMode=Object.freeze({QBRModeDisabled:"QBRDisabled",QBRModeQuality:"QBRQuality",QBRModeBitsave:"QBRBitsave",QBRModeCostsave:"QBRCostsave"}),MMConnectionInfo=Object.freeze({Cellular:"Cellular",Cellular_2G:"Cellular_2G",Cellular_3G:"Cellular_3G",Cellular_4G:"Cellular_4G",Cellular_LTE:"Cellular_LTE",Cellular_5G:"Cellular_5G",NotReachable:"WebNotReachable",Wifi:"Wifi",WiredNetwork:"WiredNetwork"}),payloadKeyMap=(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap={timestamp:"t",pbTime:"pt",playDur:"pd",interval:"i",version:"v",qubitData:"qd",streamID:"sd",custId:"ci",dataSrc:"dsr",playerName:"pn",sessionId:"si",domainName:"dn",streamURL:"su",playerVersion:"pv",pb:"pb",pm:"pm",experimentName:"exn",subPropertyId:"spi",viewSessionId:"vsi",basePlayerName:"bpn",basePlayerVersion:"bpv",subscriberId:"sbi",subscriberType:"sbt",subscriberTag:"sg",assetId:"ai",assetName:"an",videoId:"vi",mode:"m",isLive:"il",pId:"pi",sst:"sst",sourceType:"sct",parentCustId:"pci",streamMode:"sm",mediaType:"mt",sourceHostName:"shn",streamInfo:"sif",totalDuration:"td",maxRes:"xr",minRes:"nr",maxFps:"xf",minFps:"nf",numOfProfile:"np",streamFormat:"sf",videoTrack:"vk",subtitleTrack:"sk",audioTrack:"ak",isVDSActive:"iv",isSubtitleActive:"is",contentMetadata:"cm"},"assetId","ai"),"assetName","an"),"videoId","vi"),"contentType","ct"),"drmProtection","dp"),"episodeNumber","en"),"genre","g"),"season","se"),"seriesTitle","st"),"videoType","vt"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"segInfo","sgi"),"res","r"),"cbrBitrate","cb"),"vCodec","vc"),"aCodec","ac"),"downloadRate","dr"),"timestamp","t"),"qbrBitrate","qb"),"qbrQual","qq"),"cbrQual","cq"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"dur","du"),"fps","f"),"seqNum","sn"),"startTime","s"),"profileNum","pfn"),"lastTS","lts"),"cbrSize","cz"),"qbrSize","qz"),"cbrProfileNum","cp"),"bufferLength","bl"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"pbEventInfo","pe"),"event","e"),"desc","dsc"),"id","id"),"pbTime","pt"),"playbackStatus","ps"),"pbInfo","pif"),"timestamp","t"),"bwInUse","bu"),"pbTime","pt"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"progressMark","gm"),"latency","l"),"buffWait","bw"),"buffWaitType","bwt"),"sumBuffWait","sb"),"sumBuffWaitCIRR","sbc"),"sumBuffWaitVRT","sbv"),"sumBuffWaitAAD","sba"),"frameloss","fl"),"upShiftCount","us"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"downShiftCount","ds"),"pauseDuration","ud"),"sdkInfo","sdi"),"sdkVersion","sv"),"hFileVersion","hv"),"sdkType","skt"),"clientInfo","cif"),"appName","apn"),"appVersion","apv"),"deviceMarketingName","dm"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"scrnRes","sr"),"deviceId","di"),"deviceCapabilities","dc"),"cdn","c"),"operator","op"),"nwType","nt"),"wifissid","ws"),"wifidatarate","wd"),"signalstrength","ss"),"platform","p"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"location","l"),"device","d"),"brand","br"),"model","ml"),"videoQuality","vq"),"userAgent","ua"),"browserVersion","bv"),"browser","b"),"version","v"),"clientIP","cip"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"playerRes","pr"),"asn","asn"),"adInfo","aif"),"adId","id"),"adClient","cl"),"adCreative","c"),"adCreativeId","cid"),"adCreativeType","ct"),"adDuration","d"),"adInterval","i"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"adPosition","p"),"adLinear","al"),"adSystem","s"),"adPodIndex","pi"),"adPodPosition","pp"),"adPodLength","pl"),"adResolution","r"),"adBitrate","b"),"adTitle","t"),"adUrl","u"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"isBumper","ib"),"appEventInfo","aei"),"eventName","en"),"eventType","et"),"eventData","ed"),"currentScreen","cs"),"isGraceFul","ig"),"userInfo","ui"),"profileId","pid"),"userType","tp"),_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_payloadKeyMap,"userTag","tg"),"userData","d"),"referralId","rid"),"referralData","rd"),"diagnostics","di"),"customTags","ctg")),MMOverridableMetric=Object.freeze({Latency:"Latency",ServerAddress:"CDN",DurationWatched:"DurationWatched",streamURL:"streamURL"}),MMSTREAMSMARTERCONSTANTS={SDK_REGISTER_URL:"https://register.mediamelon.com/mm-apis/register/",SDK_CONFIG:{sdkVersion:"JSSDKv4.6.0_",hintFileVersion:"2.0.0",EP_SCHEMA_VERSION:"2.0.0",platform:"Browser",qmetric:!0,statistics:!1,log_level:2},SDK_BUILD_VERSION:"17032021"},MMMD5=function(t){var e=function(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i},i=function(t,i,r,n,a,o){return e((s=e(e(i,t),e(n,o)))<<(d=a)|s>>>32-d,r);var s,d},r=function(t,e,r,n,a,o,s){return i(e&r|~e&n,t,e,a,o,s)},n=function(t,e,r,n,a,o,s){return i(e&n|r&~n,t,e,a,o,s)},a=function(t,e,r,n,a,o,s){return i(e^r^n,t,e,a,o,s)},o=function(t,e,r,n,a,o,s){return i(r^(e|~n),t,e,a,o,s)},s=function(t){return function(t){var e,i="",r=32*t.length;for(e=0;e<r;e+=8)i+=String.fromCharCode(t[e>>5]>>>e%32&255);return i}(function(t,i){var s,d,u,h,_;t[i>>5]|=128<<i%32,t[14+(i+64>>>9<<4)]=i;var f=1732584193,p=-271733879,c=-1732584194,S=271733878;for(s=0;s<t.length;s+=16)d=f,u=p,h=c,_=S,f=r(f,p,c,S,t[s],7,-680876936),S=r(S,f,p,c,t[s+1],12,-389564586),c=r(c,S,f,p,t[s+2],17,606105819),p=r(p,c,S,f,t[s+3],22,-1044525330),f=r(f,p,c,S,t[s+4],7,-176418897),S=r(S,f,p,c,t[s+5],12,1200080426),c=r(c,S,f,p,t[s+6],17,-1473231341),p=r(p,c,S,f,t[s+7],22,-45705983),f=r(f,p,c,S,t[s+8],7,1770035416),S=r(S,f,p,c,t[s+9],12,-1958414417),c=r(c,S,f,p,t[s+10],17,-42063),p=r(p,c,S,f,t[s+11],22,-1990404162),f=r(f,p,c,S,t[s+12],7,1804603682),S=r(S,f,p,c,t[s+13],12,-40341101),c=r(c,S,f,p,t[s+14],17,-1502002290),p=r(p,c,S,f,t[s+15],22,1236535329),f=n(f,p,c,S,t[s+1],5,-165796510),S=n(S,f,p,c,t[s+6],9,-1069501632),c=n(c,S,f,p,t[s+11],14,643717713),p=n(p,c,S,f,t[s],20,-373897302),f=n(f,p,c,S,t[s+5],5,-701558691),S=n(S,f,p,c,t[s+10],9,38016083),c=n(c,S,f,p,t[s+15],14,-660478335),p=n(p,c,S,f,t[s+4],20,-405537848),f=n(f,p,c,S,t[s+9],5,568446438),S=n(S,f,p,c,t[s+14],9,-1019803690),c=n(c,S,f,p,t[s+3],14,-187363961),p=n(p,c,S,f,t[s+8],20,1163531501),f=n(f,p,c,S,t[s+13],5,-1444681467),S=n(S,f,p,c,t[s+2],9,-51403784),c=n(c,S,f,p,t[s+7],14,1735328473),p=n(p,c,S,f,t[s+12],20,-1926607734),f=a(f,p,c,S,t[s+5],4,-378558),S=a(S,f,p,c,t[s+8],11,-2022574463),c=a(c,S,f,p,t[s+11],16,1839030562),p=a(p,c,S,f,t[s+14],23,-35309556),f=a(f,p,c,S,t[s+1],4,-1530992060),S=a(S,f,p,c,t[s+4],11,1272893353),c=a(c,S,f,p,t[s+7],16,-155497632),p=a(p,c,S,f,t[s+10],23,-1094730640),f=a(f,p,c,S,t[s+13],4,681279174),S=a(S,f,p,c,t[s],11,-358537222),c=a(c,S,f,p,t[s+3],16,-722521979),p=a(p,c,S,f,t[s+6],23,76029189),f=a(f,p,c,S,t[s+9],4,-640364487),S=a(S,f,p,c,t[s+12],11,-421815835),c=a(c,S,f,p,t[s+15],16,530742520),p=a(p,c,S,f,t[s+2],23,-995338651),f=o(f,p,c,S,t[s],6,-198630844),S=o(S,f,p,c,t[s+7],10,1126891415),c=o(c,S,f,p,t[s+14],15,-1416354905),p=o(p,c,S,f,t[s+5],21,-57434055),f=o(f,p,c,S,t[s+12],6,1700485571),S=o(S,f,p,c,t[s+3],10,-1894986606),c=o(c,S,f,p,t[s+10],15,-1051523),p=o(p,c,S,f,t[s+1],21,-2054922799),f=o(f,p,c,S,t[s+8],6,1873313359),S=o(S,f,p,c,t[s+15],10,-30611744),c=o(c,S,f,p,t[s+6],15,-1560198380),p=o(p,c,S,f,t[s+13],21,1309151649),f=o(f,p,c,S,t[s+4],6,-145523070),S=o(S,f,p,c,t[s+11],10,-1120210379),c=o(c,S,f,p,t[s+2],15,718787259),p=o(p,c,S,f,t[s+9],21,-343485551),f=e(f,d),p=e(p,u),c=e(c,h),S=e(S,_);return[f,p,c,S]}(function(t){var e,i=[];for(i[(t.length>>2)-1]=void 0,e=0;e<i.length;e+=1)i[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)i[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return i}(t),8*t.length))},d=function(t){return s(unescape(encodeURIComponent(t)))},u=function(t){return function(t){var e,i,r="0123456789abcdef",n="";for(i=0;i<t.length;i+=1)e=t.charCodeAt(i),n+=r.charAt(e>>>4&15)+r.charAt(15&e);return n}(d(t))};return{mm_md5:function(t){return u(t)},hexMD5:u,rawMD5:d}};function _defineEnumerableProperties(t,e){for(var i in e){(a=e[i]).configurable=a.enumerable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,i,a)}if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n++){var a,o=r[n];(a=e[o]).configurable=a.enumerable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,o,a)}return t}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _typeof(t){return _typeof="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},_typeof(t)}var MMAdvertisentInformation={_adClient:void 0,_adId:void 0,_adPosition:void 0,_adDuration:void 0,_adResolution:void 0,_adLinear:void 0,_adCreativeType:void 0,_adServer:void 0,_prevAdState:void 0,_playSent:!1,_adCreativeId:void 0,_adTitle:void 0,_adBitrate:void 0,_adUrl:void 0,_adPlaybackStartWallClockTime:0,_adplaydur:0,_adPlaybackTime:0,_adLastPlayingEventTimeStamp:-1,_adLastAdEventTimeStamp:-1,_isBumper:!1,_adPodIndex:-2,_adPodLength:-1,_adPositionInPod:-1,_adScheduledTime:-1},MMExperienceProbeState=Object.freeze({IDLE:0,INITIALIZED:1,ONLOAD_SENT:2,STARTED:3,STOPPED:4,ERROR:5}),ExperienceProbe=function(){var t,e,i,r,n,a,o,s,d,u,h,_,f,p;return _defineProperty(f=_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2(_defineProperty2({_httpUtil:void 0,_playerName:void 0,_customerID:void 0,_subscriberID:void 0,_hashSubscriberID:!1,_assetID:void 0,_assetName:void 0,_videoId:void 0,_contentMetadata:void 0,_domainName:void 0,_component:void 0,_inProgress:!1,_simulatedEndedSent:!1,_mode:null,_modeFromResponse:null,_timerObj:null,_timerObj2:null,_timerTimestampSynchro:null,_regStatus:"",_enableVideoQoE:!0,_enableAdQoE:!0,_sdkVersion:"",_hintFileVersion:"",_playDur:0,_latencyStartTime:0,_enableEP:!1,_KAdKeepAliveInterval:5e3,_adInformation:Object.create(MMAdvertisentInformation),_flagStartLatencyViaPlayer:!1,_statsMetric:{version:"1.0.0",qubitData:[]},_recordIndex:0,_upshiftCount:0,_downshiftCount:0,_pbTime:0,_progressMark:0,_totalDuration:0,_buffWait:0,_sumBuffWait:0,_sumBuffWaitCIRR:0,_buffWaitType:"",_sumBuffWaitVRT:0,_sumBuffWaitAAD:0,_prevPlayerState:0,_isVideoPaused:!1,_seekState:0,_EPState:0,_pauseStartTime:0,_pauseDuration:0,_initLatency:0,_adPlaybackTime:0,_bufferLength:0,_downloadRate:0,_downloadRateCount:0,_avgDownloadRate:0,_networkType:"",adClient:"",adURL:"",adDuration:0,adPosition:0,adLinear:!1,_adServer:"",_adCreativeMime:"",_wifiDataRate:0,frameLoss:0,_wifiSignalStrenth:0,_wifiSSID:"",_presentationWidth:0,_presentationHeight:0,_videoQuality:"",_experimentName:void 0,_subPropertyId:void 0,_viewSessionId:void 0,_basePlayerName:void 0,_basePlayerVersion:void 0,_deviceCapabilities:void 0,_deviceID:void 0,_playbackStatus:void 0,_bufferStartTime:0,_isBufferingState:!1,prevBitrate:0,newBitrate:0,_playerBrand:"",_playerModel:"",_playerVersion:"",_appName:"",_playerRes:"",_appVersion:"",_deviceType:"",_deviceBrand:"",_deviceModel:"",_deviceOs:"",_deviceOsVersion:"",_deviceOperator:"",_deviceMarketingName:"",_timeShift:0,_timeDeltaInMs:0,_isFirstBatch:!0,_eventToSend:[],_SESEventToSend:[],deviceIdStarz:"",_statsToSend:[],_epocTime:0,_setState:!1,_qoeMetric:{},_bwExtSet:!1,_prevSegInfo:{},_segINfoStatus:!1,_prevAudioTrack:"NA",_prevSubtitleTrack:"OFF",_cfVal:0,_maxSteps:0,_maxStepUp:0,_maxStepDown:0,_maxEventsInQ:40,_eventCount:0,_onLoadSentAtTS:0,_lastStatsPostedAtTS:0,_statsMonitorStartedAtTS:0,_bufferingCount:0,_subscriberType:void 0,_subscriberTag:void 0,_adLoadTime:0,_adStartEpocTime:0,_adBuffWaitForInterval:0,_adSumBuffWait:0,_adPauseStartTime:0,_adPauseDuration:0,_adPauseDurationToOffsetFromInterval:0,_adLoadStartTime:0,_segRepeatationCount:0,_httpPostTimeout:9e4,sessionId:"",_eventMetric:{version:"1.0.0",qubitData:[]},attributes:{UPSHIFTCOUNT:"upShiftCount",DOWNSHIFTCOUNT:"downShiftCount",SDKBOOTTIME:"sdkBootuptime",STREAMFORMAT:"streamFormat",MEDIATYPE:"mediaType",SOURCETYPE:"sourceType",SDKVERSION:"sdkVersion",HFILEVERSION:"hFileVersion",ISLIVE:"isLive",DATASOURCE:"dataSrc",CUSTID:"custId",SESSIONID:"sessionId",SST:"sst",CDN:"cdn",ASN:"asn",HOSTNAME:"sourceHostName",PBTIME:"pbTime",OPERATOR:"operator",NETWORKTYPE:"nwType",WIFISSID:"wifissid",WIFIDATERATE:"wifidatarate",SIGNALSTRENGTH:"signalstrength",PLATFORM:"platform",LOCATION:"location",SCREENRES:"scrnRes",BANDWIDTH:"bwInUse",LATENCY:"latency",BUFFERING:"buffWait",BUFFERINGTYPE:"buffWaitType",SUMBUFFERING:"sumBuffWait",SUMBUFFERINGCIRR:"sumBuffWaitCIRR",SUMBUFFERINGVRT:"sumBuffWaitVRT",SUMBUFFERINGAAD:"sumBuffWaitAAD",PLAYDUR:"playDur",FRAMELOSS:"frameloss",ASSETID:"assetId",ASSETNAME:"assetName",VIDEOID:"videoId",STREAMURL:"streamURL",PLAYERVERSION:"playerVersion",PLAYERBRAND:"pb",PLAYERMODEL:"pm",MINRES:"minRes",MAXRES:"maxRes",MAXFPS:"maxFps",MINFPS:"minFps",NUMPROFILE:"numOfProfile",TOTALDURATION:"totalDuration",RESOLUTION:"res",QBRBITRATE:"qbrBitrate",CBRBITRATE:"cbrBitrate",QBRQUALITY:"qbrQual",CBRQUALITY:"cbrQual",DURATION:"dur",FPS:"fps",SEQNUM:"seqNum",STARTTIME:"startTime",PROFILENUM:"profileNum",LASTTS:"lastTS",CBRSIZE:"cbrSize",QBRSIZE:"qbrSize",PAUSEDURATION:"pauseDuration",SUBSCRIBERID:"subscriberId",DOMAINNAME:"domainName",PLAYERNAME:"playerName",QBRSDKMODE:"mode",DEVICETYPE:"device",DEVICEBRAND:"brand",DEVICEMODEL:"model",DEVICEMARKETINGNAME:"deviceMarketingName",OSVERSION:"version",SUBSCRIBERTYPE:"subscriberType",SUBSCRIBERTAG:"subscriberTag",CONTENTTYPE:"contentType",DRMPROTECTION:"drmProtection",EPISODENUMBER:"episodeNumber",GENRE:"genre",SEASON:"season",SERIESTITLE:"seriesTitle",VIDEOTYPE:"videoType",VIDEOTRACK:"videoTrack",SUBTITLETRACK:"subtitleTrack",AUDIOTRACK:"audioTrack",ISVDSACTIVE:"isVDSActive",ISSUBTITLEACTIVE:"isSubtitleActive",PROGRESSMARK:"progressMark",APPNAME:"appName",PLAYERRES:"playerRes",APPVERSION:"appVersion",VIDEOQUALITY:"videoQuality",DEVICECAPABILITIES:"deviceCapabilities",DEVICEID:"deviceId",PLAYBACKSTATUS:"playbackStatus",EXPERIMENTNAME:"experimentName",SUBPROPERTYID:"subPropertyId",VIEWSESSIONID:"viewSessionId",BASEPLAYERNAME:"basePlayerName",BASEPLAYERVERSION:"basePlayerVersion"},_producerURL:void 0,_secondaryProducerList:[],_producerURLSES:void 0,sesRequirements:void 0,profiledIdSES:void 0,index:0},"deviceIdStarz",""),"_postInterval",10),"_customTag",{}),"_baseServerTimeStampMS",0),"_prevBitrate",-1),"_streamUrl",""),"_initLatancy",0),"_adPauseStartTime",0),_defineProperty(f,"_adEpocTime",0),_defineProperty(f,"setEPState",(function(t){this._EPState=t})),_defineProperty(f,"getEPState",(function(){return this._EPState})),_defineProperty(f,"getQbrMode",(function(){return this._mode})),_defineProperty(f,"isValidStateTransition",(function(t){return!0})),_defineProperty(f,"setRegistrationStatus",(function(t){this._regStatus=t})),_defineProperty(f,"getRegistrationStatusWithBackend",(function(){return this._regStatus})),(p={})[t="postInterval"]=p[t]||{},p[t].set=function(t){this._postInterval=t},p[e="postInterval"]=p[e]||{},p[e].get=function(){return this._postInterval},p[i="recordIndex"]=p[i]||{},p[i].set=function(t){this._recordIndex=t},p[r="recordIndex"]=p[r]||{},p[r].get=function(){return this._recordIndex},p[n="upShiftCount"]=p[n]||{},p[n].set=function(t){this._upshiftCount=t},p[a="upshiftCount"]=p[a]||{},p[a].get=function(){return this._upshiftCount},p[o="downShiftCount"]=p[o]||{},p[o].set=function(t){this._downshiftCount=t},p[s="downshiftCount"]=p[s]||{},p[s].get=function(){return this._downshiftCount},p[d="qoeMetric"]=p[d]||{},p[d].set=function(t){this._qoeMetric=t},p[u="qoeMetric"]=p[u]||{},p[u].get=function(){return this._qoeMetric},p[h="eventMetric"]=p[h]||{},p[h].set=function(t){this._eventMetric=t},p[_="eventMetric"]=p[_]||{},p[_].get=function(){return this._eventMetric},_defineProperty(f,"registerMMSmartStreaming",(function(t,e,i,r,n,a,o){this._playerName=t,this._customerID=e,this._subscriberID=i,this._domainName=r,this._subscriberType=n,this._subscriberTag=a,void 0!==o&&(this._hashSubscriberID=o)})),_defineProperty(f,"updateSubscriberID",(function(t){this._subscriberID=t})),_defineProperty(f,"updateSubscriber",(function(t,e,i){this._subscriberID=t,this._subscriberType=e,this._subscriberTag=i})),_defineProperty(f,"initializeSession",(function(t,e,i,r){return this._mode=t,this._httpUtil&&(this._httpUtil.cleanUp(),this._httpUtil=void 0),this._producerURL=void 0,this._secondaryProducerList=[],this._producerURLSES=void 0,this.deviceIdStarz="",this.index=0,this.setRegistrationStatus("PENDING"),this._statsMetric.version=this._eventMetric.version=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.EP_SCHEMA_VERSION,this._streamUrl=e,this._assetID=r.assetId,this._assetName=r.assetName,this._videoId=r.videoId,this._contentMetadata=r,this.setSESURL("https://mediamelon-builds.s3.amazonaws.com/MM-RELEASE-BUILDS/1185727140/files/endPoint.json"),this.initialize(),this.registerSdkWithBackend(t)})),_defineProperty(f,"registerSdkWithBackend",(function(t){var e=MMSTREAMSMARTERCONSTANTS.SDK_REGISTER_URL+this._customerID,i=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG;return i.component=this._component,i.mode=t,this._httpUtil=new HttpUtil,this._httpUtil.doGet(e,i)})),_defineProperty(f,"getProfiledIdforToolbox",(function(){if(this.sesRequirements){var t=this.sesRequirements.JWT,e=new XMLHttpRequest;e.open("GET",this.sesRequirements.toolboxEndpoint_profiledId,!0),e.setRequestHeader("Access-Control-Allow-Origin","*"),e.setRequestHeader("Authorization","JWT "+t),e.onerror=function(){console.log("Error while getting profiledId for Toolbox")};var i=this;e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE){var t=e.status;if(0===t||t>=200&&t<400){var r=e.response;try{i.profiledId=JSON.parse(r).result[0].id}catch(t){console.log("JSON format incorrect for profiledId -Toolbox")}}else console.log("Error while getting profiledId for Toolbox - HTTP error",t)}},e.send()}})),_defineProperty(f,"sendHearbeatToStarz",(function(){if(this.sesRequirements){var t=this.sesRequirements.sid,e=parseFloat(this._pbTime.toFixed(2)),i=this.sesRequirements.cid,r=new XMLHttpRequest;r.open("POST",this._producerURLSES+"PLAYBACK_UPDATE",!0),r.timeout=this._httpPostTimeout,r.setRequestHeader("Access-Control-Allow-Origin","*"),r.setRequestHeader("Content-type","application/json");var n=this.sesRequirements.starzEndpoint.split("track/")[1],a={apiKey:n.substring(0,n.length-1),eventType:"",deviceId:this.deviceIdStarz};a.eventType="PLAYBACK_UPDATE",a.properties={session_id:t,affiliate_name:"Dish_MX_SES",content_id:i,position_milliseconds:1e3*e};var o=JSON.stringify(a);r.onerror=function(){console.log("Error in sending heartbeat to starz")},r.send(o)}})),_defineProperty(f,"sendHeartbeatToToolbox",(function(){if(this._producerURLSES&&this.profiledId&&this.sesRequirements&&!this.sesRequirements.isStarz){this.index+=1;var t=this.index,e=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES].split("x"),i=(e[0],e[1],{content:{id:this.sesRequirements.cid,drmType:"com.widevine.alpha",formatType:"application/dash+xml"},events:[],playback:{position:parseFloat(this._pbTime.toFixed(2)),timeSpent:this.getPlayDur(),bitrate:this._prevSegInfo.cbrBitrate},user:{profiledId:this.profiledId},playerID:this.deviceIdStarz}),r={name:"StreamingProgress",number:t};i.events.push(r);var n=JSON.stringify(i),a=new XMLHttpRequest;a.open("POST",this._producerURLSES),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Access-Control-Allow-Origin","*"),a.setRequestHeader("Accept","application/json");var o=this.sesRequirements.JWT;a.setRequestHeader("Authorization","JWT "+o),a.onerror=function(){console.log("Error while sending heartbeat to Toolbox")},a.send(n)}})),_defineProperty(f,"packageToolBoxEvent",(function(t,e){if(this.sesRequirements&&!this.sesRequirements.isStarz){this.sesRequirements.isToolbox&&""==this.sesRequirements.toolboxEndpoint_profiledId&&this.getProfiledIdforToolbox();var i=t;if("ONLOAD"!==i&&"COMPLETE"!==i&&"SEEKED"!==i&&"BUFFERING"!==i&&"VideoPlaybackQualityChanged"!==i&&"ERROR"!==i&&"SEEKING"!==i&&"BUFFERING_FINISHED"!==i){var r="firstquartile"===i?25:"midpoint"===i?50:"thirdquartile"===i?75:"complete"===i?95:"ended"===i?99:"COMPLETE"===i?100:"progressmark"===i?10:void 0;this.index+=1;var n=this.index,a=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES].split("x"),o=(a[0],a[1],{content:{id:this.sesRequirements.cid,drmType:"com.widevine.alpha",formatType:"application/dash+xml"},events:[],playback:{position:parseFloat(this._pbTime.toFixed(2)),timeSpent:this.getPlayDur(),bitrate:this._prevSegInfo.cbrBitrate},user:{profiledId:this.profiledId},playerID:this.deviceIdStarz});if("START"===i||"PAUSE"===i||"RESUME"===i){var s={name:i.toLowerCase(),number:n};return o.events.push(s),JSON.stringify(o)}if("SES_ERROR"===i){var d={name:"playbackError",value:{errorCode:e.code,errorMessage:e.name}};return o.events.push(d),JSON.stringify(o)}var u={name:i,value:r,number:n};return o.events.push(u),JSON.stringify(o)}}})),_defineProperty(f,"sendEventToToolbox",(function(){if(this.sesRequirements&&!this.sesRequirements.isStarz&&this._producerURLSES&&this.profiledId){this._SESEventToSend.length;for(var t=this.sesRequirements.JWT,e=0;e<this._SESEventToSend.length;e++){var i=new XMLHttpRequest;i.open("POST",this._producerURLSES,!0),i.timeout=this._httpPostTimeout,i.setRequestHeader("Access-Control-Allow-Origin","*"),i.setRequestHeader("Content-type","application/json"),i.setRequestHeader("Authorization","JWT "+t),i.setRequestHeader("Accept","application/json"),i.onerror=function(){console.log("Error while sending event to Toolbox")},i.send(this._SESEventToSend[e]),this._SESEventToSend[e]=null}this._SESEventToSend=[]}})),_defineProperty(f,"GenerateDeviceIdStarz",(function(){return""})),_defineProperty(f,"packageStarzEvent",(function(t,e){if(this.sesRequirements&&!this.sesRequirements.isToolbox){var i=this.sesRequirements.sid,r=parseFloat(this._pbTime.toFixed(2)),n=this._playerBrand,a=this._playerVersion,o=this._deviceOs,s=this._deviceOsVersion,d=this._deviceBrand,u=this._deviceModel,h=this.sesRequirements.cid,_="Dish_MX",f=this.sesRequirements.starzEndpoint.split("track/")[1],p={apiKey:f.substring(0,f.length-1),eventType:"",deviceId:this.deviceIdStarz};if("VideoPlaybackQualityChanged"===t)return p.eventType="VIDEO_PLAYBACK_QUALITY_CHANGED",p.properties={session_id:i,target_quality_resolution:e.targetQuality.width+"X"+e.targetQuality.height,target_quality_bitrate:e.targetQuality.bitrate},JSON.stringify(p);var c=t;return"PAUSE"===c||"RESUME"===c||"COMPLETE"===c||"SEEKING"===c||"SEEKED"===c||"ENDED"===c?("PAUSE"===c?(p.eventType="PLAYBACK_PAUSED",p.properties={session_id:i,paused_position_milliseconds:1e3*r}):"RESUME"===c?(p.eventType="PLAYBACK_RESUMED",p.properties={session_id:i,resumed_position_milliseconds:1e3*r}):"COMPLETE"===c||"ENDED"===c?(p.eventType="PLAYBACK_FINISHED",p.properties={session_id:i,end_time_milliseconds:1e3*r}):"SEEKING"===c?(p.eventType="SEEK_STARTED",p.properties={session_id:i,start_position_milliseconds:1e3*r}):"SEEKED"===c&&(p.eventType="SEEK_FINISHED",p.properties={session_id:i,end_position_milliseconds:1e3*r}),JSON.stringify(p)):"ONLOAD"===c?(p.eventType="PLAYER_READY",p.properties={session_id:i,player_name:n,player_version:a,os_name:o,os_version:s,platform_name:d,platform_version:u,device_type:"PC",content_id:h},JSON.stringify(p)):"downloadFinished"===c?(p.eventType="DOWNLOAD_FINISHED",p.properties={session_id:i,http_status:e.httpStatus,success:e.success,download_time:e.downloadTime,size:e.size,attempt:e.attempt,max_attempts:e.maxAttempts,download_Type:e.downloadType},JSON.stringify(p)):"SES_ERROR"===c?(p.eventType="ERROR",p.properties={session_id:i,error_details:{code:e.code,message:e.name,content_id:h,detail:e.data},user_residency_country:"NA",user_residency_region:"NA",catalog_partner:_},JSON.stringify(p)):"SES_WARNING"===c?(p.eventType="WARNING",p.properties={session_id:i,warning_details:{code:e.code,name:e.name,timestamp:e.timestamp,data:e.data,message:e.message}},JSON.stringify(p)):"BUFFERING_FINISHED"===c?(p.eventType="BUFFERING_FINISHED",p.properties={session_id:i},JSON.stringify(p)):"BUFFERING"===c?(p.eventType="BUFFERING_STARTED",p.properties={session_id:i},JSON.stringify(p)):"START"===c?(p.eventType="PLAYBACK_STARTED",p.properties={session_id:i,startup_time_milliseconds:this._initLatency,content_id:h,affiliate_name:"Dish_MX_SES",type:"Play Button",user_residency_country:"NA",user_residency_region:"NA",catalog_partner:_},JSON.stringify(p)):void 0}})),_defineProperty(f,"sendEventToStarz",(function(){if(this.sesRequirements&&!this.sesRequirements.isToolbox&&this._producerURLSES){this._SESEventToSend.length;for(var t=0;t<this._SESEventToSend.length;t++){var e=new XMLHttpRequest,i=JSON.parse(this._SESEventToSend[t]),r=this._producerURLSES+i.eventType;e.open("POST",r,!0),e.timeout=this._httpPostTimeout,e.setRequestHeader("Access-Control-Allow-Origin","*"),e.setRequestHeader("Content-type","application/json"),e.onerror=function(){console.log("Error while sending payload to Starz")},e.send(this._SESEventToSend[t]),this._SESEventToSend[t]=null}return this._SESEventToSend=[],0}})),_defineProperty(f,"reportRegistrationSuccess",(function(t){var e,i;this.setRegistrationStatus("SUCCESS"),this._modeFromResponse=t.mode,this.setCfVal(t.cfVal),void 0!==t.maxStepsUp&&(isNaN(t.maxStepsUp)||(e=t.maxStepsUp)),void 0!==t.maxStepsDown&&(isNaN(t.maxStepsDown)||(i=t.maxStepsDown)),void 0===e&&void 0===i&&void 0!==t.maxSteps&&(isNaN(t.maxSteps)||(e=i=t.maxSteps)),void 0!==t.secProdList&&t.secProdList.length>0&&Array.isArray(t.secProdList)&&this.reportSecondaryProducerList(t.secProdList),this.setMaxSteps(e,i),this.reportServerTimeStamp(t.timestamp),this.reportProducer(t.producerURL,t.statsInterval),this.monitorRegistration(),this._inProgress=!0,this._simulatedEndedSent=!1})),_defineProperty(f,"setSDKQoEConfig",(function(t,e){void 0!==t&&(this._enableVideoQoE=t),void 0!==e&&(this._enableAdQoE=e)})),_defineProperty(f,"reportRegistrationFailure",(function(){this.setRegistrationStatus("FAILED"),this._producerURL=void 0,this._secondaryProducerList=[],this._modeFromResponse=null,this._postInterval=-1,this._eventToSend=[],this._SESEventToSend=[],this._statsToSend=[],this.stopMonitoring()})),_defineProperty(f,"reportRenditionChange",(function(t,e){var i={},r=!1;if(e.cbrBitrate&&e.cbrBitrate!==t.cbrBitrate){t.cbrBitrate?e.cbrBitrate>t.cbrBitrate?this.upShift():this.downShift():t.cbrBitrate=0;var n="Prev: "+t.cbrBitrate+", New: "+e.cbrBitrate;i.Bitrate=n,r=!0}if(e.res&&e.res!==t.res){t.res||(t.res="0x0");var a="Prev: "+t.res+", New: "+e.res;i.Res=a,r=!0}if(e.vCodec&&e.vCodec!==t.vCodec){t.vCodec||(t.vCodec="NA");var o="Prev: "+t.vCodec+", New: "+e.vCodec;i.VCodec=o,r=!0}if(e.aCodec&&e.aCodec!==t.aCodec){t.aCodec||(t.aCodec="NA");var s="Prev: "+t.aCodec+", New: "+e.aCodec;i.ACodec=s,r=!0}if(e.fps&&e.fps!==t.fps){t.fps||(t.fps="0.0");var d="Prev: "+t.fps+", New: "+e.fps;i.FPS=d,r=!0}return r&&(i=JSON.stringify(i),this.notifyEvent("RENDITION_CHANGE",i,"RENDITION_CHANGE",this._pbTime)),r})),_defineProperty(f,"addCustomSegInfo",(function(t){this.reportRenditionChange(this._prevSegInfo,t)&&(t.timestamp=this.getCorrectedCurrentTimeinMs(),this._downloadRate>0&&(t.downloadRate=parseFloat((1024*this._downloadRate).toFixed(2))),this._statsMetric.qubitData[this._recordIndex].segInfo.push(t),this._prevSegInfo=t,this._segINfoStatus=!0)})),_defineProperty(f,"addSegInfo",(function(t){if(this._prevSegInfo){if(-1!=t.seqNum&&this._prevSegInfo.seqNum==t.seqNum&&this._prevSegInfo.startTime===t.startTime&&this._prevSegInfo.cbrBitrate===t.cbrBitrate&&this._segRepeatationCount++<10)return;if(this._prevSegInfo.cbrBitrate===t.cbrBitrate&&this._prevSegInfo.res===t.res)return}t.cbrBitrate&&(this._downloadRate>0&&(t.downloadRate=parseFloat((1024*this._downloadRate).toFixed(2))),this._bufferLength>=0&&(t.bufferLength=parseInt(this._bufferLength)),t.cbrSize?t.dur<0&&(t.cbrSize=t.qbrSize=0):t.dur>0?t.cbrSize=t.qbrSize=t.dur*t.cbrBitrate:t.cbrSize=t.qbrSize=0,t.timestamp=this.getCorrectedCurrentTimeinMs(),void 0!==t.qbrBitrate&&delete t.qbrBitrate,void 0!==t.qbrQual&&delete t.qbrQual,void 0!==t.cbrQual&&delete t.cbrQual,void 0!==t.dur&&delete t.dur,void 0!==t.seqNum&&delete t.seqNum,void 0!==t.startTime&&delete t.startTime,void 0!==t.fps&&delete t.fps,void 0!==t.profileNum&&delete t.profileNum,void 0!==t.cbrProfileNum&&delete t.cbrProfileNum,void 0!==t.qbrSize&&delete t.qbrSize,void 0!==t.bufferLength&&delete t.bufferLength,void 0!==t.cbrSize&&t.cbrSize<=0&&delete t.cbrSize,void 0!==t.vCodec&&""===t.vCodec&&delete t.vCodec,void 0!==t.aCodec&&""===t.aCodec&&delete t.aCodec,this.reportRenditionChange(this._prevSegInfo,t),this._statsMetric.qubitData[this._recordIndex].segInfo.push(t),this._prevSegInfo=t.constructor===Array?t[length-1]:t,this._segINfoStatus=!0,this._segRepeatationCount=0)})),_defineProperty(f,"setBandwidth",(function(t){void 0!==t&&t>0&&(this._downloadRate=t/1024,this._downloadRateCount=this._downloadRateCount+1,this._avgDownloadRate=this._downloadRate+this._avgDownloadRate)})),_defineProperty(f,"reportBufferLength",(function(t){t>=0&&(this._bufferLength=t)})),_defineProperty(f,"clearAdInfo",(function(){delete this._eventMetric.qubitData[this._recordIndex].adInfo})),_defineProperty(f,"setCustomTag",(function(t,e){void 0===this._eventMetric.qubitData[this._recordIndex].customTags&&(this._eventMetric.qubitData[this._recordIndex].customTags={}),void 0===this._statsMetric.qubitData[this._recordIndex].customTags&&(this._statsMetric.qubitData[this._recordIndex].customTags={});var i=this._eventMetric.qubitData[this._recordIndex].customTags;i[t]=e,this._eventMetric.qubitData[this._recordIndex].customTags=i,this._statsMetric.qubitData[this._recordIndex].customTags=i})),_defineProperty(f,"reportContentMetadata",(function(t){void 0!==t.assetId&&null!==t.assetId&&this.setContentMetadata(this.attributes.ASSETID,t.assetId),void 0!==t.assetName&&null!==t.assetName&&this.setContentMetadata(this.attributes.ASSETNAME,t.assetName),t.videoId&&this.setContentMetadata(this.attributes.VIDEOID,t.videoId),t.contentType&&this.setContentMetadata(this.attributes.CONTENTTYPE,t.contentType),t.drmProtection&&this.setContentMetadata(this.attributes.DRMPROTECTION,t.drmProtection),t.episodeNumber&&this.setContentMetadata(this.attributes.EPISODENUMBER,t.episodeNumber),t.genre&&this.setContentMetadata(this.attributes.GENRE,t.genre),t.season&&this.setContentMetadata(this.attributes.SEASON,t.season),t.seriesTitle&&this.setContentMetadata(this.attributes.SERIESTITLE,t.seriesTitle),t.videoType&&this.setContentMetadata(this.attributes.VIDEOTYPE,t.videoType)})),_defineProperty(f,"setContentMetadata",(function(t,e){null!=e&&(this._statsMetric.qubitData[this._recordIndex].contentMetadata[t]=e,this._eventMetric.qubitData[this._recordIndex].contentMetadata[t]=e)})),_defineProperty(f,"reportNetworkType",(function(t){t&&(this._networkType=t,this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType))})),_defineProperty(f,"reportDeviceType",(function(t){this._deviceType=t})),_defineProperty(f,"setCfVal",(function(t){this._cfVal=t})),_defineProperty(f,"getCfVal",(function(){return this._cfVal})),_defineProperty(f,"setMaxSteps",(function(t,e){t>=0&&(this._maxStepUp=t),e>=0&&(this._maxStepDown=e)})),_defineProperty(f,"getMaxStepsToSwitch",(function(){return[this._maxStepUp,this._maxStepDown]})),_defineProperty(f,"reportWifiSSID",(function(t){t&&(this._wifiSSID=t,this.setClientInfo(this.attributes.WIFISSID,this._wifiSSID))})),_defineProperty(f,"reportWifiSignalStrenthPercentage",(function(t){t&&(this._wifiSignalStrenth=t,this.setClientInfo(this.attributes.SIGNALSTRENGTH,this._wifiSignalStrenth))})),_defineProperty(f,"reportWifiDataRate",(function(t){t&&(this._wifiDataRate=t,this.setClientInfo(this.attributes.WIFIDATERATE,this._wifiDataRate))})),_defineProperty(f,"reportServerTimeStamp",(function(t){this._baseServerTimeStampMS=t,this.setCurrentTimeDelta()})),_defineProperty(f,"reportProducer",(function(t,e){this._producerURL=t,this._postInterval=e})),_defineProperty(f,"reportSecondaryProducerList",(function(t){this._secondaryProducerList=t})),_defineProperty(f,"reportProducerForSES",(function(t){this._producerURLSES=t,this.deviceIdStarz=this.GenerateDeviceIdStarz()})),_defineProperty(f,"reportMode",(function(t){this._mode=t,this.setStreamID(this.attributes.QBRSDKMODE,this._mode),this.sendEventInfo()})),_defineProperty(f,"reportAssetID",(function(t,e,i){t&&(this._assetID=t),e&&(this._assetName=e),i&&(this._videoId=i)})),_defineProperty(f,"reportPresentationSize",(function(t,e){this._presentationWidth=t,this._presentationHeight=e})),_defineProperty(f,"reportFrameLoss",(function(t){this.frameloss=t,this.setPBStats(this.attributes.FRAMELOSS,this.frameloss)})),_defineProperty(f,"reportABRSwitch",(function(t,e){})),_defineProperty(f,"monitorRegistration",(function(){this.sendEventInfo(),this.sendQueuedStats(),this.startMonitoring()})),_defineProperty(f,"sendQueuedStats",(function(){if(void 0!==this._producerURL){for(var t=0;t<this._statsToSend.length;t++){var e=this._statsToSend[t],i=!1;if("undefined"!=typeof pako)try{e=pako.gzip(e),i=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var r=new XMLHttpRequest;r.open("POST",this._producerURL,!0),r.timeout=this._httpPostTimeout,r.setRequestHeader("Content-type","application/json"),i&&r.setRequestHeader("Content-Encoding","gzip"),r.send(e),this._lastStatsPostedAtTS=this.getCurrentTimeinMs(),this._statsToSend[t]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(e,i)}this._statsToSend=[]}})),_defineProperty(f,"reportPlayerInfo",(function(t,e,i){this._playerBrand=t,this._playerModel=e,this._playerVersion=i})),_defineProperty(f,"reportAppInfo",(function(t,e){this._appName=t,this._appVersion=e})),_defineProperty(f,"reportPlayerResolution",(function(t){this._playerRes=t,this.setClientInfo(this.attributes.PLAYERRES,this._playerRes)})),_defineProperty(f,"reportDeviceCapabilities",(function(t){this._deviceCapabilities=t})),_defineProperty(f,"reportVideoQuality",(function(t){this._videoQuality=t})),_defineProperty(f,"reportExperimentName",(function(t){this._experimentName=t,this.setStreamID(this.attributes.EXPERIMENTNAME,this._experimentName)})),_defineProperty(f,"reportSubPropertyId",(function(t){this._subPropertyId=t,this.setStreamID(this.attributes.SUBPROPERTYID,this._subPropertyId)})),_defineProperty(f,"reportViewSessionId",(function(t){this._viewSessionId=t,this.setStreamID(this.attributes.VIEWSESSIONID,this._viewSessionId)})),_defineProperty(f,"reportBasePlayerInfo",(function(t,e){this._basePlayerName=t,this._basePlayerVersion=e,this.setStreamID(this.attributes.BASEPLAYERNAME,this._basePlayerName),this.setStreamID(this.attributes.BASEPLAYERVERSION,this._basePlayerVersion)})),_defineProperty(f,"reportManifestLoaded",(function(t){this.notifyEvent("MANIFEST_LOADED","Manifest Load Complete","MANIFEST_LOADED",this._pbTime)})),_defineProperty(f,"reportDeviceId",(function(t){this._deviceID=t})),_defineProperty(f,"reportDeviceInfo",(function(t,e,i,r,n,a,o,s){t&&(this._deviceBrand=t),e&&(this._deviceModel=e),i&&(this._deviceOs=i),r&&(this._deviceOsVersion=r),n&&(this._deviceOperator=n),o&&(this._presentationWidth=o),s&&(this._presentationHeight=s),a&&(this._deviceMarketingName=a),this.setScreenRes()})),_defineProperty(f,"reportMetricValue",(function(t,e){t===MMOverridableMetric.Latency?(this._initLatency=parseFloat(e.toFixed(2)),this._flagStartLatencyViaPlayer=!0):t===MMOverridableMetric.ServerAddress?this.setClientInfo(this.attributes.CDN,e):t===MMOverridableMetric.DurationWatched||(t===MMOverridableMetric.streamURL?this.setStreamID(this.attributes.STREAMURL,e):t===MMOverridableMetric.drmType&&this.setContentMetadata(this.attributes.DRMPROTECTION,e))})),_defineProperty(f,"reportAdBufferingStarted",(function(){if(this._adInformation){if(!this._adInformation._playSent||this._isBufferingState)return;this._isBufferingState=!0;var t=this.getCurrentTimeinMs();populateAdRelatedInfo(t),this._bufferStartTime=t,this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_BUFFERING","Ad Buffering started","AD_BUFFERING",null),_adInformation._adLastAdEventTimeStamp=t}})),_defineProperty(f,"reportAdBufferingCompleted",(function(){if(this._adInformation){if(!_adInformation._playSent||0==this._isBufferingState)return;if(this._playbackStatus="AD_BUFFERING_COMPLETE",this._isBufferingState=!1,this._prevPlayerState===MMPlayerState.PLAYING){var t=this.getCurrentTimeinMs();this._bufferStartTime&&(this._adBuffWaitForInterval=t-this._bufferStartTime,this._adSumBuffWait=this._adSumBuffWait+this._adBuffWaitForInterval,this.setPBStats(this.attributes.BUFFERING,this._adBuffWaitForInterval),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this._bufferStartTime=0)}}})),_defineProperty(f,"reportBufferingStarted",(function(){this.getEPState()!==MMExperienceProbeState.STARTED||this._isBufferingState||(this._isBufferingState=!0,this._bufferStartTime=this.getCurrentTimeinMs(),this._bufferingCount++,this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD),this.notifyEvent("BUFFERING_START","Playback Buffering Started","BUFFERING_START",this._pbTime))})),_defineProperty(f,"reportBufferingCompleted",(function(){this.getEPState()===MMExperienceProbeState.STARTED&&(this.notifyEvent("BUFFERING_COMPLETE","Playback Buffering Completed","BUFFERING_COMPLETE",this._pbTime),this._isBufferingState=!1,this.setBuffering())})),_defineProperty(f,"reportEventWithValue",(function(t,e){this.notifyEvent(t,e,t,this._pbTime)})),_defineProperty(f,"reportUserInitiatedPlayback",(function(){var t=this.getCurrentTimeinMs();this.getEPState()===MMExperienceProbeState.INITIALIZED?(this._latencyStartTime=t,this.notifyEvent("ONLOAD","Player Initializing..","ONLOAD",0),this.notifyPackager("ONLOAD"),this.setEPState(MMExperienceProbeState.ONLOAD_SENT)):console.log("Warn: State not valid")})),_defineProperty(f,"reportPlayerState",(function(t){var e=this.getEPState(),i=this.getCurrentTimeinMs();this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD);var r=!1;switch(t){case MMPlayerState.PLAYING:if(this._seekState=SeekState.Playing,this._isVideoPaused=!1,this._prevPlayerState==MMPlayerState.PAUSED&&e===MMExperienceProbeState.ONLOAD_SENT&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._pauseStartTime=0,this.notifyEvent("RESUME","Playback resumed","RESUME",this._pbTime),this.startMonitoring(),r=!0),e===MMExperienceProbeState.ONLOAD_SENT){if(!this._flagStartLatencyViaPlayer){var n=i-this._latencyStartTime;this._pauseDuration>0&&(n-=this._pauseDuration),this._initLatency=n,this._initLatency<0&&(this._initLatency=0)}this._epocTime=i,this.setPBStats(this.attributes.LATENCY,this._initLatency),this.setEPState(MMExperienceProbeState.STARTED),this.notifyPackager("START"),this.notifyEvent("START","Playback Start","START",this._pbTime),this._latencyStartTime=0,this.startMonitoring(),r=!0}else if(e===MMExperienceProbeState.STARTED&&this._prevPlayerState===MMPlayerState.PAUSED)this._pauseStartTime&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._epocTime+=this._pauseDuration,this._pauseStartTime=0,this._bufferStartTime=i,this.notifyEvent("RESUME","Playback resumed","RESUME",this._pbTime),this.notifyPackager("RESUME"),this.startMonitoring(),r=!0);else if(e===MMExperienceProbeState.STOPPED&&this._prevPlayerState===MMPlayerState.STOPPED){var a=this.getStreamInfo(),o=this.getStreamId(),s=this._mode;this.reset(),this.initialize(),this.reportMode(s),this.setPresentationStreamInfo(a.maxRes,a.minRes,a.maxFps,a.minFps,a.numOfProfile,a.streamFormat),this.setVideoDuration(a.totalDuration),this.setPresentationType(o.isLive),this.setEPState(MMExperienceProbeState.INITIALIZED),this.reportUserInitiatedPlayback(),this.reportPlayerState(MMPlayerState.PLAYING),this.setEPState(MMExperienceProbeState.STARTED),r=!0}break;case MMPlayerState.PAUSED:e!==MMExperienceProbeState.STARTED&&e!==MMExperienceProbeState.ONLOAD_SENT||(this.sendQBRStats(),this._pauseStartTime=i,this.notifyEvent("PAUSE","Playback Paused","PAUSE",this._pbTime),this.notifyPackager("PAUSE"),this._isVideoPaused=!0,r=!0);break;case MMPlayerState.STOPPED:if(!0===this._simulatedEndedSent||e===MMExperienceProbeState.STOPPED||void 0===this._prevPlayerState||this._prevPlayerState===MMPlayerState.STOPPED)break;this.sendQBRStats(),this._pauseStartTime>0&&(this._pauseDuration=i-this._pauseStartTime,this.setBufPBEvent(this.attributes.PAUSEDURATION,this._pauseDuration),this._epocTime+=this._pauseDuration,this._pauseStartTime=0,this._pauseDuration=0),this._totalDuration<=0||this._pbTime<.9*this._totalDuration?(this.notifyEvent("ENDED","Playback completion","ENDED",this._pbTime),this.notifyPackager("ENDED")):(this.notifyEvent("COMPLETE","Playback completion","COMPLETE",this._pbTime),this.notifyPackager("COMPLETE")),this.stopMonitoring(),this._inProgress=!1,this.setEPState(MMExperienceProbeState.STOPPED),r=!0;break;default:return void MMLogger.log("INFO","Unknown State")}r&&(this._prevPlayerState=t)})),_defineProperty(f,"reportError",(function(t,e){this.setPlaybackPos(e),this.getEPState()>=MMExperienceProbeState.ONLOAD_SENT&&this.notifyEvent("ERROR",t,"ERROR",this._pbTime)})),_defineProperty(f,"isValid",(function(t){return null!=t&&t.length})),_defineProperty(f,"reportResolutionChange",(function(t){})),_defineProperty(f,"reportVolumeChange",(function(t){this.notifyEvent("VOLUME_CHANGE",t,"VOLUME_CHANGE",this._pbTime)})),_defineProperty(f,"reportPlaybackRateChange",(function(){this.notifyEvent("RATE_CHANGE","Playback Rate Changed","RATE_CHANGE",this._pbTime)})),_defineProperty(f,"reportDurationChange",(function(){this.notifyEvent("DURATION_CHANGE","Playback Duration Changed","DURATION_CHANGE",this._pbTime)})),_defineProperty(f,"reportPlayerSeekStarted",(function(){this._seekState=SeekState.SeekStarted,this.notifyEvent("SEEK_START","Playback Seek Started","SEEK_START",this._pbTime)})),_defineProperty(f,"reportPlayerSeekCompleted",(function(t){var e=this.getCurrentTimeinMs();this.getEPState()===MMExperienceProbeState.STARTED&&(this._pauseStartTime&&(this._epocTime+=e-this._pauseStartTime),this.setPlaybackPos(t),this._seekState=SeekState.SeekCompleted,this.notifyEvent("SEEK_COMPLETE","Playback Seek Completed","SEEK_COMPLETE",t/1e3),this.notifyPackager("SEEKED"),this._pauseStartTime&&(this._epocTime-=e-this._pauseStartTime))})),_defineProperty(f,"reset",(function(){this._inProgress&&this.getEPState()===MMExperienceProbeState.STARTED&&(this.reportPlayerState(MMPlayerState.STOPPED),this._inProgress=!1,this._simulatedEndedSent=!0),this._mode=null,this._bufferLength=0,this._downloadRate=0,this._downloadRateCount=0,this._avgDownloadRate=0,this._isFirstBatch=!0,this._eventCount=0,this._onLoadSentAtTS=0,this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=0,this._bufferingCount=0,this._recordIndex=0,this._prevBitrate=-1,this._upshiftCount=0,this._pbTime=0,this._progressMark=0,this._downshiftCount=0,this._playDur=0,this._baseServerTimeStampMS=0,this._totalDuration=0,this._buffWait=0,this._sumBuffWait=0,this._sumBuffWaitCIRR=0,this._buffWaitType="",this._sumBuffWaitVRT=0,this._sumBuffWaitAAD=0,this._initLatency=0,this._latencyStartTime=0,this._enableEP=!1,this._flagStartLatencyViaPlayer=!1,this._prevPlayerState=void 0,this._isVideoPaused=!1,this._prevSegInfo={},this._prevAudioTrack="NA",this._prevSubtitleTrack="OFF",this._pauseStartTime=0,this._pauseDuration=0,this._adPlaybackTime=0,this.adDuration=0,this.adPosition=0,this._bufferStartTime=0,this._isBufferingState=!1,this.newBitrate=0,this._epocTime=0,this._qoeMetric={},this._statsMetric.qubitData=[],this._eventMetric.qubitData=[],this._statsMetric.qubitData.push(this.QBRMetricTemplate()),this._eventMetric.qubitData.push(this.EventMetricTemplate()),this._eventToSend=[],this._SESEventToSend=[],this.deviceIdStarz="",this._statsToSend=[],this.sessionId="",this._segRepeatationCount=0,this._maxSteps=0,this._maxStepUp=0,this._maxStepDown=0,this.index=0,this.setEPState(MMExperienceProbeState.IDLE)})),_defineProperty(f,"initialize",(function(){this.setStreamID(this.attributes.CUSTID,parseInt(this._customerID)),this.setStreamID(this.attributes.DATASOURCE,"Player"),this.setStreamID(this.attributes.PLAYERNAME,this._playerName),this.sessionId=this.getSessionId(),this.deviceIdStarz=this.GenerateDeviceIdStarz(),this.setStreamID(this.attributes.SESSIONID,this.sessionId),this.setStreamID(this.attributes.DOMAINNAME,this.getDomainName()),this.setStreamID(this.attributes.STREAMURL,this._streamUrl),this.setStreamID(this.attributes.PLAYERVERSION,this._playerVersion),this.setStreamID(this.attributes.PLAYERBRAND,this._playerBrand),this.setStreamID(this.attributes.PLAYERMODEL,this._playerModel),this.setStreamID(this.attributes.SUBPROPERTYID,this._subPropertyId),this.setStreamID(this.attributes.EXPERIMENTNAME,this._experimentName),this.setStreamID(this.attributes.VIEWSESSIONID,this._viewSessionId),this.setStreamID(this.attributes.BASEPLAYERNAME,this._basePlayerName),this.setStreamID(this.attributes.BASEPLAYERVERSION,this._basePlayerVersion),this.setSDKInfo(this.attributes.SDKVERSION,this._sdkVersion),this.setSDKInfo(this.attributes.HFILEVERSION,this._hintFileVersion),this.setClientInfo(this.attributes.DEVICETYPE,this._deviceType),this.setClientInfo(this.attributes.DEVICEBRAND,this._deviceBrand),this.setClientInfo(this.attributes.DEVICEMODEL,this._deviceModel),this.setClientInfo(this.attributes.OSVERSION,this._deviceOsVersion),this.setClientInfo(this.attributes.PLATFORM,this._deviceOs),this.setClientInfo(this.attributes.OPERATOR,this._deviceOperator),this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType),this.setClientInfo(this.attributes.WIFISSID,this._wifiSSID),this.setClientInfo(this.attributes.WIFIDATERATE,this._wifiDataRate),this.setClientInfo(this.attributes.SIGNALSTRENGTH,this._wifiSignalStrenth),this.setClientInfo(this.attributes.APPNAME,this._appName),this.setClientInfo(this.attributes.APPVERSION,this._appVersion),this.setClientInfo(this.attributes.PLAYERRES,this._playerRes),this.setClientInfo(this.attributes.DEVICEMARKETINGNAME,this._deviceMarketingName),this.setSubscriberID(),this.setSubscriberType(),this.setSubscriberTag(),this.setAssetID(),this.reportContentMetadata(this._contentMetadata),this.setScreenRes(),this.setEPState(MMExperienceProbeState.INITIALIZED)})),_defineProperty(f,"getSessionId",(function(){(new Date).getTime();var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx-".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t+=(new Date).getTime()})),_defineProperty(f,"getDomainName",(function(){return this.isValid(this._domainName)||(this._domainName=this.getDefaultDomainName()),this._domainName})),_defineProperty(f,"getDefaultDomainName",(function(){return""})),_defineProperty(f,"isEmpty",(function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0})),_defineProperty(f,"getCustomTag",(function(t){return this._customTag[t]})),_defineProperty(f,"notifyPackager",(function(t,e){var i;this.sesRequirements&&(this&&this.sesRequirements.isToolbox&&((i="SES_ERROR"===t||"SES_WARNING"===t?this.packageToolBoxEvent(t,e):this.packageToolBoxEvent(t,this._pbTime))&&this._SESEventToSend.push(i),this.sendEventToToolbox()),this&&this.sesRequirements.isStarz&&((i="VideoPlaybackQualityChanged"===t||"SES_ERROR"===t||"downloadFinished"===t||"SES_WARNING"===t?this.packageStarzEvent(t,e):this.packageStarzEvent(t,this._pbTime))&&this._SESEventToSend.push(i),this.sendEventToStarz()))})),_defineProperty(f,"setSESRequirements",(function(t){this.sesRequirements=t})),_defineProperty(f,"setSESURL",(function(t){if(this.sesRequirements){var e=new XMLHttpRequest;e.open("GET",t,!0);var i=this;e.onload=function(){if(200===e.status){var t=JSON.parse(e.response);i.sesRequirements.isToolbox?(i.reportProducerForSES(t.toolboxEndpoint_events),i.sesRequirements.toolboxEndpoint_events=t.toolboxEndpoint_events,i.sesRequirements.toolboxEndpoint_profiledId=t.toolboxEndpoint_profiledId,i.getProfiledIdforToolbox()):i.sesRequirements.isStarz&&(i.reportProducerForSES(t.starzEndpoint),i.sesRequirements.starzEndpoint=t.starzEndpoint)}else console.log("Error while fetching MM URL tracker file "+e.response)},e.send()}})),_defineProperty(f,"notifyEvent",(function(t,e,i,r){if("object"===_typeof(e)&&(e="Unknown error took place: "+e),"FAILED"!==this._regStatus&&this&&this._eventMetric&&this._eventMetric.qubitData&&!(this._recordIndex<0)&&this._eventMetric.qubitData[this._recordIndex]&&this._eventMetric.qubitData[this._recordIndex].clientInfo&&this.attributes&&this.attributes.SCREENRES){this._eventMetric.playDur=this.getPlayDur();var n=this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES];0!==t.indexOf("AD_")?this.clearAdInfo():(void 0!==this._adInformation._adResolution&&(this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES]=this._adInformation._adResolution),this._eventMetric.playDur=parseInt(this.getAdPlayDur())),r=r?parseFloat(r):parseFloat(0),this._eventMetric.playDur||(this._eventMetric.playDur=0),this._eventMetric.qubitData[this._recordIndex].pbEventInfo.event=t,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.desc=e,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.id=i,this._eventMetric.qubitData[this._recordIndex].pbEventInfo.pbTime=parseFloat(r.toFixed(2)),this._qoeMetric.timestamp=this._eventMetric.timestamp=this.getCorrectedCurrentTimeinMs(),this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,this._qoeMetric[this.attributes.PROGRESSMARK]=parseFloat(this._progressMark.toFixed(2))),this._eventMetric.interval=this._postInterval,this._eventMetric.pbTime=parseFloat(r.toFixed(2)),Object.keys(this._qoeMetric).length&&this._eventMetric.qubitData[this._recordIndex].pbInfo.push(this._qoeMetric),this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.BUFFERING)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.BUFFERING],this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.UPSHIFTCOUNT)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.UPSHIFTCOUNT],this._eventMetric.qubitData[this._recordIndex].pbInfo[0].hasOwnProperty(this.attributes.DOWNSHIFTCOUNT)&&delete this._eventMetric.qubitData[this._recordIndex].pbInfo[0][this.attributes.DOWNSHIFTCOUNT];var a=JSON.parse(JSON.stringify(this._eventMetric));this._eventToSend.push(a),this.sendEventInfo(),this._eventMetric.qubitData[this._recordIndex].clientInfo[this.attributes.SCREENRES]=n,this._eventMetric.qubitData[this._recordIndex].adInfo=void 0,this._eventMetric.qubitData[this._recordIndex].pbEventInfo={},this._eventMetric.qubitData[this._recordIndex].pbInfo=[],this._playbackStatus=t,this._qoeMetric.hasOwnProperty(this.attributes.LATENCY)&&delete this._qoeMetric[this.attributes.LATENCY],this._qoeMetric.hasOwnProperty(this.attributes.PAUSEDURATION)&&delete this._qoeMetric[this.attributes.PAUSEDURATION]}})),_defineProperty(f,"downShift",(function(){this._downshiftCount++})),_defineProperty(f,"upShift",(function(){this._upshiftCount++})),_defineProperty(f,"getInitialDelay",(function(){return this._initLatency})),_defineProperty(f,"getBuffWait",(function(){return this._sumBuffWait})),_defineProperty(f,"getBufferingCount",(function(){return this._bufferingCount})),_defineProperty(f,"setStreamID",(function(t,e){null!=e&&(this._statsMetric.qubitData[this._recordIndex].streamID[t]=e,this._eventMetric.qubitData[this._recordIndex].streamID[t]=e)})),_defineProperty(f,"setMode",(function(t){void 0!==t&&String(t).length>0&&(statsMetric.qubitData[this._recordIndex].streamID.mode=t,eventMetric.qubitData[this._recordIndex].streamID.mode=t)})),_defineProperty(f,"setClientInfo",(function(t,e){this._eventMetric.qubitData&&(void 0===this._eventMetric.qubitData[this._recordIndex].clientInfo&&(this._eventMetric.qubitData[this._recordIndex].clientInfo={}),void 0===this._statsMetric.qubitData[this._recordIndex].clientInfo&&(this._statsMetric.qubitData[this._recordIndex].clientInfo={}),e&&(this._statsMetric.qubitData[this._recordIndex].clientInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].clientInfo[t]=e))})),_defineProperty(f,"setPlaybackPos",(function(t){this._pbTime=t/1e3})),_defineProperty(f,"getPlaybackPos",(function(){return this._pbTime})),_defineProperty(f,"setPBStats",(function(t,e){if(t!==this.attributes.LATENCY){var i={};i.timestamp=this.getCorrectedCurrentTimeinMs(),i[t]=parseFloat(e.toFixed(2)),i[this.attributes.PBTIME]=parseFloat(this._pbTime.toFixed(2)),this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,i[this.attributes.PROGRESSMARK]=parseFloat(this._progressMark.toFixed(2))),t===this.attributes.BUFFERING&&(i[this.attributes.BUFFERINGTYPE]=this._buffWaitType),this._statsMetric.qubitData[this._recordIndex].pbInfo.push(i)}(e||t==this.attributes.LATENCY)&&(this._qoeMetric[t]=parseFloat(e.toFixed(2)))})),_defineProperty(f,"setBufPBEvent",(function(t,e){e&&(t in this._qoeMetric&&t===this.attributes.BUFFERING?this._qoeMetric[t]=parseInt(e):this._qoeMetric[t]=e)})),_defineProperty(f,"setSDKInfo",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].sdkInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].sdkInfo[t]=e)})),_defineProperty(f,"getPBStats",(function(t){return this._qoeMetric[t]})),_defineProperty(f,"setDiagnostics",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].diagnostics[t]=e)})),_defineProperty(f,"setStreamInfo",(function(t,e){void 0!==t&&void 0!==e&&(this._statsMetric.qubitData[this._recordIndex].streamInfo[t]=e,this._eventMetric.qubitData[this._recordIndex].streamInfo[t]=e)})),_defineProperty(f,"getStreamInfo",(function(){return this._statsMetric.qubitData[this._recordIndex].streamInfo})),_defineProperty(f,"getStreamId",(function(){return this._statsMetric.qubitData[this._recordIndex].streamID})),_defineProperty(f,"setSegInfo",(function(t,e){e&&(this._statsMetric.qubitData[this._recordIndex].segInfo[t]=e)})),_defineProperty(f,"setScreenRes",(function(){var t="";(this.isValid(this._presentationHeight)&&this.isValid(this._presentationWidth)||this._presentationHeight>0&&this._presentationWidth>0)&&(t=this._presentationWidth+"x"+this._presentationHeight),this.setClientInfo(this.attributes.SCREENRES,t),this.setClientInfo(this.attributes.VIDEOQUALITY,this._videoQuality),this.setClientInfo(this.attributes.DEVICEID,this._deviceID),this._deviceCapabilities&&this.setClientInfo(this.attributes.DEVICECAPABILITIES,this._deviceCapabilities)})),_defineProperty(f,"setAssetID",(function(){void 0!==this._assetID&&null!==this._assetID&&this.setStreamID(this.attributes.ASSETID,this._assetID),void 0!==this._assetName&&null!==this._assetName&&this.setStreamID(this.attributes.ASSETNAME,this._assetName),this._videoId&&this.setStreamID(this.attributes.VIDEOID,this._videoId)})),_defineProperty(f,"uuidv4_subscriberID",(function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))})),_defineProperty(f,"setSubscriberID",(function(){this._subscriberID&&(this._hashSubscriberID?this.setStreamID(this.attributes.SUBSCRIBERID,MMMD5().mm_md5(this._subscriberID)):this.setStreamID(this.attributes.SUBSCRIBERID,this._subscriberID))})),_defineProperty(f,"setSubscriberType",(function(){this._subscriberType&&this.setStreamID(this.attributes.SUBSCRIBERTYPE,this._subscriberType)})),_defineProperty(f,"setSubscriberTag",(function(){this._subscriberTag&&this.setStreamID(this.attributes.SUBSCRIBERTAG,this._subscriberTag)})),_defineProperty(f,"setVideoDuration",(function(t){t&&(this._totalDuration=t,this.setStreamInfo(this.attributes.TOTALDURATION,parseFloat(t.toFixed(2))))})),_defineProperty(f,"reportStreamInfo",(function(t,e,i){t&&this.setStreamInfo(this.attributes.STREAMFORMAT,t),e&&this.setStreamID(this.attributes.MEDIATYPE,e),i&&this.setStreamID(this.attributes.SOURCETYPE,i)})),_defineProperty(f,"reportNetworkInfo",(function(t,e,i,r,n){n&&(this._deviceOperator=n),r&&(this._networkType=r),this.setClientInfo(this.attributes.CDN,t),this.setClientInfo(this.attributes.ASN,e),this.setClientInfo(this.attributes.HOSTNAME,i),this.setClientInfo(this.attributes.NETWORKTYPE,this._networkType),this.setClientInfo(this.attributes.OPERATOR,this._deviceOperator)})),_defineProperty(f,"setPresentationType",(function(t){this.setStreamID(this.attributes.ISLIVE,t)})),_defineProperty(f,"setPresentationStreamInfo",(function(t,e,i,r,n,a){this.setStreamInfo(this.getAttribute().MAXRES,t),this.setStreamInfo(this.getAttribute().MINRES,e),this.setStreamInfo(this.getAttribute().MAXFPS,parseFloat(i)),this.setStreamInfo(this.getAttribute().MINFPS,parseFloat(r)),this.setStreamInfo(this.getAttribute().NUMPROFILE,n),a&&this.setStreamInfo(this.getAttribute().STREAMFORMAT,a)})),_defineProperty(f,"reportTrackinfo",(function(t,e,i,r,n){var a=e;if(n||(a="OFF"),this.setStreamInfo(this.getAttribute().VIDEOTRACK,t),this.setStreamInfo(this.getAttribute().SUBTITLETRACK,a),this.setStreamInfo(this.getAttribute().AUDIOTRACK,i),this.setStreamInfo(this.getAttribute().ISVDSACTIVE,r),this.setStreamInfo(this.getAttribute().ISSUBTITLEACTIVE,n),a&&a!=this._prevSubtitleTrack){var o="Prev: "+this._prevSubtitleTrack+", New: "+a;this.notifyEvent("SUBTITLE_CHANGE",o,"SUBTITLE_CHANGE",this._pbTime),this._prevSubtitleTrack=a}if(i&&i.length>0&&i!=this._prevAudioTrack){o="Prev: "+this._prevAudioTrack+", New: "+i;this.notifyEvent("AUDIO_CHANGE",o,"AUDIO_CHANGE",this._pbTime),this._prevAudioTrack=i}})),_defineProperty(f,"reportComponent",(function(t){this._component=t})),_defineProperty(f,"reportSDKVersion",(function(t){this._sdkVersion=MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.sdkVersion+t})),_defineProperty(f,"getSDKVersion",(function(){return this._sdkVersion})),_defineProperty(f,"reportHintFileVersion",(function(t){this._hintFileVersion=t})),_defineProperty(f,"setBuffering",(function(){var t=this.getCurrentTimeinMs();this._bufferStartTime&&(this._buffWait=t-this._bufferStartTime,this._sumBuffWait=this._sumBuffWait+this._buffWait,this._seekState===SeekState.SeekStarted||this._seekState===SeekState.SeekCompleted?(this._sumBuffWaitVRT=this._sumBuffWaitVRT+this._buffWait,this._buffWaitType="VRT"):(this._sumBuffWaitCIRR=this._sumBuffWaitCIRR+this._buffWait,this._buffWaitType="CIRR"),this.setPBStats(this.attributes.BUFFERING,this._buffWait),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._sumBuffWait),this.setBufPBEvent(this.attributes.SUMBUFFERINGCIRR,this._sumBuffWaitCIRR),this.setBufPBEvent(this.attributes.SUMBUFFERINGVRT,this._sumBuffWaitVRT),this.setBufPBEvent(this.attributes.SUMBUFFERINGAAD,this._sumBuffWaitAAD),this._bufferStartTime=0)})),_defineProperty(f,"setCurrentTimeDelta",(function(){var t=(new Date).getTime();this._baseServerTimeStampMS&&(this._baseServerTimeStampMS>t?(this._timeShift=-1,this._timeDeltaInMs=this._baseServerTimeStampMS-t):(this._timeShift=1,this._timeDeltaInMs=t-this._baseServerTimeStampMS))})),_defineProperty(f,"getCorrectedCurrentTimeinMs",(function(){var t=(new Date).getTime();return this._timeShift>0?t-this._timeDeltaInMs:t+this._timeDeltaInMs})),_defineProperty(f,"getCurrentTimeinMs",(function(){return(new Date).getTime()})),_defineProperty(f,"setPostInterval",(function(t){this._postInterval=t})),_defineProperty(f,"stopMonitoring",(function(){this._enableEP=!1,this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=0,this._timerObj&&clearInterval(this._timerObj),this._timerObj2&&clearInterval(this._timerObj2),this._timerObj=null,this._timerObj2=null,this._timerTimestampSynchro&&clearInterval(this._timerTimestampSynchro),this._timerTimestampSynchro=null})),_defineProperty(f,"startMonitoringForSES",(function(){this.sesRequirements&&(this&&this.sesRequirements.isToolbox&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHeartbeatToToolbox.bind(this),3e5)),this&&this.sesRequirements.isStarz&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHearbeatToStarz.bind(this),6e4)))})),_defineProperty(f,"startMonitoring",(function(){"SUCCESS"===this._regStatus&&(this._enableEP=!0,null===this._timerObj&&this.getEPState()===MMExperienceProbeState.STARTED&&this._postInterval>0&&this._producerURL&&(this._timerObj=setInterval(this.sendQBRStats.bind(this),1e3*this._postInterval),this.sesRequirements&&this.sesRequirements.isToolbox&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHeartbeatToToolbox.bind(this),3e5)),this.sesRequirements&&this.sesRequirements.isStarz&&null===this._timerObj2&&this._producerURLSES&&(this._timerObj2=setInterval(this.sendHearbeatToStarz.bind(this),6e4))),this._lastStatsPostedAtTS=0,this._statsMonitorStartedAtTS=this.getCurrentTimeinMs())})),_defineProperty(f,"getChecksum",(function(t,e,i){var r=MMMD5().mm_md5(t+e+i+this._eventCount);return this._eventCount++,r.substr(8,8)+r.substr(24,8)+r.substr(0,8)+r.substr(16,8)})),_defineProperty(f,"cloneAndReplaceAttributes",(function t(e){var i={};for(var r in e)if(e.hasOwnProperty(r)){var n=void 0!==payloadKeyMap[r]?payloadKeyMap[r]:r,a=e[r];Array.isArray(a)?i[n]=a.map((function(e){return"object"===_typeof2(e)&&null!==e?t(e):e})):"object"===_typeof2(a)&&null!==a?i[n]=t(a):i[n]=a}return i})),_defineProperty(f,"sendEventInfo",(function(){if(void 0!==this._producerURL){if("FAILED"!==this._regStatus){for(var t=0;t<this._eventToSend.length;t++){var e=this._eventToSend[t];if(e&&e.qubitData[this._recordIndex].streamID){if(!0===this._isFirstBatch?(e.timestamp=this.getCorrectedCurrentTimeinMs(),e.qubitData[this._recordIndex].pbInfo[0].timestamp=e.timestamp,e.qubitData[this._recordIndex].streamID.mode=this._mode,e.interval=this._postInterval):(isNaN(e.timestamp)||void 0===e.timestamp||null===e.timestamp)&&(e.timestamp=this.getCorrectedCurrentTimeinMs()),"ONLOAD"===e.qubitData[this._recordIndex].pbEventInfo.event)this._onLoadSentAtTS=e.timestamp,this._modeFromResponse&&(e.qubitData[this._recordIndex].streamID.mode=this._modeFromResponse);else if("BUFFERING"!==e.qubitData[this._recordIndex].pbEventInfo.event&&"SEEKED"!==e.qubitData[this._recordIndex].pbEventInfo.event)this._modeFromResponse&&(e.qubitData[this._recordIndex].streamID.mode=this._modeFromResponse);else{if(null===this._mode)return;e.qubitData[this._recordIndex].streamID.mode=this._mode}if(this._onLoadSentAtTS&&"START"===e.qubitData[this._recordIndex].pbEventInfo.event){if(null===this._mode)return;if(this._modeFromResponse=this._mode,-1===this._totalDuration&&void 0===e.qubitData[this._recordIndex].streamID.isLive&&(e.qubitData[this._recordIndex].streamID.isLive=!0),void 0===e.qubitData[this._recordIndex].streamID.isLive&&this._totalDuration>=0&&(e.qubitData[this._recordIndex].streamID.isLive=!1),void 0===e.qubitData[this._recordIndex].streamID.isLive)return;e.qubitData[this._recordIndex].streamID.mode=this._mode}if(0===e.qubitData[this._recordIndex].pbEventInfo.event.indexOf("AD_")&&(e.qubitData[this._recordIndex].streamID.mode=void 0),0===e.qubitData[this._recordIndex].pbEventInfo.event.indexOf("AD_")){if(!this._enableAdQoE)return void(this._eventToSend[t]=null)}else if(!this._enableVideoQoE)return void(this._eventToSend[t]=null);console.log("EVENT == ",e.qubitData[this._recordIndex].pbEventInfo.event),e.qubitData[this._recordIndex].streamID.pId=this.getChecksum(this._customerID,this.sessionId,e.timestamp),this._onLoadSentAtTS>0&&(e.qubitData[this._recordIndex].streamID.sst=this._onLoadSentAtTS);var i=this.cloneAndReplaceAttributes(e),r=JSON.stringify(i),n=!1;if("undefined"!=typeof pako)try{r=pako.gzip(r),n=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var a=new XMLHttpRequest;a.open("POST",this._producerURL,!0),a.timeout=this._httpPostTimeout,a.setRequestHeader("Content-type","application/json"),n&&a.setRequestHeader("Content-Encoding","gzip"),a.send(r),this._eventToSend[t]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(r,n)}}this._isFirstBatch=!1,this._eventToSend=[]}}else this._eventToSend.length>this._maxEventsInQ&&this._eventToSend.splice(this._maxEventsInQ-4,2)})),_defineProperty(f,"sendQBRStats",(function(){if("FAILED"!==this._regStatus&&this._enableVideoQoE&&("PENDING"===this._regStatus||this._enableEP&&this.getEPState()===MMExperienceProbeState.STARTED)){if(!1===this._bwExtSet){var t=this._avgDownloadRate/this._downloadRateCount;!isNaN(t)&&t>0&&this.setPBStats(this.attributes.BANDWIDTH,t),this._downloadRateCount=0,this._avgDownloadRate=0}if(this._totalDuration>0&&(this._progressMark=this._pbTime/this._totalDuration*100,this.setPBStats(this.attributes.PROGRESSMARK,parseFloat(this._progressMark.toFixed(2)))),!1===this._segINfoStatus&&!this._isVideoPaused){if(this._statsMetric&&this._statsMetric.pbTime>-1&&parseFloat(this._statsMetric.pbTime.toFixed(2))===parseFloat(this._pbTime.toFixed(2)))return;this._prevSegInfo&&this._prevSegInfo.cbrBitrate?(this._prevSegInfo.timestamp=this.getCorrectedCurrentTimeinMs(),this._prevSegInfo.dur=-1,this._prevSegInfo.cbrSize=this._prevSegInfo.qbrSize=0,this._statsMetric.qubitData[this._recordIndex].segInfo.push(this._prevSegInfo)):this._statsMetric.qubitData[this._recordIndex].segInfo=[]}this._segINfoStatus=!1,this._bwExtSet=!1,this._statsMetric.timestamp=this.getCorrectedCurrentTimeinMs(),this._statsMetric.pbTime=parseFloat(this._pbTime.toFixed(2)),this._isVideoPaused||(this._statsMetric.playDur=this.getPlayDur());var e=this._statsMonitorStartedAtTS?this.getCurrentTimeinMs()-this._statsMonitorStartedAtTS:0;if(e=this._lastStatsPostedAtTS?this.getCurrentTimeinMs()-this._lastStatsPostedAtTS:e,this._statsMetric.interval=parseInt(e?e/1e3:0),"PENDING"!==this._regStatus&&!this._statsMetric.interval)return;this._upshiftCount>0&&this.setPBStats(this.attributes.UPSHIFTCOUNT,this._upshiftCount),this._downshiftCount>0&&this.setPBStats(this.attributes.DOWNSHIFTCOUNT,this._downshiftCount),this._statsMetric.qubitData[this._recordIndex].streamID.pId=this.getChecksum(this._customerID,this.sessionId,this._statsMetric.timestamp),this._onLoadSentAtTS>0&&(this._statsMetric.qubitData[this._recordIndex].streamID.sst=this._onLoadSentAtTS);var i=this._statsMetric;this._isVideoPaused&&(i=this.convertStatsToPingPayload(i));var r=this.cloneAndReplaceAttributes(i),n=JSON.stringify(r);if(this._statsMetric.qubitData[this._recordIndex].segInfo=[],this._statsMetric.qubitData[this._recordIndex].pbInfo=[],this._statsToSend.push(n),void 0!==this._producerURL){for(var a=0;a<this._statsToSend.length;a++){var o=this._statsToSend[a],s=!1;if("undefined"!=typeof pako)try{o=pako.gzip(o),s=!0}catch(t){console.error("MMError: Error compressing event payload: ",t)}var d=new XMLHttpRequest;d.open("POST",this._producerURL,!0),d.timeout=this._httpPostTimeout,d.setRequestHeader("Content-type","application/json"),s&&d.setRequestHeader("Content-Encoding","gzip"),d.send(o),this._lastStatsPostedAtTS=this.getCurrentTimeinMs(),this._statsToSend[a]=null,this._secondaryProducerList&&this._secondaryProducerList.length>0&&this.sendDataToSecondaryProducerList(o,s)}this._statsToSend=[]}else this._statsToSend.length>this._maxEventsInQ&&this._statsToSend.splice(this._maxEventsInQ-4,2)}})),_defineProperty(f,"convertStatsToPingPayload",(function(t){var e=t.qubitData[0].streamID,i={};e&&(e.custId&&(i[this.attributes.CUSTID]=e[this.attributes.CUSTID]),e.sessionId&&(i[this.attributes.SESSIONID]=e[this.attributes.SESSIONID]),e.pId&&(i.pId=e.pId),e.sst&&(i.sst=e.sst),e.subscriberId&&(i[this.attributes.SUBSCRIBERID]=e[this.attributes.SUBSCRIBERID]),i[this.attributes.DATASOURCE]="Player-ping");var r=JSON.parse(JSON.stringify(t));return r.qubitData=[{streamID:i}],r})),_defineProperty(f,"sendDataToSecondaryProducerList",(function(t,e){var i=this;try{this._secondaryProducerList.forEach((function(r){var n=new XMLHttpRequest;n.open("POST",r,!0),n.timeout=i._httpPostTimeout,n.setRequestHeader("Content-type","application/json"),e&&n.setRequestHeader("Content-Encoding","gzip"),n.send(t)}))}catch(t){console.error("MMError: Error sending data to secondary producer list: ",t)}})),_defineProperty(f,"getPlayDur",(function(){var t=this.getCurrentTimeinMs();return 0!==this._epocTime?t>this._epocTime&&(this._playDur=parseInt((t-this._epocTime)/1e3)):this._playDur=0,this._playDur})),_defineProperty(f,"getAdPlayDur",(function(){var t=0;return this._adInformation&&(t=this._adInformation._adPlayDur),t})),_defineProperty(f,"getAttribute",(function(){return this.attributes})),_defineProperty(f,"SegmentInfo",(function(t,e,i,r,n,a,o,s,d,u,h,_,f,p,c){return{res:t,qbrBitrate:void 0!==e&&e>0?e:0,cbrBitrate:void 0!==i&&i>0?i:0,qbrQual:void 0!==r?parseFloat(r.toFixed(2)):0,cbrQual:void 0!==n?parseFloat(n.toFixed(2)):0,dur:void 0!==a?a:0,seqNum:void 0!==o?o:0,startTime:void 0!==s?s:0,fps:void 0!==d?d:0,cbrProfileNum:void 0!==h?h:0,profileNum:void 0!==u?u:0,cbrSize:void 0!==_?Math.floor(_):0,qbrSize:void 0!==f?Math.floor(f):0,vCodec:void 0!==p?p:"",aCodec:void 0!==c?c:""}})),_defineProperty(f,"EventMetricTemplate",(function(){return{streamID:{},pbEventInfo:{},streamInfo:{},contentMetadata:{},sdkInfo:{},pbInfo:[]}})),_defineProperty(f,"QBRMetricTemplate",(function(){return{streamID:{},streamInfo:{},contentMetadata:{},segInfo:[],pbInfo:[],sdkInfo:{}}})),_defineProperty(f,"resetAdvertisementInfo",(function(){this._adInformation._adResolution=void 0,this._adInformation._adClient=void 0,this._adInformation._adId=void 0,this._adInformation._adDuration=void 0,this._adInformation._adPosition=void 0,this._adInformation._adLinear=void 0,this._adInformation._adCreativeType=void 0,this._adInformation._adServer=void 0,this._adInformation._prevAdState=void 0,this._adInformation._adPlaybackTime=void 0,this._adInformation._adCreativeId=void 0,this._adInformation._adTitle=void 0,this._adInformation._adBitrate=void 0,this._adInformation._adUrl=void 0,this._adInformation._playSent=!1,this._adInformation._adPlaybackStartWallClockTime=void 0,this._adInformation._adPlayDur=0,this._adInformation._adLastPlayingEventTimeStamp=-1,this._adInformation._adLastAdEventTimeStamp=-1,this._adInformation._isBumper=!1,this._adInformation._adPodIndex=-2,this._adInformation._adPodLength=-1,this._adInformation._adPositionInPod=-1,this._adInformation._adScheduledTime=-1,this._adEpocTime=0,this._adPauseStartTime=0,this._adStartEpocTime=0,this._adLoadTime=0,this._adStartEpocTime=0,this._adBuffWaitForInterval=0,this._adSumBuffWait=0,this._adPauseDuration=0,this._adPauseDurationToOffsetFromInterval=0,this._adLoadStartTime=0})),_defineProperty(f,"resetForNewAd",(function(){this._adInformation._prevAdState=null,this._adInformation._adPlaybackTime=-1,this._adInformation._playSent=!1,this._adInformation._adPlaybackStartWallClockTime=-1,this._adInformation._adLastPlayingEventTimeStamp=-1,this._adInformation._adLastAdEventTimeStamp=-1,this._adInformation._adPlayDur=0,this._adInformation._adPodIndex=-2,this._adInformation._adPodLength=-1,this._adInformation._adPositionInPod=-1,this._adInformation._adCreativeId=void 0,this._adInformation._adTitle=void 0,this._adInformation._adBitrate=void 0,this._adInformation._adUrl=void 0,this._adEpocTime=0,this._adPauseStartTime=0,this._adStartEpocTime=0,this._adLoadTime=0,this._adStartEpocTime=0,this._adBuffWaitForInterval=0,this._adSumBuffWait=0,this._adPauseDuration=0,this._adPauseDurationToOffsetFromInterval=0,this._adLoadStartTime=0})),_defineProperty(f,"sendAdPlayingEvent",(function(t,e){if(null!=this._adInformation&&this._adInformation._playSent&&this._adInformation._prevAdState!=MMAdState.AD_PAUSED){var i=parseInt((t-this._adInformation._adPlaybackStartWallClockTime)/1e3);(e||i>0&&i%(this._KAdKeepAliveInterval/1e3)==0)&&(this._adInformation._adPlaybackStartWallClockTime=t,this.populateAdRelatedInfo(t),this.notifyEvent("AD_PLAYING","AD KEEP ALIVE","AD_PLAYING",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastPlayingEventTimeStamp=t,this._adInformation._adLastAdEventTimeStamp=this.getCurrentTimeinMs())}})),_defineProperty(f,"resetAdInfoIfInitialState",(function(t){null==this._adInformation&&(this._adInformation=new MMAdvertisentInformation),t==MMAdState.AD_REQUEST||null==this._adInformation._prevAdState?(this.resetAdvertisementInfo(),this._adLoadStartTime=this._adPauseStartTime=this._adPauseDuration=this._adLoadTime=0,this._adBuffWaitForInterval=this._adSumBuffWait=0):t==MMAdState.AD_IMPRESSION&&this._adInformation._prevAdState!=MMAdState.AD_STARTED&&this._adInformation._prevAdState!=MMAdState.AD_REQUEST&&this._adInformation._prevAdState!=MMAdState.AD_IMPRESSION&&(this.resetForNewAd(),this._adLoadStartTime=this._adPauseStartTime=this._adPauseDuration=this._adLoadTime=0,this._adBuffWaitForInterval=this._adSumBuffWait=0);var e=Math.ceil(this._pbTime+3);null!=this._adInformation._adPosition&&null!=this._adInformation._adPosition||(this.getEPState()==MMExperienceProbeState.STARTED||this._pbTime<=1?this._adInformation._adPosition="pre":!this._adInformation.prevAdState&&this._adInformation.prevAdState!=MMPlayerState.STOPPED&&this._pbTime>0&&e<this._totalDuration?this._adInformation._adPosition="mid":(!this._adInformation.prevAdState&&this._adInformation.prevAdState==MMPlayerState.STOPPED||this._pbTime>0&&e>=this._totalDuration)&&(this._adInformation._adPosition="post")),this._adInformation._prevAdState=t})),_defineProperty(f,"populateAdRelatedInfo",(function(t){this._adInformation&&(void 0===this._eventMetric.qubitData[this._recordIndex].adInfo&&(this._eventMetric.qubitData[this._recordIndex].adInfo={}),void 0!==this._adInformation._adClient&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adClient=this._adInformation._adClient),void 0!==this._adInformation._adId&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adId=this._adInformation._adId),void 0!==this._adInformation._adDuration&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adDuration=parseFloat((this._adInformation._adDuration/1e3).toFixed(2))),void 0!==this._adInformation._adPosition&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPosition=this._adInformation._adPosition),void 0!==this._adInformation._adLinear&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adLinear=this._adInformation._adLinear),void 0!==this._adInformation._adCreativeType&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adCreativeType=this._adInformation._adCreativeType),void 0!==this._adInformation._adServer&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adSystem=this._adInformation._adServer),void 0!==this._adInformation._adResolution&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adResolution=this._adInformation._adResolution),void 0!==this._adInformation._adTitle&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adTitle=this._adInformation._adTitle),void 0!==this._adInformation._adBitrate&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adBitrate=this._adInformation._adBitrate),void 0!==this._adInformation._adUrl&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adUrl=this._adInformation._adUrl),void 0!==this._adInformation._adCreativeId&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adCreativeId=this._adInformation._adCreativeId),this._adInformation._adPodLength>0&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodLength=this._adInformation._adPodLength),this._adInformation._adPodIndex>=-1&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodIndex=this._adInformation._adPodIndex),this._adInformation._adPositionInPod>0&&(this._eventMetric.qubitData[this._recordIndex].adInfo.adPodPosition=this._adInformation._adPositionInPod),this._eventMetric.qubitData[this._recordIndex].adInfo.isBumper=this._adInformation._isBumper,this._eventMetric.qubitData[this._recordIndex].adInfo.adInterval=this.getAdInterval(t))})),_defineProperty(f,"getAdInterval",(function(t){var e=0;return null!=this._adInformation&&this._adInformation._adLastAdEventTimeStamp>0&&(null!=this._adPauseStartTime&&this._adPauseStartTime>0&&(t=this._adPauseStartTime),e=1*(t-this._adInformation._adLastAdEventTimeStamp)/1e3),this._adPauseDurationToOffsetFromInterval>0&&(e-=this._adPauseDurationToOffsetFromInterval/1e3,this._adPauseDurationToOffsetFromInterval=0),this._adBuffWaitForInterval>0&&(e-=this._adBuffWaitForInterval/1e3,this._adInformation._adPlayDur+=this._adBuffWaitForInterval/1e3,this._adBuffWaitForInterval=0),e<0&&(e=0),this._adInformation._adPlayDur+=e,e})),_defineProperty(f,"millisecToSec",(function(t){return parseFloat(1*t/1e3).toFixed(2)})),_defineProperty(f,"reportAdState",(function(t){var e=this.getCurrentTimeinMs();switch(this.resetAdInfoIfInitialState(t),this.populateAdRelatedInfo(e),t){case MMAdState.AD_BLOCKED:this.notifyEvent("AD_BLOCK","Ad blocked","AD_BLOCK",0);break;case MMAdState.AD_IMPRESSION:this._adLoadStartTime=e,this._adPauseStartTime=-1,this.notifyEvent("AD_IMPRESSION","Ad impression has been made","AD_IMPRESSION",0);break;case MMAdState.AD_STARTED:case MMAdState.AD_PLAY:0==this._adInformation._playSent&&(this._adInformation._playSent=!0,this._adLoadStartTime>0&&(this.loadStartTime>0&&(this._adLoadStartTime,this.loadStartTime),this._adLoadTime=e-this._adLoadStartTime,this._adPauseDuration>0&&(this._adLoadTime-=this._adPauseDuration),this._adLoadTime<0&&(this._adLoadTime=0),this._adInformation._adPlayDur+=Math.ceil(this._adLoadTime/1e3)),this.populateAdRelatedInfo(e),this.setPBStats(this.attributes.LATENCY,this._adLoadTime),this.notifyEvent("AD_PLAY","Ad Playback started","AD_PLAY",0),this.adLoadStartTime=0,this._adInformation._adLastPlayingEventTimeStamp=this._adInformation._adPlaybackStartWallClockTime=this.getCurrentTimeinMs(),this._adInformation._adLastAdEventTimeStamp=this._adInformation._adLastPlayingEventTimeStamp);break;case MMAdState.AD_CLICKED:this.notifyEvent("AD_CLICK","Ad has been clicked","AD_CLICK",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_PAUSED:this.sendQBRStats(),this._adPauseStartTime=this.getCurrentTimeinMs(),this.notifyEvent("AD_PAUSED","Ad has been paused","AD_PAUSED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e,this._isVideoPaused=!0;break;case MMAdState.AD_RESUMED:this._adPauseStartTime>0&&(this._adPauseDuration=e-this._adPauseStartTime,this._adPauseDuration<0&&(this._adPauseDuration=0),this._adPauseDurationToOffsetFromInterval=this._adPauseDuration),this._isVideoPaused=!1,this.setPBStats(this.attributes.PAUSEDURATION,this._adPauseDuration),this.populateAdRelatedInfo(e),this.notifyEvent("AD_RESUMED","Ad has been resumed","AD_RESUMED",this.millisecToSec(this._adInformation._adPlaybackTime)),this.startMonitoring(),this._adInformation._adLastAdEventTimeStamp=e,this._adPauseStartTime=-1;break;case MMAdState.AD_SKIPPED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_SKIPPED","Ad has been skipped","AD_SKIPPED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_COMPLETED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this._adInformation._adDuration>0&&(this._adInformation._adPlaybackTime-90*this._adInformation._adDuration/100>=0||Math.abs(this._adInformation._adPlaybackTime-this._adInformation._adDuration)<2)?this.notifyEvent("AD_COMPLETE","Ad completed playing","AD_COMPLETE",this.millisecToSec(this._adInformation._adPlaybackTime)):this.notifyEvent("AD_ENDED","Ad ended","AD_ENDED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_ENDED:this._adSumBuffWait<0&&(this._adSumBuffWait=0),this.setBufPBEvent(this.attributes.SUMBUFFERING,this._adSumBuffWait),this.notifyEvent("AD_ENDED","Ad ended","AD_ENDED",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_ERROR:this.notifyEvent("AD_ERROR",event.message,"AD_ERROR",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._playSent=!1,this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_REQUEST:this.notifyEvent("AD_REQUEST","Ad has been requested","AD_REQUEST",0);break;case MMAdState.AD_PLAYING:this.sendAdPlayingEvent(e,!1);break;case MMAdState.AD_FIRST_QUARTILE:this.notifyEvent("AD_PLAYED_FIRST_QUARTILE","Ad reached first quartile","AD_PLAYED_FIRST_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_MIDPOINT:this.notifyEvent("AD_PLAYED_SECOND_QUARTILE","Ad reached midpoint","AD_PLAYED_SECOND_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e;break;case MMAdState.AD_THIRD_QUARTILE:this.notifyEvent("AD_PLAYED_THIRD_QUARTILE","Ad reached third quartile","AD_PLAYED_THIRD_QUARTILE",this.millisecToSec(this._adInformation._adPlaybackTime)),this._adInformation._adLastAdEventTimeStamp=e}})),_defineProperty(f,"reportAdError",(function(t,e){this.populateAdRelatedInfo(),null==e&&(e=this._adInformation._adPlaybackTime),void 0===e&&(e=0),this.notifyEvent("AD_ERROR",t,"AD_ERROR",this.millisecToSec(e))})),_defineProperty(f,"reportAdPlaybackTime",(function(t){if(t>=0&&this._adInformation){var e=this.getCurrentTimeinMs();this._adInformation._adPlaybackTime=t,this.sendAdPlayingEvent(e,!1)}})),_defineProperty(f,"reportAdInfo",(function(t){this._adInformation||(this._adInformation=new MMAdvertisentInformation),t&&(void 0!==t.adClient&&(this._adInformation._adClient=t.adClient),void 0!==t.adId&&(this._adInformation._adId=t.adId),void 0!==t.adDuration&&(this._adInformation._adDuration=t.adDuration),void 0!==t.adPosition&&(this._adInformation._adPosition=t.adPosition),void 0!==t.adIsLinear&&(t.adIsLinear?this._adInformation._adLinear="linear":this._adInformation._adLinear="nonlinear"),void 0!==t.adCreativeType&&(this._adInformation._adCreativeType=t.adCreativeType),void 0!==t.adServer&&(this._adInformation._adServer=t.adServer),void 0!==t.adResolution&&(this._adInformation._adResolution=t.adResolution),this._adInformation._isBumper=t.isBumper,t.adPodIndex>=-1&&(this._adInformation._adPodIndex=t.adPodIndex),t.adPodLength>0&&(this._adInformation._adPodLength=t.adPodLength),t.adPositionInPod>0&&(this._adInformation._adPositionInPod=t.adPositionInPod),t.adScheduledTime>=0&&(this._adInformation._adScheduledTime=t.adScheduledTime),void 0!==t.adUrl&&(this._adInformation._adUrl=t.adUrl),void 0!==t.adCreativeId&&(this._adInformation._adCreativeId=t.adCreativeId),void 0!==t.adTitle&&(this._adInformation._adTitle=t.adTitle),void 0!==t.adBitrate&&(this._adInformation._adBitrate=t.adBitrate))})),_defineProperty(f,"isQBRDisabled",(function(){return null===this._mode||"QBRDisabled-NoMetafile"==this._mode||this._mode==MMQBRMode.QBRModeDisabled||"QBRDisabled-QMetric"==this._mode||"QBRDisabled-NoPresentationInfo"==this._mode||"QBRDisabled-NoABR"==this._mode||"QBRDisabled-LiveSessionNotSupported"==this._mode||"QBRDisabled-ContentNotSupportedForQBR"==this._mode})),_defineEnumerableProperties(f,p),f},HttpUtil=function(){var t=new XMLHttpRequest,e=function(t){return"?"+Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")};return{doGet:function(i,r){return new Promise((function(n,a){void 0!==r&&(i+=e(r)),t.open("GET",i),t.timeout=25e3,t.onload=function(){200==t.status?n(t.response):a(Error(t.statusText))},t.onerror=function(){a(Error("Network Error"))},t.abort=function(){a(Error("NetRequest Aborted"))},t.ontimeout=function(){a(Error("NetRequest timeout"))},t.send()}))},cleanUp:function(){t&&4!=t.readyState&&t.abort()}}},QBRFactoryMaker=function(){var t,e=[],i=[];function r(t,e){for(var r in i){var n=i[r];if(n.context===t&&n.name===e)return n.instance}return null}function n(e,i,r,n){var o=a(r)[e];if(o){var s=o.instance;if(!o.override)return s.apply({context:r,factory:t},n);for(var d in s=s.apply({context:r,factory:t,parent:i},n))i.hasOwnProperty(d)&&(i[d]=s[d])}return i}function a(t){var i;return e.forEach((function(e){e===t&&(i=e)})),i||(i=e.push(t)),i}return t={extend:function(t,e,i,r){var n=a(r);!n[t]&&e&&(n[t]={instance:e,override:i})},getSingletonInstance:r,setSingletonInstance:function(t,e,r){for(var n in i){var a=i[n];if(a.context===t&&a.name===e)return void(i[n].instance=r)}i.push({name:e,context:t,instance:r})},getSingletonFactory:function(t){return function(e){var a;return void 0===e&&(e={}),{getInstance:function(){return a||(a=r(e,t.__dashjs_factory_name)),a||(a=n(t.__dashjs_factory_name,t.apply({context:e},arguments),e,arguments),i.push({name:t.__dashjs_factory_name,context:e,instance:a})),a}}}},getClassFactory:function(t){return function(e){return void 0===e&&(e={}),{create:function(){return n(t.__dashjs_factory_name,t.apply({context:e},arguments),e,arguments)}}}}},t}(),MMLogger=function(){var t=isNaN(MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.log_level)?2:MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.log_level,e={VERBOSE:6,DEBUG:5,INFO:4,ANALYZE:3,WARN:2,ERROR:1,OFF:0};return{setLogLevel:function(e){e<0&&(e=0),t=e},log:function(i,r){(function(t){for(var i in e)if(i===t)return e[i];return e.OFF})(i)<=t&&console.log("["+i+"] : "+r)}}}(),MMSmartStreamingImpl=function(){var t=!1,e=new ExperienceProbe,i=null,r=!1,n=function(t){r&&console.log("mmTrace:"+(new Date).getTime()+"::"+t)},a=function(r){if(null!=r&&(n(" setPresentationInformation In - live?"+r.isLive+" duration:"+r.duration+" repsCnt:"+r.representationArray.length),1===(i=r).isLive&&(i.isLive=!0),0===i.isLive&&(i.isLive=!1),t)){e.reportMode("QBRDisabled");var a=i.isLive?-1:i.duration/1e3;e.setVideoDuration(a),e.setPresentationType(i.isLive);var o="",s="",d=0,u=0,h=i.representationArray.length,_=i.contentType;if(h)for(var f=0;f<h;f++)i.representationArray[f].width&&i.representationArray[f].height&&i.representationArray[f].width>0&&i.representationArray[f].height>0&&((0===d||d>i.representationArray[f].width*i.representationArray[f].height)&&(s=i.representationArray[f].width+"x"+i.representationArray[f].height,d=i.representationArray[f].width*i.representationArray[f].height),(0===u||u<i.representationArray[f].width*i.representationArray[f].height)&&(o=i.representationArray[f].width+"x"+i.representationArray[f].height,u=i.representationArray[f].width*i.representationArray[f].height));e.setPresentationStreamInfo(o,s,0,0,h,_)}},o=function(t){var i=t.endByte>0?t.endByte-t.startByte:-1,r=void 0,n=void 0,a=t.duration>0?parseInt(t.duration/1e3):-1,o=t.startTime>0?t.startTime/1e3:-1;-1==t.trackIdx?-1!=t.bitrate&&(r=s(t.bitrate),n=d(t.bitrate)):(r=u(t.trackIdx),n=h(t.trackIdx));var _=void 0,f=void 0;return n&&n.video&&(f=n.video),n&&n.audio&&(_=n.audio),e.SegmentInfo(r,t.bitrate,t.bitrate,void 0,void 0,a,t.sequence,o,void 0,t.trackIdx,t.trackIdx,i,void 0,f,_)},s=function(t){var e=_(t),i=void 0;return void 0!==e&&void 0!==e.width&&void 0!==e.height&&e.width>0&&e.height>0&&(i=e.width+"x"+e.height),i},d=function(t){var e=_(t),i=void 0;return e&&(i=e.codecIdentifier),i},u=function(t){var e=f(t),i=void 0;return void 0!==e&&void 0!==e.width&&void 0!==e.height&&e.width>0&&e.height>0&&(i=e.width+"x"+e.height),i},h=function(t){var e=f(t),i=void 0;return e&&(i=e.codecIdentifier),i},_=function(t){var e=void 0;if(i)for(var r=0;r<i.representationArray.length;r++)if(i.representationArray[r].bitrate===t){e=i.representationArray[r];break}return e},f=function(t){var e=void 0;if(i)for(var r=0;r<i.representationArray.length;r++)if(i.representationArray[r].trackIdx===t){e=i.representationArray[r];break}return e};return{enableLogTrace:function(t){r=t},updateSubscriberID:function(t){e.updateSubscriberID(t)},updateSubscriber:function(t,i,r){e.updateSubscriber(t,i,r)},getRegistrationStatus:function(){return t},getRegistrationStatusWithBackend:function(){return e.getRegistrationStatusWithBackend()},registerMMSmartStreaming:function(i,r,a,o,s,d,u,h){n(" registerMMSmartStreaming In "+i+" "+r+" "+o+" "+s+" "+a),e.reset(),e.registerMMSmartStreaming(i,r,o,s,d,u,h),e.reportHintFileVersion(MMSTREAMSMARTERCONSTANTS.SDK_CONFIG.hintFileVersion),e.reportComponent(a),t=!0},initializeSession:function(t,r,o,s){return n(" initializeSession In mode: "+t+" url:"+r+" metaurl: "+o+" contentMetadata:"+s),i=null,e.reset(),e.initializeSession(t,r,o,s).then((function(t){var r=JSON.parse(t);return void 0!==r.producerURL?(e.reportRegistrationSuccess(r),e.reportAssetID(s.assetID,s.assetName,s.videoId),a(i),MMLogger.log("VERBOSE"," initializing QEngine"),new Promise((function(t,i){MMLogger.log("VERBOSE","InitializeSession Success"),t(r),r&&e.setSDKQoEConfig(r.mmVideo,r.mmAd)}))):(e.reportRegistrationFailure(),e.reset(),new Promise((function(t,e){MMLogger.log("VERBOSE","Playback Registration Failed"),e("Playback Registration Failed.")})))})).catch((function(t){return"QBRSDK : QEngine cannot be initialized...."!=t?(t="Experience Probe Initialisation Failed.",e.reportRegistrationFailure(),e.reset()):t="MMSmartStreaming : QBR component cannot be initialized...",a(i),new Promise((function(e,i){MMLogger.log("VERBOSE",t),i(t)}))}))},setPresentationInformation:a,reportStreamInfo:function(t,i,r){e.reportStreamInfo(t,i,r)},reportNetworkInfo:function(t,i,r,n,a){e.reportNetworkInfo(t,i,r,n,a)},reportChunkRequest:function(i){if(t){n("reportChunkRequest In");var r=o(i);e.addSegInfo(r)}},reportDownloadRate:function(i){t&&(n(" reportDownloadRate In :"+i),e.setBandwidth(i))},reportBufferLength:function(i){t&&(n(" reportBufferLength In :"+i),e.reportBufferLength(i))},reportCustomMetadata:function(i,r){t&&(n(" reportCustomMetadata In"),e.setCustomTag(i,r))},reportPlaybackPosition:function(i){t&&(n(" reportPlaybackPosition In :"+i),e.setPlaybackPos(i))},reportNetworkType:function(i){t&&(n(" reportNetworkType In"),e.reportNetworkType(i))},reportMetricValue:function(i,r){t&&(n(" reportMetricValue In"),e.reportMetricValue(i,r))},reportDeviceInfo:function(t,i,r,a,o,s,d,u){n(" reportDeviceInfo In "),e.reportDeviceInfo(t,i,r,a,o,s,d,u),"CHROMECAST"===i?e.reportDeviceType("ChromeCast"):"SMARTTV"===i&&e.reportDeviceType("SmartTV")},reportPlayerInfo:function(t,i,r){n(" reportPlayerInfo In"),e.reportPlayerInfo(t,i,r)},reportAppInfo:function(t,i){n(" reportAppInfo In"),e.reportAppInfo(t,i)},reportPlayerResolution:function(t){n(" reportPlayerResolution In"),e.reportPlayerResolution(t)},reportDeviceCapabilities:function(t){n(" reportdeviceCapabilities In"),e.reportDeviceCapabilities(t)},reportVideoQuality:function(t){n(" reportVideoQuality In"),e.reportVideoQuality(t)},reportExperimentName:function(t){e.reportExperimentName(t)},reportSubPropertyId:function(t){e.reportSubPropertyId(t)},reportViewSessionId:function(t){e.reportViewSessionId(t)},reportBasePlayerInfo:function(t,i){e.reportBasePlayerInfo(t,i)},reportManifestLoaded:function(){n(" reportManifestLoaded In"),e.reportManifestLoaded()},reportDeviceId:function(t){n(" reportDeviceId In"),e.reportDeviceId(t)},reportPlayerState:function(t){n(" reportPlayerState In "+t),e.reportPlayerState(t)},notifyPackager:function(t,i){e.notifyPackager(t,i)},setSESRequirements:function(t){e.setSESRequirements(t)},setSESURL:function(t){e.setSESURL(t)},reportTrackinfo:function(t,i,r,n,a){e.reportTrackinfo(t,i,r,n,a)},reportUserInitiatedPlayback:function(){n(" reportUserInitiatedPlayback In "),e.reportUserInitiatedPlayback()},reportBufferingStarted:function(){n(" reportBufferingStarted In "),e.reportBufferingStarted()},reportBufferingCompleted:function(){n(" reportBufferingCompleted In "),e.reportBufferingCompleted()},reportEventWithValue:function(t,i){e.reportEventWithValue(t,i)},addCustomSegInfo:function(t){e.addCustomSegInfo(t)},reportABRSwitch:function(i,r){t&&e.isQBRDisabled()&&(n(" reportABRSwitch "+i+"->"+r),e.reportABRSwitch(i,r))},reportFrameLoss:function(i){t&&(n(" reportFrameLoss In "+i),e.reportFrameLoss(i))},reportPresentationSize:function(t,i){n("reportPresentationSize w:"+t+" h:"+i),e.reportPresentationSize(t,i)},reportError:function(i,r){t&&(n(" reportError In "+i),e.reportError(i,r))},reportPlayerSeekCompleted:function(i){t&&(n(" reportPlayerSeekCompleted In"),e.reportPlayerSeekCompleted(i))},reportPlayerSeekStarted:function(){t&&(n(" reportPlayerSeekStarted In"),e.reportPlayerSeekStarted())},reportResolutionChange:function(i){t&&(n(" reportResolutionChange In"),e.reportResolutionChange(i))},reportVolumeChange:function(i){t&&(n(" reportVolumeChange In"),e.reportVolumeChange(i))},reportPlaybackRateChange:function(){t&&(n(" reportPlaybackRateChange In"),e.reportPlaybackRateChange())},reportDurationChange:function(){t&&(n(" reportDurationChange In"),e.reportDurationChange())},reportSDKVersion:function(t){e.reportSDKVersion(t)},getSDKVersion:function(){return e.getSDKVersion()},reportWifiSSID:function(i){t&&(n(" reportWifiSSID In"),e.reportWifiSSID(i))},reportWifiSignalStrenthPercentage:function(i){t&&(n(" reportWifiSignalStrenthPercentage In"),e.reportWifiSignalStrenthPercentage(i))},reportWifiDataRate:function(i){t&&(n(" reportWifiDataRate In"),e.reportWifiDataRate(i))},reportAdInfo:function(i){t&&(n(" reportAdInfo "),i&&e.reportAdInfo(i))},reportAdError:function(t,i){n(" reportAdError "+t),e.reportAdError(t,i)},reportAdBufferingStarted:function(){n(" reportAdBufferingStarted In "),e.reportAdBufferingStarted()},reportAdBufferingCompleted:function(){n(" reportAdBufferingCompleted In "),e.reportAdBufferingCompleted()},reportAdPlaybackTime:function(i){t&&(n(" reportAdPlaybackTime "+i),e.reportAdPlaybackTime(i))},reportAdState:function(i){t&&(n(" reportAdState "+i),e.reportAdState(i))},reportComponent:function(i){t&&(n(" reportComponent "+i),e.reportComponent(i))},setRegistrationStatus:function(e){t=e},getSessionId:function(){if(t)return e.sessionId}}},MMSmartStreaming=function(){var t;return{createInstance:function(t){var e,i=Object.create((e=new MMSmartStreamingImpl,{getSDKVersion:function(){return e.getSDKVersion()},getRegistrationStatus:function(){return e.getRegistrationStatus()},getRegistrationStatusWithBackend:function(){return e.getRegistrationStatusWithBackend()},registerMMSmartStreaming:function(t,i,r,n,a,o,s,d){return e.registerMMSmartStreaming(t,i,r,n,a,o,s,d)},updateSubscriberID:function(t){return e.updateSubscriberID(t)},reportDeviceInfo:function(t,i,r,n,a,o,s,d){e.reportDeviceInfo(t,i,r,n,a,o,s,d)},reportPlayerInfo:function(t,i,r){e.reportPlayerInfo(t,i,r)},reportDeviceCapabilities:function(t){e.reportDeviceCapabilities(t)},reportAppInfo:function(t,i){e.reportAppInfo(t,i)},reportPlayerResolution:function(t){e.reportPlayerResolution(t)},reportVideoQuality:function(t){e.reportVideoQuality(t)},reportExperimentName:function(t){e.reportExperimentName(t)},reportSubPropertyId:function(t){e.reportSubPropertyId(t)},reportViewSessionId:function(t){e.reportViewSessionId(t)},reportBasePlayerInfo:function(t,i){e.reportBasePlayerInfo(t,i)},reportManifestLoaded:function(){e.reportManifestLoaded()},reportDeviceId:function(t){e.reportDeviceId(t)},initializeSession:function(t,i,r,n){return e.initializeSession(t,i,r,n)},setPresentationInformation:function(t){e.setPresentationInformation(t)},reportStreamInfo:function(t,i,r){e.reportStreamInfo(t,i,r)},reportNetworkInfo:function(t,i,r,n,a){e.reportNetworkInfo(t,i,r,n,a)},reportChunkRequest:function(t){e.reportChunkRequest(t)},reportDownloadRate:function(t){e.reportDownloadRate(t)},reportBufferLength:function(t){e.reportBufferLength(t)},reportCustomMetadata:function(t,i){e.reportCustomMetadata(t,i)},reportPlaybackPosition:function(t){e.reportPlaybackPosition(t)},reportNetworkType:function(t){e.reportNetworkType(t)},reportMetricValue:function(t,i){e.reportMetricValue(t,i)},reportBufferingStarted:function(){e.reportBufferingStarted()},reportBufferingCompleted:function(){e.reportBufferingCompleted()},reportEventWithValue:function(t,i){e.reportEventWithValue(t,i)},addCustomSegInfo:function(t){e.addCustomSegInfo(t)},reportUserInitiatedPlayback:function(){e.reportUserInitiatedPlayback()},reportPlayerState:function(t){e.reportPlayerState(t)},notifyPackager:function(t,i){e.notifyPackager(t,i)},setSESRequirements:function(t){e.setSESRequirements(t)},setSESURL:function(t){e.setSESURL(t)},reportABRSwitch:function(t,i){e.reportABRSwitch(t,i)},reportFrameLoss:function(t){e.reportFrameLoss(t)},reportPresentationSize:function(t,i){e.reportPresentationSize(t,i)},reportError:function(t,i){e.reportError(t,i)},reportPlayerSeekCompleted:function(t){e.reportPlayerSeekCompleted(t)},reportPlayerSeekStarted:function(){e.reportPlayerSeekStarted()},reportResolutionChange:function(t){e.reportResolutionChange(t)},reportVolumeChange:function(t){e.reportVolumeChange(t)},reportPlaybackRateChange:function(){e.reportPlaybackRateChange()},reportDurationChange:function(){e.reportDurationChange()},reportSDKVersion:function(t){e.reportSDKVersion(t)},reportWifiSSID:function(t){e.reportWifiSSID(t)},reportWifiSignalStrengthPercentage:function(t){e.reportWifiSignalStrenthPercentage(t)},reportWifiDataRate:function(t){e.reportWifiDataRate(t)},reportAdState:function(t){e.reportAdState(t)},reportAdInfo1:function(t,i,r,n,a,o,s,d){e.reportAdInfo(t,i,r,n,a,o,s,d)},reportAdInfo:function(t){e.reportAdInfo(t)},reportAdPlaybackTime:function(t){e.reportAdPlaybackTime(t)},reportAdError:function(t,i){e.reportAdError(t,i)},reportAdBufferingStarted:function(){e.reportAdBufferingStarted()},reportAdBufferingCompleted:function(){e.reportAdBufferingCompleted()},enableLogTrace:function(t){e.enableLogTrace(t)},updateSubscriber:function(t,i,r){return e.updateSubscriber(t,i,r)},setRegistrationStatus:function(t){e.setRegistrationStatus(t)},getSessionId:function(){return e.getSessionId()},reportTrackinfo:function(t,i,r,n,a){return e.reportTrackinfo(t,i,r,n,a)}}));return i.__dashjs_factory_name="MMSmartStreamingSdk",QBRFactoryMaker.setSingletonInstance(t,"MMSmartStreamingSdk",i),i},getInstance:function(e){if(void 0===e)return t||(t=this.createInstance(this));var i=QBRFactoryMaker.getSingletonInstance(e,"MMSmartStreamingSdk");return i||console.log("ERROR MMSDK Instance not created!"),i}}}(),mmStreamType=Object.freeze({DASH:"dash",HLS:"hls",MSS:"mss",MP4:"mp4"}),mmReactNativePlayerAdapter=function(){var t=Object.freeze({READY:0,PLAYING:1,PAUSED:2,STOPPED:3}),e=Object.freeze({IDLE:1,BUFFERING_STARTED:2,BUFFERING_COMPLETED:3}),i=Object.freeze({IDLE:1,SEEK_STARTED:2,SEEK_COMPLETED:3}),r=MMSmartStreaming.createInstance(this),n=!1,a=!1,o=void 0,s=void 0,d=e.IDLE,u=i.IDLE,h=!1,_=!1,f=void 0,p=void 0,c=function(){n=!1,a=!1,o=void 0,s=0,d=e.IDLE,u=i.IDLE};r.reportSDKVersion("RN_1.4.1");var S=function(t,e){if(!a){c(),console.log("MMSmartStreaming- "+r.getSDKVersion()),t&&""!==t||(t="NA"),p=t;var i=function(t){var e=[],i={assetId:null,assetName:null,contentType:null,drmProtection:null,episodeNumber:null,genre:null,season:null,seriesTitle:null,videoId:null,videoType:null};if(null!=t&&(t.assetId&&(i.assetId=t.assetId),t.assetName&&(i.assetName=t.assetName),t.videoId&&(i.videoId=t.videoId),t.contentType&&(i.contentType=t.contentType),t.drmProtection&&(i.drmProtection=t.drmProtection),t.episodeNumber&&(i.episodeNumber=t.episodeNumber),t.genre&&(i.genre=t.genre),t.season&&(i.season=t.season),t.seriesTitle&&(i.seriesTitle=t.seriesTitle),t.title&&(i.title=t.title),t.videoType&&(i.videoType=t.videoType),t.customTags))for(var r in t.customTags)e.push({key:r,attributeValue:t.customTags[r]});return{customMeta:e,contentMetadata:i}}(e),n=i.contentMetadata;if(r.initializeSession(MMQBRMode.QBRModeDisabled,t,"",n).catch((function(t){console.log("SDK Init Failed: "+t)})),i.customMeta&&i.customMeta.length)for(var o=0;o<i.customMeta.length;o++)r.reportCustomMetadata(i.customMeta[o].key,i.customMeta[o].attributeValue);if(!h){var s=P(t);r.reportStreamInfo(s,"",s),h=!0}a=!0}},l=function(){!1===n&&void 0===o&&(r.reportUserInitiatedPlayback(),o=t.READY,n=!0)},m=function(e){if(void 0!==o)switch(e!==MMPlayerState.PLAYING&&e!==MMPlayerState.PAUSED&&e!==MMPlayerState.STOPPED||I(),e){case MMPlayerState.PLAYING:r.reportPlayerState(MMPlayerState.PLAYING),o=t.PLAYING;break;case MMPlayerState.PAUSED:o!==t.READY&&o!==t.PLAYING||(r.reportPlayerState(MMPlayerState.PAUSED),o=t.PAUSED);break;case MMPlayerState.STOPPED:o!==t.STOPPED&&(r.reportPlayerState(MMPlayerState.STOPPED),o=t.STOPPED,c());break;default:console.log("Invalid State")}},I=function(){d===e.BUFFERING_STARTED&&(r.reportBufferingCompleted(),d=e.BUFFERING_COMPLETED)},P=function(t){var e;return t&&(-1!==t.indexOf(".m3u8")?e="HLS":-1!==t.indexOf(".mpd")?e="DASH":-1!==t.indexOf("/Manifest")?e="MSS":-1!==t.indexOf("mp4")&&(e="MP4")),e};return{registerMMSmartStreaming:function(t,e,i,n,a,o,s){r.getRegistrationStatus()||r.registerMMSmartStreaming(t,e,"HTML5JSSDK",i,n,a,o,s)},reportPlayerInfo:function(t,e,i){r.reportPlayerInfo(t,e,i)},reportBasePlayerInfo:function(t,e){r.reportBasePlayerInfo(t,e)},reportAppInfo:function(t,e){r.reportAppInfo(t,e)},reportExperimentName:function(t){r.reportExperimentName(t)},reportSubPropertyId:function(t){r.reportSubPropertyId(t)},reportViewSessionId:function(t){r.reportViewSessionId(t)},initialize:S,reportUserInitiatedPlayback:l,reportPresentationInfo:function(t,e,i){var n=MMPresentationInfo(t,e,i);r.setPresentationInformation(n),f=n},reportPlayerState:function(t){},reportBufferingStarted:function(){o!==t.PLAYING&&o!==t.PAUSED||d!==e.BUFFERING_STARTED&&(r.reportBufferingStarted(),d=e.BUFFERING_STARTED)},reportBufferingCompleted:I,reportPlayerSeekStarted:function(){o!==t.PLAYING&&o!==t.PAUSED||u!==i.SEEK_STARTED&&(r.reportPlayerSeekStarted(),u=i.SEEK_STARTED)},reportPlayerSeekCompleted:function(t){u===i.SEEK_STARTED&&(t||(t=s),r.reportPlayerSeekCompleted(t),u=i.SEEK_COMPLETED)},reportPlaybackPosition:function(t){if(t&&t>0){var e=Math.abs(t-s);e>240&&e<600&&I()}r.reportPlaybackPosition(t),s=t},reportDownloadRate:function(t){r.reportDownloadRate(t)},reportBandwidth:function(t){var e=MMChunkInformation(void 0,t,void 0,void 0,void 0,void 0,void 0,void 0);r.reportChunkRequest(e)},reportError:function(t){t&&r.reportError(t,s)},setDeviceInfo:function(t){t&&r.reportDeviceInfo(void 0,void 0,void 0,void 0,void 0,t,void 0,void 0)},reportDeviceId:function(t){t&&r.reportDeviceId(t)},reportCDN:function(t){t&&""!==t&&r.reportMetricValue(MMOverridableMetric.ServerAddress,t)},reportStreamInfo:function(t,e,i){r.reportStreamInfo(t,e,i),h=!0},enableLogTrace:function(t){null==t?t=!1:"boolean"==typeof t&&(_=t)},MMLog:function(t){_&&console.log("[MMLog] => "+t)},reportCustomMetadata:function(t,e){r.reportCustomMetadata(t,e)},addCustomSegInfo:function(t){r.addCustomSegInfo(t)},reportCustomPlayerState:m,updateAssetInfo:function(t){try{t&&a&&void 0!==o&&(m(MMPlayerState.STOPPED),c(),S(p,t),l(),r.setPresentationInformation(f),m(MMPlayerState.PLAYING))}catch(t){console.log("updateAssetInfo failed: "+t)}}}},AdapterSingletonClass=_createClass((function t(){return _classCallCheck(this,t),void 0===t.instance&&(t.instance=mmReactNativePlayerAdapter()),t.instance}));_defineProperty2(AdapterSingletonClass,"instance",void 0);var MMCustomAdapter=exports.MMCustomAdapter=function(){var t=new AdapterSingletonClass;return{reportPlayerState:function(e){t.MMLog("reportPlayerState called with playerState: "+e),t.reportCustomPlayerState(e)},updateAssetInfo:function(e){t.MMLog("updateAssetInfo called with mmAssetInfo: "+JSON.stringify(e)),t.updateAssetInfo(e)},reportCustomMetadata:function(e,i){t.reportCustomMetadata(e,i)},reportRendition:function(e){try{var i={};e.bitrate&&(i.cbrBitrate=e.bitrate),e.width&&e.height&&(i.res=e.width+"x"+e.height),e.frameRate&&(i.fps=Math.round(100*e.frameRate)/100),e.aCodec&&(i.aCodec=e.aCodec),e.vCodec&&(i.vCodec=e.vCodec),t.addCustomSegInfo(i)}catch(t){console.log("MMError:"+t.message)}}}};function RenditionInfo(){this.bitrate=void 0,this.width=void 0,this.height=void 0,this.frameRate=void 0,this.aCodec=void 0,this.vCodec=void 0}var MMReactNativeVideoSDK=exports.MMReactNativeVideoSDK=function(t){return function(e){var i=e.source,r=e.mmOptions,n=_objectWithoutProperties(e,_excluded),a=new AdapterSingletonClass,o=r.register,s=o.customerId,d=o.subscriberId,u=o.subscriberType,h=o.subscriberTag,_=o.hashSubscriberId,f=o.playerName,p=o.playerBrand,c=o.playerModel,S=o.playerVersion,l=o.basePlayerName,m=o.basePlayerVersion,I=o.domainName,P=o.applicationName,v=o.applicationVersion,E=o.deviceMarketingName,y=r.contentMetadata,b=y.assetName,T=y.assetId,D=y.videoId,M=y.contentType,R=y.genre,A=y.drmProtection,g=y.episodeNumber,C=y.season,N=y.seriesTitle,B=y.isLive,L=r.streamInfo,O=L.mediaType,x=L.streamFormat,k=L.sourceType,U=r.subPropertyId,F=r.experimentName,q=r.viewSessionId,w=r.customTags,V=r.deviceId,W=r.cdn,G=r.enableLogTrace,K={assetName:b,assetId:T,videoId:D,contentType:M,genre:R,drmProtection:A,episodeNumber:g,season:C,seriesTitle:N,customTags:w},Q="";i&&i.uri&&(Q=i.uri),(0,_react.useEffect)((function(){a.registerMMSmartStreaming(f,s,d,I,u,h,_),a.reportPlayerInfo(p,c,S),a.reportAppInfo(P,v),a.setDeviceInfo(E),a.reportExperimentName(F),a.reportSubPropertyId(U),a.reportBasePlayerInfo(l,m),a.reportDeviceId(V),a.enableLogTrace(G)}),[]);var z=function(t,e){return function(){t&&t.apply(void 0,arguments),e&&e.apply(void 0,arguments)}};return _react.default.createElement(t,_extends({source:i,reportBandwidth:!0},n,{onLoadStart:z((function(){a.MMLog("onLoadStart called with mediaURL: "+Q),a.reportViewSessionId(q),a.initialize(Q,K),a.reportUserInitiatedPlayback(),a.reportCDN(W),a.reportStreamInfo(x,O,k)}),n.onLoadStart),onLoad:z((function(t){if(a.MMLog("onLoad called with mediaURL: "+Q),t){var e=B;e||(e=!1);var i=1e3*t.duration;e&&(i=-1);var r=t.videoTracks,n=[];r&&Array.isArray(r)&&r.forEach((function(t,e){var i=MMRepresentation(e,t.bitrate,t.width,t.height,"");n.push(i)})),a.reportPresentationInfo(e,i,n)}}),n.onLoad),onPlaybackRateChange:z((function(t){a.MMLog("onPlaybackRateChange called with playbackRate: "+t.playbackRate),t&&(0===t.playbackRate?(a.MMLog("Player State Changed to PAUSED inside onPlaybackRateChange"),a.reportPlayerState(MMPlayerState.PAUSED)):t.playbackRate>0&&a.reportPlayerState(MMPlayerState.PLAYING))}),n.onPlaybackRateChange),onProgress:z((function(t){a.MMLog("onProgress called with currentTime: "+t.currentTime),a.reportPlaybackPosition(1e3*t.currentTime)}),n.onProgress),onBuffer:z((function(t){a.MMLog("onBuffer called with isBuffering: "+t.isBuffering),t.isBuffering&&a.reportBufferingStarted()}),n.onBuffer),onError:z((function(t){if(a.MMLog("onError called with error: "+JSON.stringify(t)),t){var e=t.error||{},i="";e.errorCode&&(i+=e.errorCode+"_"),i+=(e.errorString||"Unknown Error")+"_",i+=JSON.stringify(e),a.reportError(i)}}),n.onError),onEnd:z((function(){a.MMLog("onEnd called"),a.reportPlayerState(MMPlayerState.STOPPED)}),n.onEnd),onBandwidthUpdate:z((function(t){a.MMLog("onBandwidthUpdate called with bitrate: "+t.bitrate),t.bitrate&&t.bitrate>0&&a.reportDownloadRate(t.bitrate)}),n.onBandwidthUpdate)}))}};
|