@mux/mux-audio 0.8.1 → 0.9.0
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.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +3 -3
- package/dist/mux-audio.js +8 -8
- package/dist/mux-audio.js.map +3 -3
- package/dist/mux-audio.mjs +8 -8
- package/dist/mux-audio.mjs.map +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/mux-audio.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var Ji=Object.create;var Vr=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var en=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty;var Yr=(j,R)=>()=>(R||j((R={exports:{}}).exports,R),R.exports);var rn=(j,R,l,P)=>{if(R&&typeof R=="object"||typeof R=="function")for(let L of qi(R))!tn.call(j,L)&&L!==l&&Vr(j,L,{get:()=>R[L],enumerable:!(P=Zi(R,L))||P.enumerable});return j};var sr=(j,R,l)=>(l=j!=null?Ji(en(j)):{},rn(R||!j||!j.__esModule?Vr(l,"default",{value:j,enumerable:!0}):l,j));var Dr=(j,R,l)=>{if(!R.has(j))throw TypeError("Cannot "+l)};var ze=(j,R,l)=>(Dr(j,R,"read from private field"),l?l.call(j):R.get(j)),lt=(j,R,l)=>{if(R.has(j))throw TypeError("Cannot add the same private member more than once");R instanceof WeakSet?R.add(j):R.set(j,l)},ut=(j,R,l,P)=>(Dr(j,R,"write to private field"),P?P.call(j,l):R.set(j,l),l);var At=(j,R,l)=>(Dr(j,R,"access private method"),l);var Qr=Yr((or,br)=>{(function(){var j,R;j=this,R=function(){return function(){var l={80:function(A,M,O){A.exports=O(728).default},728:function(A,M,O){"use strict";O.d(M,{default:function(){return $i}});var b=O(48),_=O.n(b),y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(w){var C=16*Math.random()|0;return(w==="x"?C:3&C|8).toString(16)})},x=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)},D=function(w){return w&&w.nodeName!==void 0?(w.muxId||(w.muxId=w.id||x()),w.muxId):w},E=function(w){var C;w&&w.nodeName!==void 0?w=D(C=w):C=document.querySelector(w);var F=C&&C.nodeName?C.nodeName.toLowerCase():"";return[C,w,F]},m=O(640),p=O.n(m),f=p().methodFactory;p().methodFactory=function(w,C,F){var N=f(w,C,F);return function(){for(var K=["[mux]"],V=0;V<arguments.length;V++)K.push(arguments[V]);N.apply(void 0,K)}},p().setLevel(p().getLevel());var e=p();function s(){return(_().doNotTrack||_().navigator&&_().navigator.doNotTrack)==="1"}var h={now:function(){var w=_().performance,C=w&&w.timing,F=w&&w.timeOrigin||C&&C.navigationStart;return typeof F=="number"&&typeof w.now=="function"?F+w.now():Date.now()}},g=O(678),i=O.n(g),r=function(w){return o(w)[0]},o=function(w){if(typeof w!="string"||w==="")return["localhost"];var C,F=(w.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/)||[])[4];return F&&(C=(F.match(/[^\.]+\.[^\.]+$/)||[])[0]),[F,C]},c={exists:function(){var w=_().performance;return(w&&w.timing)!==void 0},domContentLoadedEventEnd:function(){var w=_().performance,C=w&&w.timing;return C&&C.domContentLoadedEventEnd},navigationStart:function(){var w=_().performance,C=w&&w.timing;return C&&C.navigationStart}};function t(w,C,F){F=F===void 0?1:F,w[C]=w[C]||0,w[C]+=F}var n=["x-cdn","content-type","x-request-id"];function u(w){var C={};return(w=w||"").trim().split(/[\r\n]+/).forEach(function(F){if(F){var N=F.split(": "),K=N.shift();K&&(n.indexOf(K.toLowerCase())>=0||K.toLowerCase().indexOf("x-litix-")===0)&&(C[K]=N.join(": "))}}),C}var a=function(w){var C={};for(var F in w){var N=w[F];N["DATA-ID"].search("io.litix.data.")!==-1&&(C[N["DATA-ID"].replace("io.litix.data.","")]=N.VALUE)}return C};function d(w,C){var F=Object.keys(w);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(w);C&&(N=N.filter(function(K){return Object.getOwnPropertyDescriptor(w,K).enumerable})),F.push.apply(F,N)}return F}function v(w){for(var C=1;C<arguments.length;C++){var F=arguments[C]!=null?arguments[C]:{};C%2?d(Object(F),!0).forEach(function(N){S(w,N,F[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(F)):d(Object(F)).forEach(function(N){Object.defineProperty(w,N,Object.getOwnPropertyDescriptor(F,N))})}return w}function S(w,C,F){return C in w?Object.defineProperty(w,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):w[C]=F,w}var T=function(w){if(!w)return{};var C=c.navigationStart(),F=w.loading,N=F?F.start:w.trequest,K=F?F.first:w.tfirst,V=F?F.end:w.tload;return{bytesLoaded:w.total,requestStart:Math.round(C+N),responseStart:Math.round(C+K),responseEnd:Math.round(C+V)}},I=function(w){if(w&&typeof w.getAllResponseHeaders=="function")return u(w.getAllResponseHeaders())},k=function(w,C){if(!w||typeof w.getRequests!="function")return{};var F=w.getRequests({state:"executed"});if(F.length===0)return{};var N,K=F[F.length-1],V=r(K.url),H=K.bytesLoaded,Q=new Date(K.requestStartDate).getTime(),J=new Date(K.firstByteDate).getTime(),X=new Date(K.requestEndDate).getTime(),ee=isNaN(K.duration)?0:K.duration,ce=typeof C.getMetricsFor=="function"?C.getMetricsFor(K.mediaType).HttpList:C.getDashMetrics().getHttpRequests(K.mediaType);return ce.length>0&&(N=u(ce[ce.length-1]._responseHeaders||"")),{requestStart:Q,requestResponseStart:J,requestResponseEnd:X,requestBytesLoaded:H,requestResponseHeaders:N,requestMediaDuration:ee,requestHostname:V}},B=function(w,C){var F=C.getQualityFor(w),N=C.getCurrentTrackFor(w).bitrateList;return N?{currentLevel:F,renditionWidth:N[F].width||null,renditionHeight:N[F].height||null,renditionBitrate:N[F].bandwidth}:{}};function U(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var W=0,G=function(){function w(){(function(K,V){if(!(K instanceof V))throw new TypeError("Cannot call a class as a function")})(this,w)}var C,F,N;return C=w,F=[{key:"on",value:function(K,V,H){return V._eventEmitterGuid=V._eventEmitterGuid||++W,this._listeners=this._listeners||{},this._listeners[K]=this._listeners[K]||[],H&&(V=V.bind(H)),this._listeners[K].push(V),V}},{key:"off",value:function(K,V){var H=this._listeners&&this._listeners[K];H&&H.forEach(function(Q,J){Q._eventEmitterGuid===V._eventEmitterGuid&&H.splice(J,1)})}},{key:"one",value:function(K,V,H){var Q=this;V._eventEmitterGuid=V._eventEmitterGuid||++W;var J=function X(){Q.off(K,X),V.apply(H||this,arguments)};J._eventEmitterGuid=V._eventEmitterGuid,this.on(K,J)}},{key:"emit",value:function(K,V){var H=this;if(this._listeners){V=V||{};var Q=this._listeners["before*"]||[],J=this._listeners[K]||[],X=this._listeners["after"+K]||[],ee=function(ce,ye){(ce=ce.slice()).forEach(function(ve){ve.call(H,{type:K},ye)})};ee(Q,V),ee(J,V),ee(X,V)}}}],F&&U(C.prototype,F),N&&U(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}(),z=G;function Y(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var $=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,K.on("playing",function(){V._playheadShouldBeProgressing=!0}),K.on("play",this._startPlaybackHeartbeatInterval.bind(this)),K.on("playing",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adbreakstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adplay",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adplaying",this._startPlaybackHeartbeatInterval.bind(this)),K.on("seeking",this._startPlaybackHeartbeatInterval.bind(this)),K.on("devicewake",this._startPlaybackHeartbeatInterval.bind(this)),K.on("viewstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("rebufferstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("pause",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("ended",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("viewend",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("error",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("aderror",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adpause",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adended",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adbreakend",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("seeked",function(){K.data.player_is_paused?V._stopPlaybackHeartbeatInterval():V._startPlaybackHeartbeatInterval()}),K.on("timeupdate",function(){V._playbackHeartbeatInterval!==null&&K.emit("playbackheartbeat")}),K.on("devicesleep",function(H,Q){V._playbackHeartbeatInterval!==null&&(_().clearInterval(V._playbackHeartbeatInterval),K.emit("playbackheartbeatend",{viewer_time:Q.viewer_time}),V._playbackHeartbeatInterval=null)})}var C,F,N;return C=w,(F=[{key:"_startPlaybackHeartbeatInterval",value:function(){var K=this;this._playbackHeartbeatInterval===null&&(this.pm.emit("playbackheartbeat"),this._playbackHeartbeatInterval=_().setInterval(function(){K.pm.emit("playbackheartbeat")},this.pm.playbackHeartbeatTime))}},{key:"_stopPlaybackHeartbeatInterval",value:function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(_().clearInterval(this._playbackHeartbeatInterval),this.pm.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)}}])&&Y(C.prototype,F),N&&Y(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Z(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function q(w,C,F){return C&&Z(w.prototype,C),F&&Z(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var ie=q(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("viewinit",function(){F.viewErrored=!1}),C.on("error",function(){try{var N=C.errorTranslator({player_error_code:C.data.player_error_code,player_error_message:C.data.player_error_message});N?(C.data.player_error_code=N.player_error_code,C.data.player_error_message=N.player_error_message,F.viewErrored=!0):(delete C.data.player_error_code,delete C.data.player_error_message)}catch(K){C.mux.log.warn("Exception in error translator callback.",K),F.viewErrored=!0}})});function ne(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var ae=function(){function w(K){(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._watchTimeTrackerLastCheckedTime=null,K.on("playbackheartbeat",this._updateWatchTime.bind(this)),K.on("playbackheartbeatend",this._clearWatchTimeState.bind(this))}var C,F,N;return C=w,(F=[{key:"_updateWatchTime",value:function(K,V){var H=V.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=H),t(this.pm.data,"view_watch_time",H-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=H}},{key:"_clearWatchTimeState",value:function(K,V){this._updateWatchTime(K,V),this._watchTimeTrackerLastCheckedTime=null}}])&&ne(C.prototype,F),N&&ne(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function te(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var fe=function(){function w(K){(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._playbackTimeTrackerLastPlayheadPosition=-1,K.on("playbackheartbeat",this._updatePlaybackTime.bind(this)),K.on("playbackheartbeatend",this._clearPlaybackTimeState.bind(this)),K.on("seeking",this._clearPlaybackTimeState.bind(this))}var C,F,N;return C=w,(F=[{key:"_updatePlaybackTime",value:function(){var K=this.pm.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&K>this._playbackTimeTrackerLastPlayheadPosition){var V=K-this._playbackTimeTrackerLastPlayheadPosition;V<=1e3&&t(this.pm.data,"view_content_playback_time",V)}this._playbackTimeTrackerLastPlayheadPosition=K}},{key:"_clearPlaybackTimeState",value:function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1}}])&&te(C.prototype,F),N&&te(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function de(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var re=function(){function w(K){(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K;var V=this._updatePlayheadTime.bind(this);K.on("playbackheartbeat",V),K.on("playbackheartbeatend",V),K.on("timeupdate",V),K.on("destroy",function(){K.off("timeupdate",V)})}var C,F,N;return C=w,(F=[{key:"_updateMaxPlayheadPosition",value:function(){this.pm.data.view_max_playhead_position=this.pm.data.view_max_playhead_position===void 0?this.pm.data.player_playhead_time:Math.max(this.pm.data.view_max_playhead_position,this.pm.data.player_playhead_time)}},{key:"_updatePlayheadTime",value:function(K,V){var H=this,Q=function(){H.pm.currentFragmentPDT&&H.pm.currentFragmentStart&&(H.pm.data.player_program_time=H.pm.currentFragmentPDT+H.pm.data.player_playhead_time-H.pm.currentFragmentStart)};if(V&&V.player_playhead_time)this.pm.data.player_playhead_time=V.player_playhead_time,Q(),this._updateMaxPlayheadPosition();else if(this.pm.getPlayheadTime){var J=this.pm.getPlayheadTime();J!==void 0&&(this.pm.data.player_playhead_time=J,Q(),this._updateMaxPlayheadPosition())}}}])&&de(C.prototype,F),N&&de(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Ee(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function me(w,C,F){return C&&Ee(w.prototype,C),F&&Ee(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Te=me(function w(C){if(function(K,V){if(!(K instanceof V))throw new TypeError("Cannot call a class as a function")}(this,w),!C.disableRebufferTracking){var F,N=function(){if(F){var K=C.data.viewer_time-F;t(C.data,"view_rebuffer_duration",K),F=C.data.viewer_time}C.data.view_watch_time>=0&&C.data.view_rebuffer_count>0&&(C.data.view_rebuffer_frequency=C.data.view_rebuffer_count/C.data.view_watch_time,C.data.view_rebuffer_percentage=C.data.view_rebuffer_duration/C.data.view_watch_time)};C.on("playbackheartbeat",function(){return N()}),C.on("rebufferstart",function(){F||(t(C.data,"view_rebuffer_count",1),F=C.data.viewer_time,C.one("rebufferend",function(){N(),F=void 0}))})}});function Me(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var _e=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.disableRebufferTracking||K.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,K.on("playbackheartbeat",this._checkIfRebuffering.bind(this)),K.on("playbackheartbeatend",this._cleanupRebufferTracker.bind(this)),K.on("seeking",function(){V._cleanupRebufferTracker(null,{viewer_time:h.now()})}))}var C,F,N;return C=w,F=[{key:"_checkIfRebuffering",value:function(K,V){if(this.pm.seekingTracker.isSeeking||this.pm.adTracker.isAdBreak||!this.pm.playbackHeartbeat._playheadShouldBeProgressing)this._cleanupRebufferTracker(K,V);else if(this._lastCheckedTime!==null)if(this._lastPlayheadTime===this.pm.data.player_playhead_time){var H=V.viewer_time-this._lastPlayheadTimeUpdatedTime;typeof this.pm.sustainedRebufferThreshold=="number"&&H>=this.pm.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),this._lastCheckedTime=V.viewer_time}else this._cleanupRebufferTracker(K,V,!0);else this._prepareRebufferTrackerState(V.viewer_time)}},{key:"_clearRebufferTrackerState",value:function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null}},{key:"_prepareRebufferTrackerState",value:function(K){this._lastCheckedTime=K,this._lastPlayheadTime=this.pm.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=K}},{key:"_cleanupRebufferTracker",value:function(K,V){var H=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.pm.emit("rebufferend",{viewer_time:V.viewer_time});else{if(this._lastCheckedTime===null)return;var Q=this.pm.data.player_playhead_time-this._lastPlayheadTime,J=V.viewer_time-this._lastPlayheadTimeUpdatedTime;typeof this.pm.minimumRebufferDuration=="number"&&Q>0&&J-Q>this.pm.minimumRebufferDuration&&(this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.pm.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+J-Q}))}H?this._prepareRebufferTrackerState(V.viewer_time):this._clearRebufferTrackerState()}}],F&&Me(C.prototype,F),N&&Me(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}(),ke=_e;function Ie(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var Be=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.on("viewinit",function(){var H=K.data,Q=H.view_id;if(!H.view_program_changed){var J=function(X,ee){var ce=ee.viewer_time;X.type==="playing"&&K.data.view_time_to_first_frame===void 0?V.calculateTimeToFirstFrame(ce||h.now(),Q):X.type!=="adplaying"||K.data.view_time_to_first_frame!==void 0&&!V._inPrerollPosition()||V.calculateTimeToFirstFrame(ce||h.now(),Q)};K.one("playing",J),K.one("adplaying",J),K.one("viewend",function(){K.off("playing",J),K.off("adplaying",J)})}})}var C,F,N;return C=w,(F=[{key:"_inPrerollPosition",value:function(){return this.pm.data.view_content_playback_time===void 0||this.pm.data.view_content_playback_time<=1e3}},{key:"calculateTimeToFirstFrame",value:function(K,V){V===this.pm.data.view_id&&(this.pm.watchTimeTracker._updateWatchTime(null,{viewer_time:K}),this.pm.data.view_time_to_first_frame=this.pm.data.view_watch_time,(this.pm.data.player_autoplay_on||this.pm.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.pm.data.view_aggregate_startup_time=this.pm.data.view_start+this.pm.data.view_watch_time-this.NAVIGATION_START))}}])&&Ie(C.prototype,F),N&&Ie(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function be(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ue(w,C,F){return C&&be(w.prototype,C),F&&be(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Ke=Ue(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("viewinit",function(){F._lastPlayheadPosition=-1}),["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach(function(N){C.on(N,function(){if(F._lastPlayheadPosition>=0&&C.data.player_playhead_time>=0&&F._lastPlayerWidth>=0&&F._lastSourceWidth>0&&F._lastPlayerHeight>=0&&F._lastSourceHeight>0){var K=C.data.player_playhead_time-F._lastPlayheadPosition;if(K<0)return void(F._lastPlayheadPosition=-1);var V=Math.min(F._lastPlayerWidth/F._lastSourceWidth,F._lastPlayerHeight/F._lastSourceHeight),H=Math.max(0,V-1),Q=Math.max(0,1-V);C.data.view_max_upscale_percentage=Math.max(C.data.view_max_upscale_percentage||0,H),C.data.view_max_downscale_percentage=Math.max(C.data.view_max_downscale_percentage||0,Q),t(C.data,"view_total_content_playback_time",K),t(C.data,"view_total_upscaling",H*K),t(C.data,"view_total_downscaling",Q*K)}F._lastPlayheadPosition=-1})}),["playing","hb"].forEach(function(N){C.on(N,function(){F._lastPlayheadPosition=C.data.player_playhead_time,F._lastPlayerWidth=C.data.player_width,F._lastPlayerHeight=C.data.player_height,F._lastSourceWidth=C.data.video_source_width,F._lastSourceHeight=C.data.video_source_height})})});function je(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ne(w,C,F){return C&&je(w.prototype,C),F&&je(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var et=Ne(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),this.isSeeking=!1,C.on("seeking",function(N,K){i()(C.data,K),F._lastSeekingTime=h.now(),F.isSeeking===!1&&(F.isSeeking=!0,C.send("seeking"))}),C.on("seeked",function(){F.isSeeking=!1;var N=F._lastSeekingTime||h.now(),K=h.now()-N;t(C.data,"view_seek_count",1),t(C.data,"view_seek_duration",K);var V=C.data.view_max_seek_time||0;C.data.view_max_seek_time=Math.max(V,K)}),C.on("viewend",function(){F.isSeeking=!1})});function Fe(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return tt(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?tt(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function tt(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}function Oe(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var Pe=function(w,C){w.push(C),w.sort(function(F,N){return F.viewer_time-N.viewer_time})},Ve=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],Ce=function(){function w(K){var V=this;(function(Q,J){if(!(Q instanceof J))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.on("viewinit",function(){V.isAdBreak=!1,V._currentAdRequestNumber=0,V._currentAdResponseNumber=0,V._adRequests=[],V._adResponses=[],V._adHasPlayed=!1,V._wouldBeNewAdPlay=!0,V._prerollPlayTime=void 0}),Ve.forEach(function(Q){return K.on(Q,V._updateAdData.bind(V))});var H=function(){V.isAdBreak=!1};K.on("adbreakstart",function(){V.isAdBreak=!0}),K.on("play",H),K.on("playing",H),K.on("viewend",H),K.on("adrequest",function(Q,J){J=i()({ad_request_id:"generatedAdRequestId"+V._currentAdRequestNumber++},J),Pe(V._adRequests,J),t(K.data,"view_ad_request_count"),V.inPrerollPosition()&&(K.data.view_preroll_requested=!0,V._adHasPlayed||t(K.data,"view_preroll_request_count"))}),K.on("adresponse",function(Q,J){J=i()({ad_request_id:"generatedAdRequestId"+V._currentAdResponseNumber++},J),Pe(V._adResponses,J);var X=V.findAdRequest(J.ad_request_id);X&&t(K.data,"view_ad_request_time",Math.max(0,J.viewer_time-X.viewer_time))}),K.on("adplay",function(Q,J){V._adHasPlayed=!0,V._wouldBeNewAdPlay&&(V._wouldBeNewAdPlay=!1,t(K.data,"view_ad_played_count")),V.inPrerollPosition()&&!K.data.view_preroll_played&&(K.data.view_preroll_played=!0,V._adRequests.length>0&&(K.data.view_preroll_request_time=Math.max(0,J.viewer_time-V._adRequests[0].viewer_time)),K.data.view_start&&(K.data.view_startup_preroll_request_time=Math.max(0,J.viewer_time-K.data.view_start)),V._prerollPlayTime=J.viewer_time)}),K.on("adplaying",function(Q,J){V.inPrerollPosition()&&K.data.view_preroll_load_time===void 0&&V._prerollPlayTime!==void 0&&(K.data.view_preroll_load_time=J.viewer_time-V._prerollPlayTime,K.data.view_startup_preroll_load_time=J.viewer_time-V._prerollPlayTime)}),K.on("adended",function(){V._wouldBeNewAdPlay=!0}),K.on("aderror",function(){V._wouldBeNewAdPlay=!0})}var C,F,N;return C=w,(F=[{key:"inPrerollPosition",value:function(){return this.pm.data.view_content_playback_time===void 0||this.pm.data.view_content_playback_time<=1e3}},{key:"findAdRequest",value:function(K){for(var V=0;V<this._adRequests.length;V++)if(this._adRequests[V].ad_request_id===K)return this._adRequests[V]}},{key:"_updateAdData",value:function(K,V){if(this.inPrerollPosition()){if(!this.pm.data.view_preroll_ad_tag_hostname&&V.ad_tag_url){var H=Fe(o(V.ad_tag_url),2),Q=H[0],J=H[1];this.pm.data.view_preroll_ad_tag_domain=J,this.pm.data.view_preroll_ad_tag_hostname=Q}if(!this.pm.data.view_preroll_ad_asset_hostname&&V.ad_asset_url){var X=Fe(o(V.ad_asset_url),2),ee=X[0],ce=X[1];this.pm.data.view_preroll_ad_asset_domain=ce,this.pm.data.view_preroll_ad_asset_hostname=ee}}}}])&&Oe(C.prototype,F),N&&Oe(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Le(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function nt(w,C,F){return C&&Le(w.prototype,C),F&&Le(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var We=nt(function w(C){var F,N;(function(Q,J){if(!(Q instanceof J))throw new TypeError("Cannot call a class as a function")})(this,w);var K=function(){C.disableRebufferTracking||F&&(t(C.data,"view_waiting_rebuffer_duration",h.now()-F),F=!1,_().clearInterval(N))},V=!1,H=function(){V=!1,K()};C.on("waiting",function(){V&&(C.disableRebufferTracking||(t(C.data,"view_waiting_rebuffer_count",1),F=h.now(),N=_().setInterval(function(){if(F){var Q=h.now();t(C.data,"view_waiting_rebuffer_duration",Q-F),F=Q}},250)))}),C.on("playing",function(){K(),V=!0}),C.on("pause",H),C.on("seeking",H)});function ft(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function yt(w,C,F){return C&&ft(w.prototype,C),F&&ft(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Qe=yt(function w(C){var F=this;(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w);var N=function(){F.lastWallClockTime=h.now(),C.on("before*",K)},K=function(V){var H=h.now(),Q=F.lastWallClockTime;F.lastWallClockTime=H,H-Q>3e4&&(C.emit("devicesleep",{viewer_time:Q}),i()(C.data,{viewer_time:Q}),C.send("devicesleep"),C.emit("devicewake",{viewer_time:H}),i()(C.data,{viewer_time:H}),C.send("devicewake"))};C.one("playbackheartbeat",N),C.on("playbackheartbeatend",function(){C.off("before*",K),C.one("playbackheartbeat",N)})}),Ot=O(375),Tt=O(655),at=O.n(Tt),dt="muxData",st=function(){var w;try{w=Ot.parse(at().get(dt)||"")}catch{w={}}return w},xt=function(w){try{at().set(dt,Ot.stringify(w),{expires:7300})}catch{}},Et=function(){var w=st();return w.mux_viewer_id=w.mux_viewer_id||y(),w.msn=w.msn||Math.random(),xt(w),{mux_viewer_id:w.mux_viewer_id,mux_sample_number:w.msn}};function cr(w,C){var F=C.beaconCollectionDomain,N=C.beaconDomain;if(F)return"https://"+F;var K=N||"litix.io";return(w=w||"inferred").match(/^[a-z0-9]+$/)?"https://"+w+"."+K:"https://img.litix.io/a.gif"}var Ut=function(){var w;switch(Rt()){case"cellular":w="cellular";break;case"ethernet":w="wired";break;case"wifi":w="wifi";break;case void 0:break;default:w="other"}return w},Rt=function(){var w=_().navigator,C=w&&(w.connection||w.mozConnection||w.webkitConnection);return C&&C.type};Ut.getConnectionFromAPI=Rt;var $e=Ut,er=tr({a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"}),Nt=tr({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cd:"code",cg:"category",ch:"changed",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fi:"first",fm:"family",ft:"format",fp:"fps",fq:"frequency",fr:"frame",fs:"fullscreen",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"});function tr(w){var C={};for(var F in w)w.hasOwnProperty(F)&&(C[w[F]]=F);return C}function Kt(w){var C={},F={};return Object.keys(w).forEach(function(N){var K=!1;if(w.hasOwnProperty(N)&&w[N]!==void 0){var V=N.split("_"),H=V[0],Q=er[H];Q||(e.info("Data key word `"+V[0]+"` not expected in "+N),Q=H+"_"),V.splice(1).forEach(function(J){J==="url"&&(K=!0),Nt[J]?Q+=Nt[J]:Number(J)&&Math.floor(Number(J))===Number(J)?Q+=J:(e.info("Data key word `"+J+"` not expected in "+N),Q+="_"+J+"_")}),K?F[Q]=w[N]:C[Q]=w[N]}}),i()(C,F)}var hr={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},vr=["hb","requestcompleted","requestfailed","requestcanceled"],ot=function(w,C){this._beaconUrl=w||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=i()({},hr,C)};ot.prototype.queueEvent=function(w,C){var F=i()({},C);return(this._eventQueue.length<=this._options.maxQueueLength||w==="eventrateexceeded")&&(this._eventQueue.push(F),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength)},ot.prototype.flushEvents=function(){this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending()},ot.prototype.destroy=function(){var w=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,w?this._clearBeaconQueue():this.flushEvents(),_().clearTimeout(this._sendTimeout)},ot.prototype._clearBeaconQueue=function(){var w=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,C=this._eventQueue.slice(w);w>0&&i()(C[C.length-1],Kt({mux_view_message:"event queue truncated"}));var F=this._createPayload(C);It(this._beaconUrl,F,!0,function(){})},ot.prototype._sendBeaconQueue=function(){var w=this;if(!this._postInFlight){var C=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0;var F=this._createPayload(C),N=h.now();It(this._beaconUrl,F,!1,function(K,V){V?(w._eventQueue=C.concat(w._eventQueue),w._failureCount+=1,e.info("Error sending beacon: "+V)):w._failureCount=0,w._roundTripTime=h.now()-N,w._postInFlight=!1})}},ot.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var w=Math.pow(2,this._failureCount-1);return(1+(w*=Math.random()))*this._options.baseTimeBetweenBeacons},ot.prototype._startBeaconSending=function(){var w=this;_().clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=_().setTimeout(function(){w._eventQueue.length&&w._sendBeaconQueue(),w._startBeaconSending()},this._getNextBeaconTime()))},ot.prototype._createPayload=function(w){var C,F,N,K=this,V={transmission_timestamp:Math.round(h.now())};this._roundTripTime&&(V.rtt_ms=Math.round(this._roundTripTime));var H=function(){C=JSON.stringify({metadata:V,events:F||w}),N=C.length/1024},Q=function(){return N<=K._options.maxPayloadKBSize};return H(),Q()||(e.info("Payload size is too big ("+N+" kb). Removing unnecessary events."),F=w.filter(function(J){return vr.indexOf(J.e)===-1}),H()),Q()||(e.info("Payload size still too big ("+N+" kb). Cropping fields.."),F.forEach(function(J){for(var X in J){var ee=J[X];typeof ee=="string"&&ee.length>51200&&(J[X]=ee.substring(0,51200))}}),H()),C};var It=function(w,C,F,N){if(F&&navigator&&navigator.sendBeacon&&navigator.sendBeacon(w,C))N();else if(_().fetch)_().fetch(w,{method:"POST",body:C,headers:{"Content-Type":"text/plain"},keepalive:!0}).then(function(V){return N(null,V.ok?null:"Error")}).catch(function(V){return N(null,V)});else{if(_().XMLHttpRequest){var K=new(_()).XMLHttpRequest;return K.onreadystatechange=function(){if(K.readyState===4)return N(null,K.status!==200?"error":void 0)},K.open("POST",w),K.setRequestHeader("Content-Type","text/plain"),void K.send(C)}N()}},rr=ot;function St(w){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},St(w)}var gr=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],Ei=["viewstart","error","ended","viewend"],ir=function(w,C){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=w,this.envKey=C,this.eventQueue=new rr(cr(C,F)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=F.sampleRate,this.disableCookies=F.disableCookies,this.respectDoNotTrack=F.respectDoNotTrack;var N=F.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:N.name,viewer_application_version:N.version,viewer_application_engine:N.layout,viewer_device_name:N.product,viewer_device_category:"",viewer_device_manufacturer:N.manufacturer,viewer_os_family:N.os&&N.os.family,viewer_os_architecture:N.os&&N.os.architecture,viewer_os_version:N.os&&N.os.version};var K=$e();K&&(this.pageLevelData=i()(this.pageLevelData,{viewer_connection_type:K})),_()!==void 0&&_().location&&_().location.href&&(this.pageLevelData.page_url=_().location.href),this.viewerData=this.disableCookies?{}:Et()};ir.prototype.send=function(w,C){if(w){if(this.respectDoNotTrack&&s())return e.info("Not sending `"+w+"` because Do Not Track is enabled");if(!C||St(C)!=="object")return e.error("A data object was expected in send() but was not provided");var F,N,K=this.disableCookies?{}:(F=st(),N=h.now(),F.session_start&&(F.sst=F.session_start,delete F.session_start),F.session_id&&(F.sid=F.session_id,delete F.session_id),F.session_expires&&(F.sex=F.session_expires,delete F.session_expires),(!F.sex||F.sex<N)&&(F.sid=y(),F.sst=N),F.sex=N+15e5,xt(F),{session_id:F.sid,session_start:F.sst,session_expires:F.sex}),V={};i()(V,this.pageLevelData),i()(V,C),i()(V,K),i()(V,this.viewerData),V.event=w,V.env_key=this.envKey,V.user_id&&(V.viewer_user_id=V.user_id,delete V.user_id);var H=V.mux_sample_number>=this.sampleRate,Q=Kt(this._deduplicateBeaconData(w,V));if(this.lastEventTime=this.mux.utils.now(),H)return e.info("Not sending event due to sample rate restriction",w,V,Q);if(this.envKey||e.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",w,V,Q),!this.rateLimited){if(e.info("Sending event",w,V,Q),this.rateLimited=!this.eventQueue.queueEvent(w,Q),this.mux.WINDOW_UNLOADING&&w==="viewend")this.eventQueue.destroy(!0);else if((Ei.indexOf(w)>=0||this.mux.WINDOW_HIDDEN&&w==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return V.event="eventrateexceeded",Q=Kt(V),this.eventQueue.queueEvent(V.event,Q),e.error("Beaconing disabled due to rate limit.")}}},ir.prototype.destroy=function(){this.eventQueue.destroy(!1)},ir.prototype._deduplicateBeaconData=function(w,C){var F=this,N={},K=C.view_id;if(!K||w==="viewstart"||w==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)N=i()({},C),K&&(this.previousBeaconData=N),K&&w==="viewend"&&(this.previousBeaconData=null);else{var V=w.indexOf("request")===0;Object.keys(C).forEach(function(H){var Q=C[H];(Q!==F.previousBeaconData[H]||gr.indexOf(H)>-1||function(J,X,ee,ce){return!(!J||X.indexOf("request_")!==0||X!=="request_response_headers"&&St(ee)==="object"&&St(ce)==="object"&&Object.keys(ee||{}).length===Object.keys(ce||{}).length)}(V,H,Q,F.previousBeaconData[H])||function(J,X){return J==="renditionchange"&&X.indexOf("video_source_")===0}(w,H))&&(N[H]=Q,F.previousBeaconData[H]=Q)})}return N};var yi=ir;function Br(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ti(w,C,F){return C&&Br(w.prototype,C),F&&Br(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var xi=Ti(function w(C){(function(X,ee){if(!(X instanceof ee))throw new TypeError("Cannot call a class as a function")})(this,w);var F=0,N=0,K=0,V=0,H=0,Q=0,J=0;C.on("requestcompleted",function(X,ee){var ce,ye,ve=ee.request_start,se=ee.request_response_start,le=ee.request_response_end,xe=ee.request_bytes_loaded;if(V++,se?(ce=se-ve,ye=le-se):ye=le-ve,ye>0&&xe>0){var Ye=xe/ye*8e3;H++,N+=xe,K+=ye,C.data.view_min_request_throughput=Math.min(C.data.view_min_request_throughput||1/0,Ye),C.data.view_average_request_throughput=N/K*8e3,C.data.view_request_count=V,ce>0&&(F+=ce,C.data.view_max_request_latency=Math.max(C.data.view_max_request_latency||0,ce),C.data.view_average_request_latency=F/H)}}),C.on("requestfailed",function(X,ee){V++,Q++,C.data.view_request_count=V,C.data.view_request_failed_count=Q}),C.on("requestcanceled",function(X,ee){V++,J++,C.data.view_request_count=V,C.data.view_request_canceled_count=J})});function Ur(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Si(w,C,F){return C&&Ur(w.prototype,C),F&&Ur(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Di=Si(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("before*",function(N,K){var V=K.viewer_time,H=h.now(),Q=F._lastEventTime;if(F._lastEventTime=H,Q&&H-Q>36e5){var J=Object.keys(C.data).reduce(function(X,ee){return ee.indexOf("video_")===0?i()(X,function(ce,ye,ve){return ye in ce?Object.defineProperty(ce,ye,{value:ve,enumerable:!0,configurable:!0,writable:!0}):ce[ye]=ve,ce}({},ee,C.data[ee])):X},{});C.mux.log.info("Received event after at least an hour inactivity, creating a new view"),C.emit("viewinit",i()({viewer_time:V},J)),C.playbackHeartbeat._playheadShouldBeProgressing&&N.type!=="play"&&N.type!=="adbreakstart"&&(C.emit("play",{viewer_time:V}),N.type!=="playing"&&C.emit("playing",{viewer_time:V}))}})});function mr(w){return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},mr(w)}function Ai(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return Nr(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?Nr(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Nr(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}function Kr(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function pr(w,C){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(F,N){return F.__proto__=N,F},pr(w,C)}function Li(w){var C=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var F,N=nr(w);if(C){var K=nr(this).constructor;F=Reflect.construct(N,arguments,K)}else F=N.apply(this,arguments);return _i(this,F)}}function _i(w,C){if(C&&(mr(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return we(w)}function we(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function nr(w){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(C){return C.__proto__||Object.getPrototypeOf(C)},nr(w)}var bi=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],Oi=function(w){(function(H,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(Q&&Q.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),Object.defineProperty(H,"prototype",{writable:!1}),Q&&pr(H,Q)})(V,w);var C,F,N,K=Li(V);function V(H,Q,J){var X;(function(se,le){if(!(se instanceof le))throw new TypeError("Cannot call a class as a function")})(this,V),(X=K.call(this)).DOM_CONTENT_LOADED_EVENT_END=c.domContentLoadedEventEnd(),X.NAVIGATION_START=c.navigationStart(),X.mux=H,X.id=Q,(J=i()({debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(se){return se}},J)).data=J.data||{},J.data.property_key&&(J.data.env_key=J.data.property_key,delete J.data.property_key),e.setLevel(J.debug?"debug":"warn"),X.getPlayheadTime=J.getPlayheadTime,X.getStateData=J.getStateData||function(){return{}},X.getAdData=J.getAdData||function(){},X.minimumRebufferDuration=J.minimumRebufferDuration,X.sustainedRebufferThreshold=J.sustainedRebufferThreshold,X.playbackHeartbeatTime=J.playbackHeartbeatTime,X.disableRebufferTracking=J.disableRebufferTracking,X.disableRebufferTracking&&X.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),X.disablePlayheadRebufferTracking=J.disablePlayheadRebufferTracking,X.errorTranslator=J.errorTranslator,X.playbackEventDispatcher=new yi(H,J.data.env_key,J),X.data={player_instance_id:y(),mux_sample_rate:J.sampleRate,beacon_domain:J.beaconCollectionDomain?J.beaconCollectionDomain:J.beaconDomain},X.data.view_sequence_number=1,X.data.player_sequence_number=1,X.oldEmit=X.emit,X.emit=function(se,le){le=i()({viewer_time:this.mux.utils.now()},le),this.oldEmit(se,le)};var ee=function(){this.data.view_start===void 0&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(we(X));X.on("viewinit",function(se,le){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),i()(this.data,le),this._initializeViewData(),this.one("play",ee),this.one("adbreakstart",ee)});var ce=function(se){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",se)}.bind(we(X));if(X.on("videochange",function(se,le){ce(le)}),X.on("programchange",function(se,le){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),ce(i()(le,{view_program_changed:!0})),ee(),this.emit("play"),this.emit("playing")}),X.on("fragmentchange",function(se,le){this.currentFragmentPDT=le.currentFragmentPDT,this.currentFragmentStart=le.currentFragmentStart}),X.on("destroy",X.destroy),typeof window!="undefined"&&typeof window.addEventListener=="function"&&typeof window.removeEventListener=="function"){var ye=function(){var se=X.data.view_start!==void 0;X.mux.WINDOW_HIDDEN=document.visibilityState==="hidden",se&&X.mux.WINDOW_HIDDEN&&(X.data.player_is_paused||X.emit("hb"))};window.addEventListener("visibilitychange",ye,!1);var ve=function(se){se.persisted||X.destroy()};window.addEventListener("pagehide",ve,!1),X.on("destroy",function(){window.removeEventListener("visibilitychange",ye),window.removeEventListener("pagehide",ve)})}return X.on("playerready",function(se,le){i()(this.data,le)}),bi.forEach(function(se){X.on(se,function(le,xe){se.indexOf("ad")!==0&&this._updateStateData(),i()(this.data,xe),this._sanitizeData()}),X.on("after"+se,function(){(se!=="error"||this.errorTracker.viewErrored)&&this.send(se)})}),X.on("viewend",function(se,le){i()(X.data,le)}),X.one("playerready",function(se){var le=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=le-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time}),X.longResumeTracker=new Di(we(X)),X.errorTracker=new ie(we(X)),new Qe(we(X)),X.seekingTracker=new et(we(X)),X.playheadTime=new re(we(X)),X.playbackHeartbeat=new $(we(X)),new Ke(we(X)),X.watchTimeTracker=new ae(we(X)),new fe(we(X)),X.adTracker=new Ce(we(X)),new ke(we(X)),new Te(we(X)),new Be(we(X)),new We(we(X)),new xi(we(X)),J.hlsjs&&X.addHLSJS(J),J.dashjs&&X.addDashJS(J),X.emit("viewinit",J.data),X}return C=V,F=[{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.data.view_start!==void 0&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),window.clearTimeout(this._heartBeatTimeout))}},{key:"send",value:function(H){var Q=i()({},this.data);if(Q.video_source_is_live===void 0&&(Q.player_source_duration===1/0||Q.video_source_duration===1/0?Q.video_source_is_live=!0:(Q.player_source_duration>0||Q.video_source_duration>0)&&(Q.video_source_is_live=!1)),Q.video_source_is_live||["player_program_time","player_manifest_newest_program_time","player_live_edge_program_time","player_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"].forEach(function(ce){Q[ce]=void 0}),Q.video_source_url=Q.video_source_url||Q.player_source_url,Q.video_source_url){var J=Ai(o(Q.video_source_url),2),X=J[0],ee=J[1];Q.video_source_domain=ee,Q.video_source_hostname=X}delete Q.ad_request_id,this.playbackEventDispatcher.send(H,Q),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()}},{key:"_updateStateData",value:function(){i()(this.data,this.getStateData()),this.playheadTime._updatePlayheadTime(),this._sanitizeData()}},{key:"_sanitizeData",value:function(){var H=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(Q){var J=parseInt(H.data[Q],10);H.data[Q]=isNaN(J)?void 0:J}),["player_source_url","video_source_url"].forEach(function(Q){if(H.data[Q]){var J=H.data[Q].toLowerCase();J.indexOf("data:")!==0&&J.indexOf("blob:")!==0||(H.data[Q]="MSE style URL")}})}},{key:"_resetVideoData",value:function(H,Q){var J=this;Object.keys(this.data).forEach(function(X){X.indexOf("video_")===0&&delete J.data[X]})}},{key:"_resetViewData",value:function(){var H=this;Object.keys(this.data).forEach(function(Q){Q.indexOf("view_")===0&&delete H.data[Q]}),this.data.view_sequence_number=1}},{key:"_resetErrorData",value:function(H,Q){delete this.data.player_error_code,delete this.data.player_error_message}},{key:"_initializeViewData",value:function(){var H=this,Q=this.data.view_id=y(),J=function(){Q===H.data.view_id&&t(H.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",J):J()}},{key:"_restartHeartBeat",value:function(){var H=this;window.clearTimeout(this._heartBeatTimeout),this.errorTracker.viewErrored||(this._heartBeatTimeout=window.setTimeout(function(){H.data.player_is_paused||H.emit("hb")},1e4))}},{key:"addHLSJS",value:function(H){H.hlsjs?this.hlsjs?this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=H.hlsjs,function(Q,J,X){var ee=arguments.length>4?arguments[4]:void 0,ce=Q.log,ye=Q.utils.secondsToMs,ve=function(pe){var oe,he=parseInt(ee.version);return he===1&&pe.programDateTime!==null&&(oe=pe.programDateTime),he===0&&pe.pdt!==null&&(oe=pe.pdt),oe};if(c.exists()){var se=function(pe,oe){return Q.emit(J,pe,oe)},le=function(pe,oe){var he=oe.levels,ue=oe.audioTracks,ge=oe.url,Re=oe.stats,Ae=oe.networkDetails,it=oe.sessionData,qe={},ct={};he.forEach(function(gt,Gt){qe[Gt]={width:gt.width,height:gt.height,bitrate:gt.bitrate,attrs:gt.attrs}}),ue.forEach(function(gt,Gt){ct[Gt]={name:gt.name,language:gt.lang,bitrate:gt.bitrate}});var ht=T(Re),vt=ht.bytesLoaded,He=ht.requestStart,xr=ht.responseStart,Sr=ht.responseEnd;se("requestcompleted",v(v({},a(it)),{},{request_event_type:pe,request_bytes_loaded:vt,request_start:He,request_response_start:xr,request_response_end:Sr,request_type:"manifest",request_hostname:r(ge),request_response_headers:I(Ae),request_rendition_lists:{media:qe,audio:ct,video:{}}}))};X.on(ee.Events.MANIFEST_LOADED,le);var xe=function(pe,oe){var he=oe.details,ue=oe.level,ge=oe.networkDetails,Re=oe.stats,Ae=T(Re),it=Ae.bytesLoaded,qe=Ae.requestStart,ct=Ae.responseStart,ht=Ae.responseEnd,vt=he.fragments[he.fragments.length-1],He=ve(vt)+ye(vt.duration);se("requestcompleted",{request_event_type:pe,request_bytes_loaded:it,request_start:qe,request_response_start:ct,request_response_end:ht,request_current_level:ue,request_type:"manifest",request_hostname:r(he.url),request_response_headers:I(ge),video_holdback:he.holdBack&&ye(he.holdBack),video_part_holdback:he.partHoldBack&&ye(he.partHoldBack),video_part_target_duration:he.partTarget&&ye(he.partTarget),video_target_duration:he.targetduration&&ye(he.targetduration),video_source_is_live:he.live,player_manifest_newest_program_time:isNaN(He)?void 0:He})};X.on(ee.Events.LEVEL_LOADED,xe);var Ye=function(pe,oe){var he=oe.details,ue=oe.networkDetails,ge=oe.stats,Re=T(ge),Ae=Re.bytesLoaded,it=Re.requestStart,qe=Re.responseStart,ct=Re.responseEnd;se("requestcompleted",{request_event_type:pe,request_bytes_loaded:Ae,request_start:it,request_response_start:qe,request_response_end:ct,request_type:"manifest",request_hostname:r(he.url),request_response_headers:I(ue)})};X.on(ee.Events.AUDIO_TRACK_LOADED,Ye);var Je=function(pe,oe){var he=oe.stats,ue=oe.networkDetails,ge=oe.frag;he=he||ge.stats;var Re=T(he),Ae={request_event_type:pe,request_bytes_loaded:Re.bytesLoaded,request_start:Re.requestStart,request_response_start:Re.responseStart,request_response_end:Re.responseEnd,request_hostname:ue?r(ue.responseURL):void 0,request_response_headers:I(ue),request_media_duration:ge.duration};ge.type==="main"?(Ae.request_type="media",Ae.request_current_level=ge.level,Ae.request_video_width=(X.levels[ge.level]||{}).width,Ae.request_video_height=(X.levels[ge.level]||{}).height):Ae.request_type=ge.type,se("requestcompleted",Ae)};X.on(ee.Events.FRAG_LOADED,Je);var Dt=function(pe,oe){var he=oe.frag,ue=he.start,ge={currentFragmentPDT:ve(he),currentFragmentStart:ye(ue)};se("fragmentchange",ge)};X.on(ee.Events.FRAG_CHANGED,Dt);var Se=function(pe,oe){var he=oe.type,ue=oe.details,ge=oe.response,Re=oe.fatal,Ae=oe.context,it=oe.frag;if(ue===ee.ErrorDetails.MANIFEST_LOAD_ERROR||ue===ee.ErrorDetails.MANIFEST_LOAD_TIMEOUT||ue===ee.ErrorDetails.FRAG_LOAD_ERROR||ue===ee.ErrorDetails.FRAG_LOAD_TIMEOUT||ue===ee.ErrorDetails.LEVEL_LOAD_ERROR||ue===ee.ErrorDetails.LEVEL_LOAD_TIMEOUT){var qe=it&&it.url||Ae&&Ae.url||"";se("requestfailed",{request_error:ue,request_url:qe,request_hostname:r(qe),request_type:ue===ee.ErrorDetails.FRAG_LOAD_ERROR||ue===ee.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:ge&&ge.code,request_error_text:ge&&ge.text})}Re&&se("error",{player_error_code:he,player_error_message:ue})};X.on(ee.Events.ERROR,Se);var Ze=function(pe,oe){var he=oe.frag,ue=he&&he._url||"";se("requestcanceled",{request_event_type:pe,request_url:ue,request_type:"media",request_hostname:r(ue)})};X.on(ee.Events.FRAG_LOAD_EMERGENCY_ABORTED,Ze);var Ge=function(pe,oe){var he=oe.level,ue=X.levels[he];if(ue&&ue.attrs&&ue.attrs.BANDWIDTH){var ge,Re=ue.attrs.BANDWIDTH,Ae=parseFloat(ue.attrs["FRAME-RATE"]);isNaN(Ae)||(ge=Ae),Re?se("renditionchange",{video_source_fps:ge,video_source_bitrate:Re,video_source_width:ue.width,video_source_height:ue.height}):ce.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};X.on(ee.Events.LEVEL_SWITCHED,Ge),X._stopMuxMonitor=function(){X.off(ee.Events.MANIFEST_LOADED,le),X.off(ee.Events.LEVEL_LOADED,xe),X.off(ee.Events.AUDIO_TRACK_LOADED,Ye),X.off(ee.Events.FRAG_LOADED,Je),X.off(ee.Events.FRAG_CHANGED,Dt),X.off(ee.Events.ERROR,Se),X.off(ee.Events.FRAG_LOAD_EMERGENCY_ABORTED,Ze),X.off(ee.Events.LEVEL_SWITCHED,Ge),X.off(ee.Events.DESTROYING,X._stopMuxMonitor),delete X._stopMuxMonitor},X.on(ee.Events.DESTROYING,X._stopMuxMonitor)}else ce.warn("performance timing not supported. Not tracking HLS.js.")}(this.mux,this.id,H.hlsjs,{},H.Hls||window.Hls)):this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")}},{key:"removeHLSJS",value:function(){var H;this.hlsjs&&((H=this.hlsjs)&&typeof H._stopMuxMonitor=="function"&&H._stopMuxMonitor(),this.hlsjs=void 0)}},{key:"addDashJS",value:function(H){H.dashjs?this.dashjs?this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=H.dashjs,function(Q,J,X){var ee=Q.log;if(X&&X.on){var ce=function(Se,Ze){return Q.emit(J,Se,Ze)},ye=function(Se){var Ze=Se.type,Ge=(Se.data||{}).url;ce("requestcompleted",{request_event_type:Ze,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:r(Ge)})};X.on("manifestLoaded",ye);var ve={},se=function(Se){var Ze=Se.type,Ge=Se.fragmentModel,pe=(Se.chunk||{}).mediaInfo||{},oe=pe.type,he=pe.bitrateList,ue={};(he=he||[]).forEach(function(vt,He){ue[He]={},ue[He].width=vt.width,ue[He].height=vt.height,ue[He].bitrate=vt.bandwidth,ue[He].attrs={}}),oe==="video"?ve.video=ue:oe==="audio"?ve.audio=ue:ve.media=ue;var ge=k(Ge,X),Re=ge.requestStart,Ae=ge.requestResponseStart,it=ge.requestResponseEnd,qe=ge.requestResponseHeaders,ct=ge.requestMediaDuration,ht=ge.requestHostname;ce("requestcompleted",{request_event_type:Ze,request_start:Re,request_response_start:Ae,request_response_end:it,request_bytes_loaded:-1,request_type:oe+"_init",request_response_headers:qe,request_hostname:ht,request_media_duration:ct,request_rendition_lists:ve})};X.on("initFragmentLoaded",se);var le=function(Se){var Ze=Se.type,Ge=Se.fragmentModel,pe=Se.chunk||{},oe=pe.mediaInfo,he=pe.start,ue=(oe||{}).type,ge=k(Ge,X),Re=ge.requestStart,Ae=ge.requestResponseStart,it=ge.requestResponseEnd,qe=ge.requestBytesLoaded,ct=ge.requestResponseHeaders,ht=ge.requestMediaDuration,vt=ge.requestHostname,He=B(ue,X),xr=He.currentLevel,Sr=He.renditionWidth,gt=He.renditionHeight,Gt=He.renditionBitrate;ce("requestcompleted",{request_event_type:Ze,request_start:Re,request_response_start:Ae,request_response_end:it,request_bytes_loaded:qe,request_type:ue,request_response_headers:ct,request_hostname:vt,request_media_start_time:he,request_media_duration:ht,request_current_level:xr,request_labeled_bitrate:Gt,request_video_width:Sr,request_video_height:gt})};X.on("mediaFragmentLoaded",le);var xe={video:void 0,audio:void 0,totalBitrate:void 0},Ye=function(){if(xe.video&&typeof xe.video.bitrate=="number"){if(xe.video.width&&xe.video.height){var Se=xe.video.bitrate;return xe.audio&&typeof xe.audio.bitrate=="number"&&(Se+=xe.audio.bitrate),Se!==xe.totalBitrate?(xe.totalBitrate=Se,{video_source_bitrate:Se,video_source_height:xe.video.height,video_source_width:xe.video.width}):void 0}ee.warn("have bitrate info for video but missing width/height")}},Je=function(Se,Ze,Ge){if(typeof Se.newQuality=="number"){var pe=Se.mediaType;if(pe==="audio"||pe==="video"){var oe=X.getBitrateInfoListFor(pe).find(function(ue){return ue.qualityIndex===Se.newQuality});if(oe&&typeof oe.bitrate=="number"){xe[pe]=oe;var he=Ye();he&&ce("renditionchange",he)}else ee.warn("missing bitrate info for ".concat(pe))}}else ee.warn("missing evt.newQuality in qualityChangeRendered event",Se)};X.on("qualityChangeRendered",Je);var Dt=function(Se){var Ze=Se.error,Ge=Se.event,pe=(Ge=Ge||{}).request||{},oe=_().event&&_().event.currentTarget||{};ce("requestfailed",{request_error:Ze+"_"+Ge.id+"_"+pe.type,request_url:Ge.url,request_hostname:r(Ge.url),request_type:pe.mediaType,request_error_code:oe.status,request_error_type:oe.statusText})};X.on("error",Dt),X._stopMuxMonitor=function(){X.off("manifestLoaded",ye),X.off("initFragmentLoaded",se),X.off("mediaFragmentLoaded",le),X.off("qualityChangeRendered",Je),X.off("error",Dt),delete X._stopMuxMonitor}}else ee.warn("Invalid dash.js player reference. Monitoring blocked.")}(this.mux,this.id,H.dashjs)):this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")}},{key:"removeDashJS",value:function(){var H;this.dashjs&&((H=this.dashjs)&&typeof H._stopMuxMonitor=="function"&&H._stopMuxMonitor(),this.dashjs=void 0)}}],F&&Kr(C.prototype,F),N&&Kr(C,N),Object.defineProperty(C,"prototype",{writable:!1}),V}(z),Ri=Oi,Ii=O(153),jt=O.n(Ii);function Er(w){return Er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Er(w)}function jr(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return Wr(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?Wr(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function
|
|
1
|
+
"use strict";(()=>{var Ji=Object.create;var Yr=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var en=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty;var zr=(j,R)=>()=>(R||j((R={exports:{}}).exports,R),R.exports);var rn=(j,R,l,P)=>{if(R&&typeof R=="object"||typeof R=="function")for(let L of qi(R))!tn.call(j,L)&&L!==l&&Yr(j,L,{get:()=>R[L],enumerable:!(P=Zi(R,L))||P.enumerable});return j};var sr=(j,R,l)=>(l=j!=null?Ji(en(j)):{},rn(R||!j||!j.__esModule?Yr(l,"default",{value:j,enumerable:!0}):l,j));var Dr=(j,R,l)=>{if(!R.has(j))throw TypeError("Cannot "+l)};var ze=(j,R,l)=>(Dr(j,R,"read from private field"),l?l.call(j):R.get(j)),lt=(j,R,l)=>{if(R.has(j))throw TypeError("Cannot add the same private member more than once");R instanceof WeakSet?R.add(j):R.set(j,l)},ut=(j,R,l,P)=>(Dr(j,R,"write to private field"),P?P.call(j,l):R.set(j,l),l);var At=(j,R,l)=>(Dr(j,R,"access private method"),l);var $r=zr((or,br)=>{(function(){var j,R;j=this,R=function(){return function(){var l={80:function(A,M,O){A.exports=O(728).default},728:function(A,M,O){"use strict";O.d(M,{default:function(){return $i}});var b=O(48),_=O.n(b),y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(w){var C=16*Math.random()|0;return(w==="x"?C:3&C|8).toString(16)})},x=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)},D=function(w){return w&&w.nodeName!==void 0?(w.muxId||(w.muxId=w.id||x()),w.muxId):w},E=function(w){var C;w&&w.nodeName!==void 0?w=D(C=w):C=document.querySelector(w);var F=C&&C.nodeName?C.nodeName.toLowerCase():"";return[C,w,F]},m=O(640),p=O.n(m),f=p().methodFactory;p().methodFactory=function(w,C,F){var N=f(w,C,F);return function(){for(var K=["[mux]"],V=0;V<arguments.length;V++)K.push(arguments[V]);N.apply(void 0,K)}},p().setLevel(p().getLevel());var e=p();function s(){return(_().doNotTrack||_().navigator&&_().navigator.doNotTrack)==="1"}var h={now:function(){var w=_().performance,C=w&&w.timing,F=w&&w.timeOrigin||C&&C.navigationStart;return typeof F=="number"&&typeof w.now=="function"?F+w.now():Date.now()}},g=O(678),i=O.n(g),r=function(w){return o(w)[0]},o=function(w){if(typeof w!="string"||w==="")return["localhost"];var C,F=(w.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/)||[])[4];return F&&(C=(F.match(/[^\.]+\.[^\.]+$/)||[])[0]),[F,C]},c={exists:function(){var w=_().performance;return(w&&w.timing)!==void 0},domContentLoadedEventEnd:function(){var w=_().performance,C=w&&w.timing;return C&&C.domContentLoadedEventEnd},navigationStart:function(){var w=_().performance,C=w&&w.timing;return C&&C.navigationStart}};function t(w,C,F){F=F===void 0?1:F,w[C]=w[C]||0,w[C]+=F}var n=["x-cdn","content-type","x-request-id"];function u(w){var C={};return(w=w||"").trim().split(/[\r\n]+/).forEach(function(F){if(F){var N=F.split(": "),K=N.shift();K&&(n.indexOf(K.toLowerCase())>=0||K.toLowerCase().indexOf("x-litix-")===0)&&(C[K]=N.join(": "))}}),C}var a=function(w){var C={};for(var F in w){var N=w[F];N["DATA-ID"].search("io.litix.data.")!==-1&&(C[N["DATA-ID"].replace("io.litix.data.","")]=N.VALUE)}return C};function d(w,C){var F=Object.keys(w);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(w);C&&(N=N.filter(function(K){return Object.getOwnPropertyDescriptor(w,K).enumerable})),F.push.apply(F,N)}return F}function v(w){for(var C=1;C<arguments.length;C++){var F=arguments[C]!=null?arguments[C]:{};C%2?d(Object(F),!0).forEach(function(N){S(w,N,F[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(F)):d(Object(F)).forEach(function(N){Object.defineProperty(w,N,Object.getOwnPropertyDescriptor(F,N))})}return w}function S(w,C,F){return C in w?Object.defineProperty(w,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):w[C]=F,w}var T=function(w){if(!w)return{};var C=c.navigationStart(),F=w.loading,N=F?F.start:w.trequest,K=F?F.first:w.tfirst,V=F?F.end:w.tload;return{bytesLoaded:w.total,requestStart:Math.round(C+N),responseStart:Math.round(C+K),responseEnd:Math.round(C+V)}},I=function(w){if(w&&typeof w.getAllResponseHeaders=="function")return u(w.getAllResponseHeaders())},k=function(w,C){if(!w||typeof w.getRequests!="function")return{};var F=w.getRequests({state:"executed"});if(F.length===0)return{};var N,K=F[F.length-1],V=r(K.url),H=K.bytesLoaded,Q=new Date(K.requestStartDate).getTime(),J=new Date(K.firstByteDate).getTime(),X=new Date(K.requestEndDate).getTime(),ee=isNaN(K.duration)?0:K.duration,ce=typeof C.getMetricsFor=="function"?C.getMetricsFor(K.mediaType).HttpList:C.getDashMetrics().getHttpRequests(K.mediaType);return ce.length>0&&(N=u(ce[ce.length-1]._responseHeaders||"")),{requestStart:Q,requestResponseStart:J,requestResponseEnd:X,requestBytesLoaded:H,requestResponseHeaders:N,requestMediaDuration:ee,requestHostname:V}},B=function(w,C){var F=C.getQualityFor(w),N=C.getCurrentTrackFor(w).bitrateList;return N?{currentLevel:F,renditionWidth:N[F].width||null,renditionHeight:N[F].height||null,renditionBitrate:N[F].bandwidth}:{}};function U(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var W=0,G=function(){function w(){(function(K,V){if(!(K instanceof V))throw new TypeError("Cannot call a class as a function")})(this,w)}var C,F,N;return C=w,F=[{key:"on",value:function(K,V,H){return V._eventEmitterGuid=V._eventEmitterGuid||++W,this._listeners=this._listeners||{},this._listeners[K]=this._listeners[K]||[],H&&(V=V.bind(H)),this._listeners[K].push(V),V}},{key:"off",value:function(K,V){var H=this._listeners&&this._listeners[K];H&&H.forEach(function(Q,J){Q._eventEmitterGuid===V._eventEmitterGuid&&H.splice(J,1)})}},{key:"one",value:function(K,V,H){var Q=this;V._eventEmitterGuid=V._eventEmitterGuid||++W;var J=function X(){Q.off(K,X),V.apply(H||this,arguments)};J._eventEmitterGuid=V._eventEmitterGuid,this.on(K,J)}},{key:"emit",value:function(K,V){var H=this;if(this._listeners){V=V||{};var Q=this._listeners["before*"]||[],J=this._listeners[K]||[],X=this._listeners["after"+K]||[],ee=function(ce,ye){(ce=ce.slice()).forEach(function(ve){ve.call(H,{type:K},ye)})};ee(Q,V),ee(J,V),ee(X,V)}}}],F&&U(C.prototype,F),N&&U(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}(),z=G;function Y(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var $=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,K.on("playing",function(){V._playheadShouldBeProgressing=!0}),K.on("play",this._startPlaybackHeartbeatInterval.bind(this)),K.on("playing",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adbreakstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adplay",this._startPlaybackHeartbeatInterval.bind(this)),K.on("adplaying",this._startPlaybackHeartbeatInterval.bind(this)),K.on("seeking",this._startPlaybackHeartbeatInterval.bind(this)),K.on("devicewake",this._startPlaybackHeartbeatInterval.bind(this)),K.on("viewstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("rebufferstart",this._startPlaybackHeartbeatInterval.bind(this)),K.on("pause",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("ended",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("viewend",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("error",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("aderror",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adpause",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adended",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("adbreakend",this._stopPlaybackHeartbeatInterval.bind(this)),K.on("seeked",function(){K.data.player_is_paused?V._stopPlaybackHeartbeatInterval():V._startPlaybackHeartbeatInterval()}),K.on("timeupdate",function(){V._playbackHeartbeatInterval!==null&&K.emit("playbackheartbeat")}),K.on("devicesleep",function(H,Q){V._playbackHeartbeatInterval!==null&&(_().clearInterval(V._playbackHeartbeatInterval),K.emit("playbackheartbeatend",{viewer_time:Q.viewer_time}),V._playbackHeartbeatInterval=null)})}var C,F,N;return C=w,(F=[{key:"_startPlaybackHeartbeatInterval",value:function(){var K=this;this._playbackHeartbeatInterval===null&&(this.pm.emit("playbackheartbeat"),this._playbackHeartbeatInterval=_().setInterval(function(){K.pm.emit("playbackheartbeat")},this.pm.playbackHeartbeatTime))}},{key:"_stopPlaybackHeartbeatInterval",value:function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(_().clearInterval(this._playbackHeartbeatInterval),this.pm.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)}}])&&Y(C.prototype,F),N&&Y(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Z(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function q(w,C,F){return C&&Z(w.prototype,C),F&&Z(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var ie=q(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("viewinit",function(){F.viewErrored=!1}),C.on("error",function(){try{var N=C.errorTranslator({player_error_code:C.data.player_error_code,player_error_message:C.data.player_error_message});N?(C.data.player_error_code=N.player_error_code,C.data.player_error_message=N.player_error_message,F.viewErrored=!0):(delete C.data.player_error_code,delete C.data.player_error_message)}catch(K){C.mux.log.warn("Exception in error translator callback.",K),F.viewErrored=!0}})});function ne(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var ae=function(){function w(K){(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._watchTimeTrackerLastCheckedTime=null,K.on("playbackheartbeat",this._updateWatchTime.bind(this)),K.on("playbackheartbeatend",this._clearWatchTimeState.bind(this))}var C,F,N;return C=w,(F=[{key:"_updateWatchTime",value:function(K,V){var H=V.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=H),t(this.pm.data,"view_watch_time",H-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=H}},{key:"_clearWatchTimeState",value:function(K,V){this._updateWatchTime(K,V),this._watchTimeTrackerLastCheckedTime=null}}])&&ne(C.prototype,F),N&&ne(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function te(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var fe=function(){function w(K){(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,this._playbackTimeTrackerLastPlayheadPosition=-1,K.on("playbackheartbeat",this._updatePlaybackTime.bind(this)),K.on("playbackheartbeatend",this._clearPlaybackTimeState.bind(this)),K.on("seeking",this._clearPlaybackTimeState.bind(this))}var C,F,N;return C=w,(F=[{key:"_updatePlaybackTime",value:function(){var K=this.pm.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&K>this._playbackTimeTrackerLastPlayheadPosition){var V=K-this._playbackTimeTrackerLastPlayheadPosition;V<=1e3&&t(this.pm.data,"view_content_playback_time",V)}this._playbackTimeTrackerLastPlayheadPosition=K}},{key:"_clearPlaybackTimeState",value:function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1}}])&&te(C.prototype,F),N&&te(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function de(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var re=function(){function w(K){(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K;var V=this._updatePlayheadTime.bind(this);K.on("playbackheartbeat",V),K.on("playbackheartbeatend",V),K.on("timeupdate",V),K.on("destroy",function(){K.off("timeupdate",V)})}var C,F,N;return C=w,(F=[{key:"_updateMaxPlayheadPosition",value:function(){this.pm.data.view_max_playhead_position=this.pm.data.view_max_playhead_position===void 0?this.pm.data.player_playhead_time:Math.max(this.pm.data.view_max_playhead_position,this.pm.data.player_playhead_time)}},{key:"_updatePlayheadTime",value:function(K,V){var H=this,Q=function(){H.pm.currentFragmentPDT&&H.pm.currentFragmentStart&&(H.pm.data.player_program_time=H.pm.currentFragmentPDT+H.pm.data.player_playhead_time-H.pm.currentFragmentStart)};if(V&&V.player_playhead_time)this.pm.data.player_playhead_time=V.player_playhead_time,Q(),this._updateMaxPlayheadPosition();else if(this.pm.getPlayheadTime){var J=this.pm.getPlayheadTime();J!==void 0&&(this.pm.data.player_playhead_time=J,Q(),this._updateMaxPlayheadPosition())}}}])&&de(C.prototype,F),N&&de(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Ee(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function me(w,C,F){return C&&Ee(w.prototype,C),F&&Ee(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Te=me(function w(C){if(function(K,V){if(!(K instanceof V))throw new TypeError("Cannot call a class as a function")}(this,w),!C.disableRebufferTracking){var F,N=function(){if(F){var K=C.data.viewer_time-F;t(C.data,"view_rebuffer_duration",K),F=C.data.viewer_time}C.data.view_watch_time>=0&&C.data.view_rebuffer_count>0&&(C.data.view_rebuffer_frequency=C.data.view_rebuffer_count/C.data.view_watch_time,C.data.view_rebuffer_percentage=C.data.view_rebuffer_duration/C.data.view_watch_time)};C.on("playbackheartbeat",function(){return N()}),C.on("rebufferstart",function(){F||(t(C.data,"view_rebuffer_count",1),F=C.data.viewer_time,C.one("rebufferend",function(){N(),F=void 0}))})}});function Me(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var _e=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.disableRebufferTracking||K.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,K.on("playbackheartbeat",this._checkIfRebuffering.bind(this)),K.on("playbackheartbeatend",this._cleanupRebufferTracker.bind(this)),K.on("seeking",function(){V._cleanupRebufferTracker(null,{viewer_time:h.now()})}))}var C,F,N;return C=w,F=[{key:"_checkIfRebuffering",value:function(K,V){if(this.pm.seekingTracker.isSeeking||this.pm.adTracker.isAdBreak||!this.pm.playbackHeartbeat._playheadShouldBeProgressing)this._cleanupRebufferTracker(K,V);else if(this._lastCheckedTime!==null)if(this._lastPlayheadTime===this.pm.data.player_playhead_time){var H=V.viewer_time-this._lastPlayheadTimeUpdatedTime;typeof this.pm.sustainedRebufferThreshold=="number"&&H>=this.pm.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),this._lastCheckedTime=V.viewer_time}else this._cleanupRebufferTracker(K,V,!0);else this._prepareRebufferTrackerState(V.viewer_time)}},{key:"_clearRebufferTrackerState",value:function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null}},{key:"_prepareRebufferTrackerState",value:function(K){this._lastCheckedTime=K,this._lastPlayheadTime=this.pm.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=K}},{key:"_cleanupRebufferTracker",value:function(K,V){var H=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.pm.emit("rebufferend",{viewer_time:V.viewer_time});else{if(this._lastCheckedTime===null)return;var Q=this.pm.data.player_playhead_time-this._lastPlayheadTime,J=V.viewer_time-this._lastPlayheadTimeUpdatedTime;typeof this.pm.minimumRebufferDuration=="number"&&Q>0&&J-Q>this.pm.minimumRebufferDuration&&(this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.pm.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+J-Q}))}H?this._prepareRebufferTrackerState(V.viewer_time):this._clearRebufferTrackerState()}}],F&&Me(C.prototype,F),N&&Me(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}(),ke=_e;function Ie(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var Be=function(){function w(K){var V=this;(function(H,Q){if(!(H instanceof Q))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.on("viewinit",function(){var H=K.data,Q=H.view_id;if(!H.view_program_changed){var J=function(X,ee){var ce=ee.viewer_time;X.type==="playing"&&K.data.view_time_to_first_frame===void 0?V.calculateTimeToFirstFrame(ce||h.now(),Q):X.type!=="adplaying"||K.data.view_time_to_first_frame!==void 0&&!V._inPrerollPosition()||V.calculateTimeToFirstFrame(ce||h.now(),Q)};K.one("playing",J),K.one("adplaying",J),K.one("viewend",function(){K.off("playing",J),K.off("adplaying",J)})}})}var C,F,N;return C=w,(F=[{key:"_inPrerollPosition",value:function(){return this.pm.data.view_content_playback_time===void 0||this.pm.data.view_content_playback_time<=1e3}},{key:"calculateTimeToFirstFrame",value:function(K,V){V===this.pm.data.view_id&&(this.pm.watchTimeTracker._updateWatchTime(null,{viewer_time:K}),this.pm.data.view_time_to_first_frame=this.pm.data.view_watch_time,(this.pm.data.player_autoplay_on||this.pm.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.pm.data.view_aggregate_startup_time=this.pm.data.view_start+this.pm.data.view_watch_time-this.NAVIGATION_START))}}])&&Ie(C.prototype,F),N&&Ie(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function be(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ue(w,C,F){return C&&be(w.prototype,C),F&&be(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Ke=Ue(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("viewinit",function(){F._lastPlayheadPosition=-1}),["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach(function(N){C.on(N,function(){if(F._lastPlayheadPosition>=0&&C.data.player_playhead_time>=0&&F._lastPlayerWidth>=0&&F._lastSourceWidth>0&&F._lastPlayerHeight>=0&&F._lastSourceHeight>0){var K=C.data.player_playhead_time-F._lastPlayheadPosition;if(K<0)return void(F._lastPlayheadPosition=-1);var V=Math.min(F._lastPlayerWidth/F._lastSourceWidth,F._lastPlayerHeight/F._lastSourceHeight),H=Math.max(0,V-1),Q=Math.max(0,1-V);C.data.view_max_upscale_percentage=Math.max(C.data.view_max_upscale_percentage||0,H),C.data.view_max_downscale_percentage=Math.max(C.data.view_max_downscale_percentage||0,Q),t(C.data,"view_total_content_playback_time",K),t(C.data,"view_total_upscaling",H*K),t(C.data,"view_total_downscaling",Q*K)}F._lastPlayheadPosition=-1})}),["playing","hb"].forEach(function(N){C.on(N,function(){F._lastPlayheadPosition=C.data.player_playhead_time,F._lastPlayerWidth=C.data.player_width,F._lastPlayerHeight=C.data.player_height,F._lastSourceWidth=C.data.video_source_width,F._lastSourceHeight=C.data.video_source_height})})});function je(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ne(w,C,F){return C&&je(w.prototype,C),F&&je(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var et=Ne(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),this.isSeeking=!1,C.on("seeking",function(N,K){i()(C.data,K),F._lastSeekingTime=h.now(),F.isSeeking===!1&&(F.isSeeking=!0,C.send("seeking"))}),C.on("seeked",function(){F.isSeeking=!1;var N=F._lastSeekingTime||h.now(),K=h.now()-N;t(C.data,"view_seek_count",1),t(C.data,"view_seek_duration",K);var V=C.data.view_max_seek_time||0;C.data.view_max_seek_time=Math.max(V,K)}),C.on("viewend",function(){F.isSeeking=!1})});function Fe(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return tt(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?tt(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function tt(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}function Oe(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}var Pe=function(w,C){w.push(C),w.sort(function(F,N){return F.viewer_time-N.viewer_time})},Ve=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],Ce=function(){function w(K){var V=this;(function(Q,J){if(!(Q instanceof J))throw new TypeError("Cannot call a class as a function")})(this,w),this.pm=K,K.on("viewinit",function(){V.isAdBreak=!1,V._currentAdRequestNumber=0,V._currentAdResponseNumber=0,V._adRequests=[],V._adResponses=[],V._adHasPlayed=!1,V._wouldBeNewAdPlay=!0,V._prerollPlayTime=void 0}),Ve.forEach(function(Q){return K.on(Q,V._updateAdData.bind(V))});var H=function(){V.isAdBreak=!1};K.on("adbreakstart",function(){V.isAdBreak=!0}),K.on("play",H),K.on("playing",H),K.on("viewend",H),K.on("adrequest",function(Q,J){J=i()({ad_request_id:"generatedAdRequestId"+V._currentAdRequestNumber++},J),Pe(V._adRequests,J),t(K.data,"view_ad_request_count"),V.inPrerollPosition()&&(K.data.view_preroll_requested=!0,V._adHasPlayed||t(K.data,"view_preroll_request_count"))}),K.on("adresponse",function(Q,J){J=i()({ad_request_id:"generatedAdRequestId"+V._currentAdResponseNumber++},J),Pe(V._adResponses,J);var X=V.findAdRequest(J.ad_request_id);X&&t(K.data,"view_ad_request_time",Math.max(0,J.viewer_time-X.viewer_time))}),K.on("adplay",function(Q,J){V._adHasPlayed=!0,V._wouldBeNewAdPlay&&(V._wouldBeNewAdPlay=!1,t(K.data,"view_ad_played_count")),V.inPrerollPosition()&&!K.data.view_preroll_played&&(K.data.view_preroll_played=!0,V._adRequests.length>0&&(K.data.view_preroll_request_time=Math.max(0,J.viewer_time-V._adRequests[0].viewer_time)),K.data.view_start&&(K.data.view_startup_preroll_request_time=Math.max(0,J.viewer_time-K.data.view_start)),V._prerollPlayTime=J.viewer_time)}),K.on("adplaying",function(Q,J){V.inPrerollPosition()&&K.data.view_preroll_load_time===void 0&&V._prerollPlayTime!==void 0&&(K.data.view_preroll_load_time=J.viewer_time-V._prerollPlayTime,K.data.view_startup_preroll_load_time=J.viewer_time-V._prerollPlayTime)}),K.on("adended",function(){V._wouldBeNewAdPlay=!0}),K.on("aderror",function(){V._wouldBeNewAdPlay=!0})}var C,F,N;return C=w,(F=[{key:"inPrerollPosition",value:function(){return this.pm.data.view_content_playback_time===void 0||this.pm.data.view_content_playback_time<=1e3}},{key:"findAdRequest",value:function(K){for(var V=0;V<this._adRequests.length;V++)if(this._adRequests[V].ad_request_id===K)return this._adRequests[V]}},{key:"_updateAdData",value:function(K,V){if(this.inPrerollPosition()){if(!this.pm.data.view_preroll_ad_tag_hostname&&V.ad_tag_url){var H=Fe(o(V.ad_tag_url),2),Q=H[0],J=H[1];this.pm.data.view_preroll_ad_tag_domain=J,this.pm.data.view_preroll_ad_tag_hostname=Q}if(!this.pm.data.view_preroll_ad_asset_hostname&&V.ad_asset_url){var X=Fe(o(V.ad_asset_url),2),ee=X[0],ce=X[1];this.pm.data.view_preroll_ad_asset_domain=ce,this.pm.data.view_preroll_ad_asset_hostname=ee}}}}])&&Oe(C.prototype,F),N&&Oe(C,N),Object.defineProperty(C,"prototype",{writable:!1}),w}();function Le(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function nt(w,C,F){return C&&Le(w.prototype,C),F&&Le(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var We=nt(function w(C){var F,N;(function(Q,J){if(!(Q instanceof J))throw new TypeError("Cannot call a class as a function")})(this,w);var K=function(){C.disableRebufferTracking||F&&(t(C.data,"view_waiting_rebuffer_duration",h.now()-F),F=!1,_().clearInterval(N))},V=!1,H=function(){V=!1,K()};C.on("waiting",function(){V&&(C.disableRebufferTracking||(t(C.data,"view_waiting_rebuffer_count",1),F=h.now(),N=_().setInterval(function(){if(F){var Q=h.now();t(C.data,"view_waiting_rebuffer_duration",Q-F),F=Q}},250)))}),C.on("playing",function(){K(),V=!0}),C.on("pause",H),C.on("seeking",H)});function ft(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function yt(w,C,F){return C&&ft(w.prototype,C),F&&ft(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Qe=yt(function w(C){var F=this;(function(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")})(this,w);var N=function(){F.lastWallClockTime=h.now(),C.on("before*",K)},K=function(V){var H=h.now(),Q=F.lastWallClockTime;F.lastWallClockTime=H,H-Q>3e4&&(C.emit("devicesleep",{viewer_time:Q}),i()(C.data,{viewer_time:Q}),C.send("devicesleep"),C.emit("devicewake",{viewer_time:H}),i()(C.data,{viewer_time:H}),C.send("devicewake"))};C.one("playbackheartbeat",N),C.on("playbackheartbeatend",function(){C.off("before*",K),C.one("playbackheartbeat",N)})}),Ot=O(375),Tt=O(655),at=O.n(Tt),dt="muxData",st=function(){var w;try{w=Ot.parse(at().get(dt)||"")}catch{w={}}return w},xt=function(w){try{at().set(dt,Ot.stringify(w),{expires:7300})}catch{}},Et=function(){var w=st();return w.mux_viewer_id=w.mux_viewer_id||y(),w.msn=w.msn||Math.random(),xt(w),{mux_viewer_id:w.mux_viewer_id,mux_sample_number:w.msn}};function cr(w,C){var F=C.beaconCollectionDomain,N=C.beaconDomain;if(F)return"https://"+F;var K=N||"litix.io";return(w=w||"inferred").match(/^[a-z0-9]+$/)?"https://"+w+"."+K:"https://img.litix.io/a.gif"}var Ut=function(){var w;switch(Rt()){case"cellular":w="cellular";break;case"ethernet":w="wired";break;case"wifi":w="wifi";break;case void 0:break;default:w="other"}return w},Rt=function(){var w=_().navigator,C=w&&(w.connection||w.mozConnection||w.webkitConnection);return C&&C.type};Ut.getConnectionFromAPI=Rt;var $e=Ut,er=tr({a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"}),Nt=tr({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cd:"code",cg:"category",ch:"changed",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fi:"first",fm:"family",ft:"format",fp:"fps",fq:"frequency",fr:"frame",fs:"fullscreen",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"});function tr(w){var C={};for(var F in w)w.hasOwnProperty(F)&&(C[w[F]]=F);return C}function Kt(w){var C={},F={};return Object.keys(w).forEach(function(N){var K=!1;if(w.hasOwnProperty(N)&&w[N]!==void 0){var V=N.split("_"),H=V[0],Q=er[H];Q||(e.info("Data key word `"+V[0]+"` not expected in "+N),Q=H+"_"),V.splice(1).forEach(function(J){J==="url"&&(K=!0),Nt[J]?Q+=Nt[J]:Number(J)&&Math.floor(Number(J))===Number(J)?Q+=J:(e.info("Data key word `"+J+"` not expected in "+N),Q+="_"+J+"_")}),K?F[Q]=w[N]:C[Q]=w[N]}}),i()(C,F)}var hr={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},vr=["hb","requestcompleted","requestfailed","requestcanceled"],ot=function(w,C){this._beaconUrl=w||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=i()({},hr,C)};ot.prototype.queueEvent=function(w,C){var F=i()({},C);return(this._eventQueue.length<=this._options.maxQueueLength||w==="eventrateexceeded")&&(this._eventQueue.push(F),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength)},ot.prototype.flushEvents=function(){this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending()},ot.prototype.destroy=function(){var w=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,w?this._clearBeaconQueue():this.flushEvents(),_().clearTimeout(this._sendTimeout)},ot.prototype._clearBeaconQueue=function(){var w=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,C=this._eventQueue.slice(w);w>0&&i()(C[C.length-1],Kt({mux_view_message:"event queue truncated"}));var F=this._createPayload(C);It(this._beaconUrl,F,!0,function(){})},ot.prototype._sendBeaconQueue=function(){var w=this;if(!this._postInFlight){var C=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0;var F=this._createPayload(C),N=h.now();It(this._beaconUrl,F,!1,function(K,V){V?(w._eventQueue=C.concat(w._eventQueue),w._failureCount+=1,e.info("Error sending beacon: "+V)):w._failureCount=0,w._roundTripTime=h.now()-N,w._postInFlight=!1})}},ot.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var w=Math.pow(2,this._failureCount-1);return(1+(w*=Math.random()))*this._options.baseTimeBetweenBeacons},ot.prototype._startBeaconSending=function(){var w=this;_().clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=_().setTimeout(function(){w._eventQueue.length&&w._sendBeaconQueue(),w._startBeaconSending()},this._getNextBeaconTime()))},ot.prototype._createPayload=function(w){var C,F,N,K=this,V={transmission_timestamp:Math.round(h.now())};this._roundTripTime&&(V.rtt_ms=Math.round(this._roundTripTime));var H=function(){C=JSON.stringify({metadata:V,events:F||w}),N=C.length/1024},Q=function(){return N<=K._options.maxPayloadKBSize};return H(),Q()||(e.info("Payload size is too big ("+N+" kb). Removing unnecessary events."),F=w.filter(function(J){return vr.indexOf(J.e)===-1}),H()),Q()||(e.info("Payload size still too big ("+N+" kb). Cropping fields.."),F.forEach(function(J){for(var X in J){var ee=J[X];typeof ee=="string"&&ee.length>51200&&(J[X]=ee.substring(0,51200))}}),H()),C};var It=function(w,C,F,N){if(F&&navigator&&navigator.sendBeacon&&navigator.sendBeacon(w,C))N();else if(_().fetch)_().fetch(w,{method:"POST",body:C,headers:{"Content-Type":"text/plain"},keepalive:!0}).then(function(V){return N(null,V.ok?null:"Error")}).catch(function(V){return N(null,V)});else{if(_().XMLHttpRequest){var K=new(_()).XMLHttpRequest;return K.onreadystatechange=function(){if(K.readyState===4)return N(null,K.status!==200?"error":void 0)},K.open("POST",w),K.setRequestHeader("Content-Type","text/plain"),void K.send(C)}N()}},rr=ot;function St(w){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},St(w)}var gr=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],Ei=["viewstart","error","ended","viewend"],ir=function(w,C){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=w,this.envKey=C,this.eventQueue=new rr(cr(C,F)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=F.sampleRate,this.disableCookies=F.disableCookies,this.respectDoNotTrack=F.respectDoNotTrack;var N=F.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:N.name,viewer_application_version:N.version,viewer_application_engine:N.layout,viewer_device_name:N.product,viewer_device_category:"",viewer_device_manufacturer:N.manufacturer,viewer_os_family:N.os&&N.os.family,viewer_os_architecture:N.os&&N.os.architecture,viewer_os_version:N.os&&N.os.version};var K=$e();K&&(this.pageLevelData=i()(this.pageLevelData,{viewer_connection_type:K})),_()!==void 0&&_().location&&_().location.href&&(this.pageLevelData.page_url=_().location.href),this.viewerData=this.disableCookies?{}:Et()};ir.prototype.send=function(w,C){if(w){if(this.respectDoNotTrack&&s())return e.info("Not sending `"+w+"` because Do Not Track is enabled");if(!C||St(C)!=="object")return e.error("A data object was expected in send() but was not provided");var F,N,K=this.disableCookies?{}:(F=st(),N=h.now(),F.session_start&&(F.sst=F.session_start,delete F.session_start),F.session_id&&(F.sid=F.session_id,delete F.session_id),F.session_expires&&(F.sex=F.session_expires,delete F.session_expires),(!F.sex||F.sex<N)&&(F.sid=y(),F.sst=N),F.sex=N+15e5,xt(F),{session_id:F.sid,session_start:F.sst,session_expires:F.sex}),V={};i()(V,this.pageLevelData),i()(V,C),i()(V,K),i()(V,this.viewerData),V.event=w,V.env_key=this.envKey,V.user_id&&(V.viewer_user_id=V.user_id,delete V.user_id);var H=V.mux_sample_number>=this.sampleRate,Q=Kt(this._deduplicateBeaconData(w,V));if(this.lastEventTime=this.mux.utils.now(),H)return e.info("Not sending event due to sample rate restriction",w,V,Q);if(this.envKey||e.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",w,V,Q),!this.rateLimited){if(e.info("Sending event",w,V,Q),this.rateLimited=!this.eventQueue.queueEvent(w,Q),this.mux.WINDOW_UNLOADING&&w==="viewend")this.eventQueue.destroy(!0);else if((Ei.indexOf(w)>=0||this.mux.WINDOW_HIDDEN&&w==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return V.event="eventrateexceeded",Q=Kt(V),this.eventQueue.queueEvent(V.event,Q),e.error("Beaconing disabled due to rate limit.")}}},ir.prototype.destroy=function(){this.eventQueue.destroy(!1)},ir.prototype._deduplicateBeaconData=function(w,C){var F=this,N={},K=C.view_id;if(!K||w==="viewstart"||w==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)N=i()({},C),K&&(this.previousBeaconData=N),K&&w==="viewend"&&(this.previousBeaconData=null);else{var V=w.indexOf("request")===0;Object.keys(C).forEach(function(H){var Q=C[H];(Q!==F.previousBeaconData[H]||gr.indexOf(H)>-1||function(J,X,ee,ce){return!(!J||X.indexOf("request_")!==0||X!=="request_response_headers"&&St(ee)==="object"&&St(ce)==="object"&&Object.keys(ee||{}).length===Object.keys(ce||{}).length)}(V,H,Q,F.previousBeaconData[H])||function(J,X){return J==="renditionchange"&&X.indexOf("video_source_")===0}(w,H))&&(N[H]=Q,F.previousBeaconData[H]=Q)})}return N};var yi=ir;function Ur(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Ti(w,C,F){return C&&Ur(w.prototype,C),F&&Ur(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var xi=Ti(function w(C){(function(X,ee){if(!(X instanceof ee))throw new TypeError("Cannot call a class as a function")})(this,w);var F=0,N=0,K=0,V=0,H=0,Q=0,J=0;C.on("requestcompleted",function(X,ee){var ce,ye,ve=ee.request_start,se=ee.request_response_start,le=ee.request_response_end,Se=ee.request_bytes_loaded;if(V++,se?(ce=se-ve,ye=le-se):ye=le-ve,ye>0&&Se>0){var Ye=Se/ye*8e3;H++,N+=Se,K+=ye,C.data.view_min_request_throughput=Math.min(C.data.view_min_request_throughput||1/0,Ye),C.data.view_average_request_throughput=N/K*8e3,C.data.view_request_count=V,ce>0&&(F+=ce,C.data.view_max_request_latency=Math.max(C.data.view_max_request_latency||0,ce),C.data.view_average_request_latency=F/H)}}),C.on("requestfailed",function(X,ee){V++,Q++,C.data.view_request_count=V,C.data.view_request_failed_count=Q}),C.on("requestcanceled",function(X,ee){V++,J++,C.data.view_request_count=V,C.data.view_request_canceled_count=J})});function Nr(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function Si(w,C,F){return C&&Nr(w.prototype,C),F&&Nr(w,F),Object.defineProperty(w,"prototype",{writable:!1}),w}var Di=Si(function w(C){var F=this;(function(N,K){if(!(N instanceof K))throw new TypeError("Cannot call a class as a function")})(this,w),C.on("before*",function(N,K){var V=K.viewer_time,H=h.now(),Q=F._lastEventTime;if(F._lastEventTime=H,Q&&H-Q>36e5){var J=Object.keys(C.data).reduce(function(X,ee){return ee.indexOf("video_")===0?i()(X,function(ce,ye,ve){return ye in ce?Object.defineProperty(ce,ye,{value:ve,enumerable:!0,configurable:!0,writable:!0}):ce[ye]=ve,ce}({},ee,C.data[ee])):X},{});C.mux.log.info("Received event after at least an hour inactivity, creating a new view"),C.emit("viewinit",i()({viewer_time:V},J)),C.playbackHeartbeat._playheadShouldBeProgressing&&N.type!=="play"&&N.type!=="adbreakstart"&&(C.emit("play",{viewer_time:V}),N.type!=="playing"&&C.emit("playing",{viewer_time:V}))}})});function mr(w){return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},mr(w)}function Ai(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return Kr(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?Kr(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Kr(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}function jr(w,C){for(var F=0;F<C.length;F++){var N=C[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(w,N.key,N)}}function pr(w,C){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(F,N){return F.__proto__=N,F},pr(w,C)}function Li(w){var C=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var F,N=nr(w);if(C){var K=nr(this).constructor;F=Reflect.construct(N,arguments,K)}else F=N.apply(this,arguments);return _i(this,F)}}function _i(w,C){if(C&&(mr(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return we(w)}function we(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function nr(w){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(C){return C.__proto__||Object.getPrototypeOf(C)},nr(w)}var bi=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],Oi=function(w){(function(H,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(Q&&Q.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),Object.defineProperty(H,"prototype",{writable:!1}),Q&&pr(H,Q)})(V,w);var C,F,N,K=Li(V);function V(H,Q,J){var X;(function(se,le){if(!(se instanceof le))throw new TypeError("Cannot call a class as a function")})(this,V),(X=K.call(this)).DOM_CONTENT_LOADED_EVENT_END=c.domContentLoadedEventEnd(),X.NAVIGATION_START=c.navigationStart(),X.mux=H,X.id=Q,(J=i()({debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(se){return se}},J)).data=J.data||{},J.data.property_key&&(J.data.env_key=J.data.property_key,delete J.data.property_key),e.setLevel(J.debug?"debug":"warn"),X.getPlayheadTime=J.getPlayheadTime,X.getStateData=J.getStateData||function(){return{}},X.getAdData=J.getAdData||function(){},X.minimumRebufferDuration=J.minimumRebufferDuration,X.sustainedRebufferThreshold=J.sustainedRebufferThreshold,X.playbackHeartbeatTime=J.playbackHeartbeatTime,X.disableRebufferTracking=J.disableRebufferTracking,X.disableRebufferTracking&&X.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),X.disablePlayheadRebufferTracking=J.disablePlayheadRebufferTracking,X.errorTranslator=J.errorTranslator,X.playbackEventDispatcher=new yi(H,J.data.env_key,J),X.data={player_instance_id:y(),mux_sample_rate:J.sampleRate,beacon_domain:J.beaconCollectionDomain?J.beaconCollectionDomain:J.beaconDomain},X.data.view_sequence_number=1,X.data.player_sequence_number=1,X.oldEmit=X.emit,X.emit=function(se,le){le=i()({viewer_time:this.mux.utils.now()},le),this.oldEmit(se,le)};var ee=function(){this.data.view_start===void 0&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(we(X));X.on("viewinit",function(se,le){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),i()(this.data,le),this._initializeViewData(),this.one("play",ee),this.one("adbreakstart",ee)});var ce=function(se){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",se)}.bind(we(X));if(X.on("videochange",function(se,le){ce(le)}),X.on("programchange",function(se,le){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),ce(i()(le,{view_program_changed:!0})),ee(),this.emit("play"),this.emit("playing")}),X.on("fragmentchange",function(se,le){this.currentFragmentPDT=le.currentFragmentPDT,this.currentFragmentStart=le.currentFragmentStart}),X.on("destroy",X.destroy),typeof window!="undefined"&&typeof window.addEventListener=="function"&&typeof window.removeEventListener=="function"){var ye=function(){var se=X.data.view_start!==void 0;X.mux.WINDOW_HIDDEN=document.visibilityState==="hidden",se&&X.mux.WINDOW_HIDDEN&&(X.data.player_is_paused||X.emit("hb"))};window.addEventListener("visibilitychange",ye,!1);var ve=function(se){se.persisted||X.destroy()};window.addEventListener("pagehide",ve,!1),X.on("destroy",function(){window.removeEventListener("visibilitychange",ye),window.removeEventListener("pagehide",ve)})}return X.on("playerready",function(se,le){i()(this.data,le)}),bi.forEach(function(se){X.on(se,function(le,Se){se.indexOf("ad")!==0&&this._updateStateData(),i()(this.data,Se),this._sanitizeData()}),X.on("after"+se,function(){(se!=="error"||this.errorTracker.viewErrored)&&this.send(se)})}),X.on("viewend",function(se,le){i()(X.data,le)}),X.one("playerready",function(se){var le=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=le-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time}),X.longResumeTracker=new Di(we(X)),X.errorTracker=new ie(we(X)),new Qe(we(X)),X.seekingTracker=new et(we(X)),X.playheadTime=new re(we(X)),X.playbackHeartbeat=new $(we(X)),new Ke(we(X)),X.watchTimeTracker=new ae(we(X)),new fe(we(X)),X.adTracker=new Ce(we(X)),new ke(we(X)),new Te(we(X)),new Be(we(X)),new We(we(X)),new xi(we(X)),J.hlsjs&&X.addHLSJS(J),J.dashjs&&X.addDashJS(J),X.emit("viewinit",J.data),X}return C=V,F=[{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.data.view_start!==void 0&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),window.clearTimeout(this._heartBeatTimeout))}},{key:"send",value:function(H){var Q=i()({},this.data);if(Q.video_source_is_live===void 0&&(Q.player_source_duration===1/0||Q.video_source_duration===1/0?Q.video_source_is_live=!0:(Q.player_source_duration>0||Q.video_source_duration>0)&&(Q.video_source_is_live=!1)),Q.video_source_is_live||["player_program_time","player_manifest_newest_program_time","player_live_edge_program_time","player_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"].forEach(function(ce){Q[ce]=void 0}),Q.video_source_url=Q.video_source_url||Q.player_source_url,Q.video_source_url){var J=Ai(o(Q.video_source_url),2),X=J[0],ee=J[1];Q.video_source_domain=ee,Q.video_source_hostname=X}delete Q.ad_request_id,this.playbackEventDispatcher.send(H,Q),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()}},{key:"_updateStateData",value:function(){i()(this.data,this.getStateData()),this.playheadTime._updatePlayheadTime(),this._sanitizeData()}},{key:"_sanitizeData",value:function(){var H=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(Q){var J=parseInt(H.data[Q],10);H.data[Q]=isNaN(J)?void 0:J}),["player_source_url","video_source_url"].forEach(function(Q){if(H.data[Q]){var J=H.data[Q].toLowerCase();J.indexOf("data:")!==0&&J.indexOf("blob:")!==0||(H.data[Q]="MSE style URL")}})}},{key:"_resetVideoData",value:function(H,Q){var J=this;Object.keys(this.data).forEach(function(X){X.indexOf("video_")===0&&delete J.data[X]})}},{key:"_resetViewData",value:function(){var H=this;Object.keys(this.data).forEach(function(Q){Q.indexOf("view_")===0&&delete H.data[Q]}),this.data.view_sequence_number=1}},{key:"_resetErrorData",value:function(H,Q){delete this.data.player_error_code,delete this.data.player_error_message}},{key:"_initializeViewData",value:function(){var H=this,Q=this.data.view_id=y(),J=function(){Q===H.data.view_id&&t(H.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",J):J()}},{key:"_restartHeartBeat",value:function(){var H=this;window.clearTimeout(this._heartBeatTimeout),this.errorTracker.viewErrored||(this._heartBeatTimeout=window.setTimeout(function(){H.data.player_is_paused||H.emit("hb")},1e4))}},{key:"addHLSJS",value:function(H){H.hlsjs?this.hlsjs?this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=H.hlsjs,function(Q,J,X){var ee=arguments.length>4?arguments[4]:void 0,ce=Q.log,ye=Q.utils.secondsToMs,ve=function(pe){var oe,he=parseInt(ee.version);return he===1&&pe.programDateTime!==null&&(oe=pe.programDateTime),he===0&&pe.pdt!==null&&(oe=pe.pdt),oe};if(c.exists()){var se=function(pe,oe){return Q.emit(J,pe,oe)},le=function(pe,oe){var he=oe.levels,ue=oe.audioTracks,ge=oe.url,Re=oe.stats,Ae=oe.networkDetails,it=oe.sessionData,qe={},ct={};he.forEach(function(gt,Gt){qe[Gt]={width:gt.width,height:gt.height,bitrate:gt.bitrate,attrs:gt.attrs}}),ue.forEach(function(gt,Gt){ct[Gt]={name:gt.name,language:gt.lang,bitrate:gt.bitrate}});var ht=T(Re),vt=ht.bytesLoaded,He=ht.requestStart,xr=ht.responseStart,Sr=ht.responseEnd;se("requestcompleted",v(v({},a(it)),{},{request_event_type:pe,request_bytes_loaded:vt,request_start:He,request_response_start:xr,request_response_end:Sr,request_type:"manifest",request_hostname:r(ge),request_response_headers:I(Ae),request_rendition_lists:{media:qe,audio:ct,video:{}}}))};X.on(ee.Events.MANIFEST_LOADED,le);var Se=function(pe,oe){var he=oe.details,ue=oe.level,ge=oe.networkDetails,Re=oe.stats,Ae=T(Re),it=Ae.bytesLoaded,qe=Ae.requestStart,ct=Ae.responseStart,ht=Ae.responseEnd,vt=he.fragments[he.fragments.length-1],He=ve(vt)+ye(vt.duration);se("requestcompleted",{request_event_type:pe,request_bytes_loaded:it,request_start:qe,request_response_start:ct,request_response_end:ht,request_current_level:ue,request_type:"manifest",request_hostname:r(he.url),request_response_headers:I(ge),video_holdback:he.holdBack&&ye(he.holdBack),video_part_holdback:he.partHoldBack&&ye(he.partHoldBack),video_part_target_duration:he.partTarget&&ye(he.partTarget),video_target_duration:he.targetduration&&ye(he.targetduration),video_source_is_live:he.live,player_manifest_newest_program_time:isNaN(He)?void 0:He})};X.on(ee.Events.LEVEL_LOADED,Se);var Ye=function(pe,oe){var he=oe.details,ue=oe.networkDetails,ge=oe.stats,Re=T(ge),Ae=Re.bytesLoaded,it=Re.requestStart,qe=Re.responseStart,ct=Re.responseEnd;se("requestcompleted",{request_event_type:pe,request_bytes_loaded:Ae,request_start:it,request_response_start:qe,request_response_end:ct,request_type:"manifest",request_hostname:r(he.url),request_response_headers:I(ue)})};X.on(ee.Events.AUDIO_TRACK_LOADED,Ye);var Je=function(pe,oe){var he=oe.stats,ue=oe.networkDetails,ge=oe.frag;he=he||ge.stats;var Re=T(he),Ae={request_event_type:pe,request_bytes_loaded:Re.bytesLoaded,request_start:Re.requestStart,request_response_start:Re.responseStart,request_response_end:Re.responseEnd,request_hostname:ue?r(ue.responseURL):void 0,request_response_headers:I(ue),request_media_duration:ge.duration};ge.type==="main"?(Ae.request_type="media",Ae.request_current_level=ge.level,Ae.request_video_width=(X.levels[ge.level]||{}).width,Ae.request_video_height=(X.levels[ge.level]||{}).height):Ae.request_type=ge.type,se("requestcompleted",Ae)};X.on(ee.Events.FRAG_LOADED,Je);var Dt=function(pe,oe){var he=oe.frag,ue=he.start,ge={currentFragmentPDT:ve(he),currentFragmentStart:ye(ue)};se("fragmentchange",ge)};X.on(ee.Events.FRAG_CHANGED,Dt);var De=function(pe,oe){var he=oe.type,ue=oe.details,ge=oe.response,Re=oe.fatal,Ae=oe.context,it=oe.frag;if(ue===ee.ErrorDetails.MANIFEST_LOAD_ERROR||ue===ee.ErrorDetails.MANIFEST_LOAD_TIMEOUT||ue===ee.ErrorDetails.FRAG_LOAD_ERROR||ue===ee.ErrorDetails.FRAG_LOAD_TIMEOUT||ue===ee.ErrorDetails.LEVEL_LOAD_ERROR||ue===ee.ErrorDetails.LEVEL_LOAD_TIMEOUT){var qe=it&&it.url||Ae&&Ae.url||"";se("requestfailed",{request_error:ue,request_url:qe,request_hostname:r(qe),request_type:ue===ee.ErrorDetails.FRAG_LOAD_ERROR||ue===ee.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:ge&&ge.code,request_error_text:ge&&ge.text})}Re&&se("error",{player_error_code:he,player_error_message:ue})};X.on(ee.Events.ERROR,De);var Ze=function(pe,oe){var he=oe.frag,ue=he&&he._url||"";se("requestcanceled",{request_event_type:pe,request_url:ue,request_type:"media",request_hostname:r(ue)})};X.on(ee.Events.FRAG_LOAD_EMERGENCY_ABORTED,Ze);var Ge=function(pe,oe){var he=oe.level,ue=X.levels[he];if(ue&&ue.attrs&&ue.attrs.BANDWIDTH){var ge,Re=ue.attrs.BANDWIDTH,Ae=parseFloat(ue.attrs["FRAME-RATE"]);isNaN(Ae)||(ge=Ae),Re?se("renditionchange",{video_source_fps:ge,video_source_bitrate:Re,video_source_width:ue.width,video_source_height:ue.height}):ce.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};X.on(ee.Events.LEVEL_SWITCHED,Ge),X._stopMuxMonitor=function(){X.off(ee.Events.MANIFEST_LOADED,le),X.off(ee.Events.LEVEL_LOADED,Se),X.off(ee.Events.AUDIO_TRACK_LOADED,Ye),X.off(ee.Events.FRAG_LOADED,Je),X.off(ee.Events.FRAG_CHANGED,Dt),X.off(ee.Events.ERROR,De),X.off(ee.Events.FRAG_LOAD_EMERGENCY_ABORTED,Ze),X.off(ee.Events.LEVEL_SWITCHED,Ge),X.off(ee.Events.DESTROYING,X._stopMuxMonitor),delete X._stopMuxMonitor},X.on(ee.Events.DESTROYING,X._stopMuxMonitor)}else ce.warn("performance timing not supported. Not tracking HLS.js.")}(this.mux,this.id,H.hlsjs,{},H.Hls||window.Hls)):this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")}},{key:"removeHLSJS",value:function(){var H;this.hlsjs&&((H=this.hlsjs)&&typeof H._stopMuxMonitor=="function"&&H._stopMuxMonitor(),this.hlsjs=void 0)}},{key:"addDashJS",value:function(H){H.dashjs?this.dashjs?this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=H.dashjs,function(Q,J,X){var ee=Q.log;if(X&&X.on){var ce=function(De,Ze){return Q.emit(J,De,Ze)},ye=function(De){var Ze=De.type,Ge=(De.data||{}).url;ce("requestcompleted",{request_event_type:Ze,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:r(Ge)})};X.on("manifestLoaded",ye);var ve={},se=function(De){var Ze=De.type,Ge=De.fragmentModel,pe=(De.chunk||{}).mediaInfo||{},oe=pe.type,he=pe.bitrateList,ue={};(he=he||[]).forEach(function(vt,He){ue[He]={},ue[He].width=vt.width,ue[He].height=vt.height,ue[He].bitrate=vt.bandwidth,ue[He].attrs={}}),oe==="video"?ve.video=ue:oe==="audio"?ve.audio=ue:ve.media=ue;var ge=k(Ge,X),Re=ge.requestStart,Ae=ge.requestResponseStart,it=ge.requestResponseEnd,qe=ge.requestResponseHeaders,ct=ge.requestMediaDuration,ht=ge.requestHostname;ce("requestcompleted",{request_event_type:Ze,request_start:Re,request_response_start:Ae,request_response_end:it,request_bytes_loaded:-1,request_type:oe+"_init",request_response_headers:qe,request_hostname:ht,request_media_duration:ct,request_rendition_lists:ve})};X.on("initFragmentLoaded",se);var le=function(De){var Ze=De.type,Ge=De.fragmentModel,pe=De.chunk||{},oe=pe.mediaInfo,he=pe.start,ue=(oe||{}).type,ge=k(Ge,X),Re=ge.requestStart,Ae=ge.requestResponseStart,it=ge.requestResponseEnd,qe=ge.requestBytesLoaded,ct=ge.requestResponseHeaders,ht=ge.requestMediaDuration,vt=ge.requestHostname,He=B(ue,X),xr=He.currentLevel,Sr=He.renditionWidth,gt=He.renditionHeight,Gt=He.renditionBitrate;ce("requestcompleted",{request_event_type:Ze,request_start:Re,request_response_start:Ae,request_response_end:it,request_bytes_loaded:qe,request_type:ue,request_response_headers:ct,request_hostname:vt,request_media_start_time:he,request_media_duration:ht,request_current_level:xr,request_labeled_bitrate:Gt,request_video_width:Sr,request_video_height:gt})};X.on("mediaFragmentLoaded",le);var Se={video:void 0,audio:void 0,totalBitrate:void 0},Ye=function(){if(Se.video&&typeof Se.video.bitrate=="number"){if(Se.video.width&&Se.video.height){var De=Se.video.bitrate;return Se.audio&&typeof Se.audio.bitrate=="number"&&(De+=Se.audio.bitrate),De!==Se.totalBitrate?(Se.totalBitrate=De,{video_source_bitrate:De,video_source_height:Se.video.height,video_source_width:Se.video.width}):void 0}ee.warn("have bitrate info for video but missing width/height")}},Je=function(De,Ze,Ge){if(typeof De.newQuality=="number"){var pe=De.mediaType;if(pe==="audio"||pe==="video"){var oe=X.getBitrateInfoListFor(pe).find(function(ue){return ue.qualityIndex===De.newQuality});if(oe&&typeof oe.bitrate=="number"){Se[pe]=oe;var he=Ye();he&&ce("renditionchange",he)}else ee.warn("missing bitrate info for ".concat(pe))}}else ee.warn("missing evt.newQuality in qualityChangeRendered event",De)};X.on("qualityChangeRendered",Je);var Dt=function(De){var Ze=De.error,Ge=De.event,pe=(Ge=Ge||{}).request||{},oe=_().event&&_().event.currentTarget||{};ce("requestfailed",{request_error:Ze+"_"+Ge.id+"_"+pe.type,request_url:Ge.url,request_hostname:r(Ge.url),request_type:pe.mediaType,request_error_code:oe.status,request_error_type:oe.statusText})};X.on("error",Dt),X._stopMuxMonitor=function(){X.off("manifestLoaded",ye),X.off("initFragmentLoaded",se),X.off("mediaFragmentLoaded",le),X.off("qualityChangeRendered",Je),X.off("error",Dt),delete X._stopMuxMonitor}}else ee.warn("Invalid dash.js player reference. Monitoring blocked.")}(this.mux,this.id,H.dashjs)):this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")}},{key:"removeDashJS",value:function(){var H;this.dashjs&&((H=this.dashjs)&&typeof H._stopMuxMonitor=="function"&&H._stopMuxMonitor(),this.dashjs=void 0)}}],F&&jr(C.prototype,F),N&&jr(C,N),Object.defineProperty(C,"prototype",{writable:!1}),V}(z),Ri=Oi,Ii=O(153),jt=O.n(Ii);function Er(w){return Er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Er(w)}function Wr(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return Gr(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?Gr(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Gr(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}var Pt,Pi=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],Ci={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"};_()&&_().WeakMap&&(Pt=new WeakMap);var Mi="#EXT-X-TARGETDURATION",Fi="#EXT-X-PART-INF",wi="#EXT-X-SERVER-CONTROL",ki="#EXTINF",Bi="#EXT-X-PROGRAM-DATE-TIME",Ui="#EXT-X-VERSION",Ni="#EXT-X-SESSION-DATA",ar=function(w){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(w),this.manifest};ar.prototype.process=function(w){var C;for(this.buffer+=w,C=this.buffer.indexOf(`
|
|
5
5
|
`);C>-1;C=this.buffer.indexOf(`
|
|
6
|
-
`))this.processLine(this.buffer.substring(0,C)),this.buffer=this.buffer.substring(C+1)},ar.prototype.processLine=function(w){var C=w.indexOf(":"),F=Gi(w,C),N=F[0],K=F.length===2?Tr(F[1]):void 0;if(N[0]!=="#")this.currentUri.uri=N,this.manifest.segments.push(this.currentUri),this.manifest.targetDuration&&!("duration"in this.currentUri)&&(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(N){case Mi:if(!isFinite(K)||K<0)return;this.manifest.targetDuration=K,this.setHoldBack();break;case Fi:yr(this.manifest,F),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case wi:yr(this.manifest,F),this.setHoldBack();break;case ki:K===0?this.currentUri.duration=.01:K>0&&(this.currentUri.duration=K);break;case Bi:var V=K,H=new Date(V);this.manifest.dateTimeString||(this.manifest.dateTimeString=V,this.manifest.dateTimeObject=H),this.currentUri.dateTimeString=V,this.currentUri.dateTimeObject=H;break;case Ui:yr(this.manifest,F);break;case Ni:var Q=Hi(F[1]),J=a(Q);i()(this.manifest.sessionData,J)}},ar.prototype.setHoldBack=function(){var w=this.manifest,C=w.serverControl,F=w.targetDuration,N=w.partTargetDuration;if(C){var K="holdBack",V="partHoldBack",H=F&&3*F,Q=N&&2*N;F&&!C.hasOwnProperty(K)&&(C[K]=H),H&&C[K]<H&&(C[K]=H),N&&!C.hasOwnProperty(V)&&(C[V]=3*N),N&&C[V]<Q&&(C[V]=Q)}};var yr=function(w,C){var F,N=
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Hr(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}var rt={},Wt=function w(C){var F=arguments;typeof C=="string"?w.hasOwnProperty(C)?_().setTimeout(function(){F=Array.prototype.splice.call(F,1),w[C].apply(null,F)},0):e.warn("`"+C+"` is an unknown task"):typeof C=="function"?_().setTimeout(function(){C(w)},0):e.warn("`"+C+"` is invalid.")},Qi={loaded:h.now(),NAME:"mux-embed",VERSION:"4.14.0",API_VERSION:"2.1",PLAYER_TRACKED:!1,monitor:function(w,C){return function(F,N,K){var V=jr(E(N),3),H=V[0],Q=V[1],J=V[2],X=F.log,ee=F.utils.getComputedStyle,ce=F.utils.secondsToMs;if(!H)return X.error("No element was found with the `"+Q+"` query selector.");if(J!=="video"&&J!=="audio")return X.error("The element of `"+Q+"` was not a media element.");H.mux&&(H.mux.destroy(),delete H.mux,X.warn("Already monitoring this video element, replacing existing event listeners")),(K=i()({automaticErrorTracking:!0},K)).data=i()({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:F.VERSION},K.data),K.getPlayheadTime=function(){return ce(H.currentTime)},K.getStateData=function(){var ve=this.hlsjs&&this.hlsjs.url,se=this.dashjs&&Er(this.dashjs.getSource==="function")&&this.dashjs.getSource(),le={player_is_paused:H.paused,player_playhead_time:ce(H.currentTime),player_width:parseInt(ee(H,"width")),player_height:parseInt(ee(H,"height")),player_autoplay_on:H.autoplay,player_preload_on:H.preload,player_language_code:H.lang,player_is_fullscreen:jt()&&!!(jt().fullscreenElement||jt().webkitFullscreenElement||jt().mozFullScreenElement||jt().msFullscreenElement),video_poster_url:H.poster,video_source_url:ve||se||H.currentSrc,video_source_duration:ce(H.duration),video_source_height:H.videoHeight,video_source_width:H.videoWidth},xe=K.getPlayheadTime();if(H.getStartDate&&xe>0){var Ye=H.getStartDate();if(Ye&&typeof Ye.getTime=="function"&&Ye.getTime()){var Je=Ye.getTime();if(le.player_program_time=Je+xe,H.seekable.length>0){var Dt=Je+H.seekable.end(H.seekable.length-1);le.player_live_edge_program_time=Dt}}}return le},H.mux=H.mux||{},H.mux.deleted=!1,H.mux.emit=function(ve,se){F.emit(Q,ve,se)};var ye=function(){X.error("The monitor for this video element has already been destroyed.")};H.mux.destroy=function(){Object.keys(H.mux.listeners).forEach(function(ve){H.removeEventListener(ve,H.mux.listeners[ve],!1)}),delete H.mux.listeners,H.mux.destroy=ye,H.mux.swapElement=ye,H.mux.emit=ye,H.mux.addHLSJS=ye,H.mux.addDashJS=ye,H.mux.removeHLSJS=ye,H.mux.removeDashJS=ye,H.mux.deleted=!0,F.emit(Q,"destroy")},H.mux.swapElement=function(ve){var se=jr(E(ve),3),le=se[0],xe=se[1],Ye=se[2];return le?Ye!=="video"&&Ye!=="audio"?F.log.error("The element of `"+xe+"` was not a media element."):(le.muxId=H.muxId,delete H.muxId,le.mux=le.mux||{},le.mux.listeners=i()({},H.mux.listeners),delete H.mux.listeners,Object.keys(le.mux.listeners).forEach(function(Je){H.removeEventListener(Je,le.mux.listeners[Je],!1),le.addEventListener(Je,le.mux.listeners[Je],!1)}),le.mux.swapElement=H.mux.swapElement,le.mux.destroy=H.mux.destroy,delete H.mux,void(H=le)):F.log.error("No element was found with the `"+xe+"` query selector.")},H.mux.addHLSJS=function(ve){F.addHLSJS(Q,ve)},H.mux.addDashJS=function(ve){F.addDashJS(Q,ve)},H.mux.removeHLSJS=function(){F.removeHLSJS(Q)},H.mux.removeDashJS=function(){F.removeDashJS(Q)},F.init(Q,K),F.emit(Q,"playerready"),H.paused||(F.emit(Q,"play"),H.readyState>2&&F.emit(Q,"playing")),H.mux.listeners={},Pi.forEach(function(ve){(ve!=="error"||K.automaticErrorTracking)&&(H.mux.listeners[ve]=function(){var se={};if(ve==="error"){if(!H.error||H.error.code===1)return;se.player_error_code=H.error.code,se.player_error_message=Ci[H.error.code]||H.error.message}F.emit(Q,ve,se)},H.addEventListener(ve,H.mux.listeners[ve],!1))})}(Wt,w,C)},destroyMonitor:function(w){var C=Xi(E(w),1)[0];C&&C.mux&&typeof C.mux.destroy=="function"?C.mux.destroy():e.error("A video element monitor for `"+w+"` has not been initialized via `mux.monitor`.")},addHLSJS:function(w,C){var F=D(w);rt[F]?rt[F].addHLSJS(C):e.error("A monitor for `"+F+"` has not been initialized.")},addDashJS:function(w,C){var F=D(w);rt[F]?rt[F].addDashJS(C):e.error("A monitor for `"+F+"` has not been initialized.")},removeHLSJS:function(w){var C=D(w);rt[C]?rt[C].removeHLSJS():e.error("A monitor for `"+C+"` has not been initialized.")},removeDashJS:function(w){var C=D(w);rt[C]?rt[C].removeDashJS():e.error("A monitor for `"+C+"` has not been initialized.")},init:function(w,C){s()&&C&&C.respectDoNotTrack&&e.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var F=D(w);rt[F]=new Ri(Wt,F,C)},emit:function(w,C,F){var N=D(w);rt[N]?(rt[N].emit(C,F),C==="destroy"&&delete rt[N]):e.error("A monitor for `"+N+"` has not been initialized.")},checkDoNotTrack:s,log:e,utils:Yi,events:zi,WINDOW_HIDDEN:!1,WINDOW_UNLOADING:!1};Object.assign(Wt,Qi),_()!==void 0&&typeof _().addEventListener=="function"&&_().addEventListener("pagehide",function(w){w.persisted||(Wt.WINDOW_UNLOADING=!0)},!1);var $i=Wt},655:function(A,M,O){var b,_;function y(x){return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},y(x);}(function(x){var D=!1;if((_=typeof(b=x)=="function"?b.call(M,O,M,A):b)===void 0||(A.exports=_),D=!0,y(M)==="object"&&(A.exports=x(),D=!0),!D){var E=window.Cookies,m=window.Cookies=x();m.noConflict=function(){return window.Cookies=E,m}}})(function(){var x=function(){for(var D=0,E={};D<arguments.length;D++){var m=arguments[D];for(var p in m)E[p]=m[p]}return E};return function D(E){function m(p,f,e){var s;if(typeof document!="undefined"){if(arguments.length>1){if(typeof(e=x({path:"/"},m.defaults,e)).expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*e.expires),e.expires=h}try{s=JSON.stringify(f),/^[\{\[]/.test(s)&&(f=s)}catch{}return f=E.write?E.write(f,p):encodeURIComponent(String(f)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=(p=(p=encodeURIComponent(String(p))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[p,"=",f,e.expires?"; expires="+e.expires.toUTCString():"",e.path?"; path="+e.path:"",e.domain?"; domain="+e.domain:"",e.secure?"; secure":""].join("")}p||(s={});for(var g=document.cookie?document.cookie.split("; "):[],i=/(%[0-9A-Z]{2})+/g,r=0;r<g.length;r++){var o=g[r].split("="),c=o.slice(1).join("=");c.charAt(0)==='"'&&(c=c.slice(1,-1));try{var t=o[0].replace(i,decodeURIComponent);if(c=E.read?E.read(c,t):E(c,t)||c.replace(i,decodeURIComponent),this.json)try{c=JSON.parse(c)}catch{}if(p===t){s=c;break}p||(s[t]=c)}catch{}}return s}}return m.set=m,m.get=function(p){return m.call(m,p)},m.getJSON=function(){return m.apply({json:!0},[].slice.call(arguments))},m.defaults={},m.remove=function(p,f){m(p,"",x(f,{expires:-1}))},m.withConverter=D,m}(function(){})})},153:function(A,M,O){var b,_=O.g!==void 0?O.g:typeof window!="undefined"?window:{},y=O(558);typeof document!="undefined"?b=document:(b=_["__GLOBAL_DOCUMENT_CACHE@4"])||(b=_["__GLOBAL_DOCUMENT_CACHE@4"]=y),A.exports=b},48:function(A,M,O){var b;b=typeof window!="undefined"?window:O.g!==void 0?O.g:typeof self!="undefined"?self:{},A.exports=b},678:function(A){var M=9007199254740991,O="[object Arguments]",b="[object Function]",_="[object GeneratorFunction]",y=/^(?:0|[1-9]\d*)$/;function x(S,T,I){switch(I.length){case 0:return S.call(T);case 1:return S.call(T,I[0]);case 2:return S.call(T,I[0],I[1]);case 3:return S.call(T,I[0],I[1],I[2])}return S.apply(T,I)}var D,E,m=Object.prototype,p=m.hasOwnProperty,f=m.toString,e=m.propertyIsEnumerable,s=(D=Object.keys,E=Object,function(S){return D(E(S))}),h=Math.max,g=!e.call({valueOf:1},"valueOf");function i(S,T){var I=n(S)||function(W){return function(G){return function(z){return!!z&&typeof z=="object"}(G)&&u(G)}(W)&&p.call(W,"callee")&&(!e.call(W,"callee")||f.call(W)==O)}(S)?function(W,G){for(var z=-1,Y=Array(W);++z<W;)Y[z]=G(z);return Y}(S.length,String):[],k=I.length,B=!!k;for(var U in S)!T&&!p.call(S,U)||B&&(U=="length"||o(U,k))||I.push(U);return I}function r(S,T,I){var k=S[T];p.call(S,T)&&t(k,I)&&(I!==void 0||T in S)||(S[T]=I)}function o(S,T){return!!(T=T==null?M:T)&&(typeof S=="number"||y.test(S))&&S>-1&&S%1==0&&S<T}function c(S){var T=S&&S.constructor;return S===(typeof T=="function"&&T.prototype||m)}function t(S,T){return S===T||S!=S&&T!=T}var n=Array.isArray;function u(S){return S!=null&&function(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=M}(S.length)&&!function(T){var I=a(T)?f.call(T):"";return I==b||I==_}(S)}function a(S){var T=typeof S;return!!S&&(T=="object"||T=="function")}var d,v=(d=function(S,T){if(g||c(T)||u(T))(function(k,B,U,W){U||(U={});for(var G=-1,z=B.length;++G<z;){var Y=B[G],$=W?W(U[Y],k[Y],Y,U,k):void 0;r(U,Y,$===void 0?k[Y]:$)}})(T,function(k){return u(k)?i(k):function(B){if(!c(B))return s(B);var U=[];for(var W in Object(B))p.call(B,W)&&W!="constructor"&&U.push(W);return U}(k)}(T),S);else for(var I in T)p.call(T,I)&&r(S,I,T[I])},function(S,T){return T=h(T===void 0?S.length-1:T,0),function(){for(var I=arguments,k=-1,B=h(I.length-T,0),U=Array(B);++k<B;)U[k]=I[T+k];k=-1;for(var W=Array(T+1);++k<T;)W[k]=I[k];return W[T]=U,x(S,this,W)}}(function(S,T){var I=-1,k=T.length,B=k>1?T[k-1]:void 0,U=k>2?T[2]:void 0;for(B=d.length>3&&typeof B=="function"?(k--,B):void 0,U&&function(G,z,Y){if(!a(Y))return!1;var $=typeof z;return!!($=="number"?u(Y)&&o(z,Y.length):$=="string"&&z in Y)&&t(Y[z],G)}(T[0],T[1],U)&&(B=k<3?void 0:B,k=1),S=Object(S);++I<k;){var W=T[I];W&&d(S,W,I,B)}return S}));A.exports=v},640:function(A,M,O){var b,_;(function(y,x){"use strict";b=function(){var D=function(){},E="undefined",m=typeof window!==E&&typeof window.navigator!==E&&/Trident\/|MSIE /.test(window.navigator.userAgent),p=["trace","debug","info","warn","error"];function f(n,u){var a=n[u];if(typeof a.bind=="function")return a.bind(n);try{return Function.prototype.bind.call(a,n)}catch{return function(){return Function.prototype.apply.apply(a,[n,arguments])}}}function e(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(n){return n==="debug"&&(n="log"),typeof console!==E&&(n==="trace"&&m?e:console[n]!==void 0?f(console,n):console.log!==void 0?f(console,"log"):D)}function h(n,u){for(var a=0;a<p.length;a++){var d=p[a];this[d]=a<n?D:this.methodFactory(d,n,u)}this.log=this.debug}function g(n,u,a){return function(){typeof console!==E&&(h.call(this,u,a),this[n].apply(this,arguments))}}function i(n,u,a){return s(n)||g.apply(this,arguments)}function r(n,u,a){var d,v=this;u=u==null?"WARN":u;var S="loglevel";function T(U){var W=(p[U]||"silent").toUpperCase();if(typeof window!==E&&S){try{return void(window.localStorage[S]=W)}catch{}try{window.document.cookie=encodeURIComponent(S)+"="+W+";"}catch{}}}function I(){var U;if(typeof window!==E&&S){try{U=window.localStorage[S]}catch{}if(typeof U===E)try{var W=window.document.cookie,G=W.indexOf(encodeURIComponent(S)+"=");G!==-1&&(U=/^([^;]+)/.exec(W.slice(G))[1])}catch{}return v.levels[U]===void 0&&(U=void 0),U}}function k(){if(typeof window!==E&&S){try{return void window.localStorage.removeItem(S)}catch{}try{window.document.cookie=encodeURIComponent(S)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}typeof n=="string"?S+=":"+n:typeof n=="symbol"&&(S=void 0),v.name=n,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=a||i,v.getLevel=function(){return d},v.setLevel=function(U,W){if(typeof U=="string"&&v.levels[U.toUpperCase()]!==void 0&&(U=v.levels[U.toUpperCase()]),!(typeof U=="number"&&U>=0&&U<=v.levels.SILENT))throw"log.setLevel() called with invalid level: "+U;if(d=U,W!==!1&&T(U),h.call(v,U,n),typeof console===E&&U<v.levels.SILENT)return"No console available for logging"},v.setDefaultLevel=function(U){u=U,I()||v.setLevel(U,!1)},v.resetLevel=function(){v.setLevel(u,!1),k()},v.enableAll=function(U){v.setLevel(v.levels.TRACE,U)},v.disableAll=function(U){v.setLevel(v.levels.SILENT,U)};var B=I();B==null&&(B=u),v.setLevel(B,!1)}var o=new r,c={};o.getLogger=function(n){if(typeof n!="symbol"&&typeof n!="string"||n==="")throw new TypeError("You must supply a name when creating a logger.");var u=c[n];return u||(u=c[n]=new r(n,o.getLevel(),o.methodFactory)),u};var t=typeof window!==E?window.log:void 0;return o.noConflict=function(){return typeof window!==E&&window.log===o&&(window.log=t),o},o.getLoggers=function(){return c},o.default=o,o},(_=typeof b=="function"?b.call(M,O,M,A):b)===void 0||(A.exports=_)})()},375:function(A,M){"use strict";var O=Object.prototype.hasOwnProperty;function b(y){try{return decodeURIComponent(y.replace(/\+/g," "))}catch{return null}}function _(y){try{return encodeURIComponent(y)}catch{return null}}M.stringify=function(y,x){x=x||"";var D,E,m=[];for(E in typeof x!="string"&&(x="?"),y)if(O.call(y,E)){if((D=y[E])||D!=null&&!isNaN(D)||(D=""),E=_(E),D=_(D),E===null||D===null)continue;m.push(E+"="+D)}return m.length?x+m.join("&"):""},M.parse=function(y){for(var x,D=/([^=?#&]+)=?([^&]*)/g,E={};x=D.exec(y);){var m=b(x[1]),p=b(x[2]);m===null||p===null||m in E||(E[m]=p)}return E}},558:function(){}},P={};function L(A){var M=P[A];if(M!==void 0)return M.exports;var O=P[A]={exports:{}};return l[A].call(O.exports,O,O.exports,L),O.exports}return L.n=function(A){var M=A&&A.__esModule?function(){return A.default}:function(){return A};return L.d(M,{a:M}),M},L.d=function(A,M){for(var O in M)L.o(M,O)&&!L.o(A,O)&&Object.defineProperty(A,O,{enumerable:!0,get:M[O]})},L.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),L.o=function(A,M){return Object.prototype.hasOwnProperty.call(A,M)},L(80)}()},typeof or=="object"&&typeof br=="object"?br.exports=R():typeof or=="object"?or.mux=R():j.mux=R()})()});var lr=Yr((Yt,Or)=>{typeof window!="undefined"&&function(R,l){typeof Yt=="object"&&typeof Or=="object"?Or.exports=l():typeof define=="function"&&define.amd?define([],l):typeof Yt=="object"?Yt.Hls=l():R.Hls=l()}(Yt,function(){return function(j){var R={};function l(P){if(R[P])return R[P].exports;var L=R[P]={i:P,l:!1,exports:{}};return j[P].call(L.exports,L,L.exports,l),L.l=!0,L.exports}return l.m=j,l.c=R,l.d=function(P,L,A){l.o(P,L)||Object.defineProperty(P,L,{enumerable:!0,get:A})},l.r=function(P){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})},l.t=function(P,L){if(L&1&&(P=l(P)),L&8||L&4&&typeof P=="object"&&P&&P.__esModule)return P;var A=Object.create(null);if(l.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:P}),L&2&&typeof P!="string")for(var M in P)l.d(A,M,function(O){return P[O]}.bind(null,M));return A},l.n=function(P){var L=P&&P.__esModule?function(){return P.default}:function(){return P};return l.d(L,"a",L),L},l.o=function(P,L){return Object.prototype.hasOwnProperty.call(P,L)},l.p="/dist/",l(l.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(j,R,l){"use strict";var P=Object.prototype.hasOwnProperty,L="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(L=!1));function M(y,x,D){this.fn=y,this.context=x,this.once=D||!1}function O(y,x,D,E,m){if(typeof D!="function")throw new TypeError("The listener must be a function");var p=new M(D,E||y,m),f=L?L+x:x;return y._events[f]?y._events[f].fn?y._events[f]=[y._events[f],p]:y._events[f].push(p):(y._events[f]=p,y._eventsCount++),y}function b(y,x){--y._eventsCount===0?y._events=new A:delete y._events[x]}function _(){this._events=new A,this._eventsCount=0}_.prototype.eventNames=function(){var x=[],D,E;if(this._eventsCount===0)return x;for(E in D=this._events)P.call(D,E)&&x.push(L?E.slice(1):E);return Object.getOwnPropertySymbols?x.concat(Object.getOwnPropertySymbols(D)):x},_.prototype.listeners=function(x){var D=L?L+x:x,E=this._events[D];if(!E)return[];if(E.fn)return[E.fn];for(var m=0,p=E.length,f=new Array(p);m<p;m++)f[m]=E[m].fn;return f},_.prototype.listenerCount=function(x){var D=L?L+x:x,E=this._events[D];return E?E.fn?1:E.length:0},_.prototype.emit=function(x,D,E,m,p,f){var e=L?L+x:x;if(!this._events[e])return!1;var s=this._events[e],h=arguments.length,g,i;if(s.fn){switch(s.once&&this.removeListener(x,s.fn,void 0,!0),h){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,D),!0;case 3:return s.fn.call(s.context,D,E),!0;case 4:return s.fn.call(s.context,D,E,m),!0;case 5:return s.fn.call(s.context,D,E,m,p),!0;case 6:return s.fn.call(s.context,D,E,m,p,f),!0}for(i=1,g=new Array(h-1);i<h;i++)g[i-1]=arguments[i];s.fn.apply(s.context,g)}else{var r=s.length,o;for(i=0;i<r;i++)switch(s[i].once&&this.removeListener(x,s[i].fn,void 0,!0),h){case 1:s[i].fn.call(s[i].context);break;case 2:s[i].fn.call(s[i].context,D);break;case 3:s[i].fn.call(s[i].context,D,E);break;case 4:s[i].fn.call(s[i].context,D,E,m);break;default:if(!g)for(o=1,g=new Array(h-1);o<h;o++)g[o-1]=arguments[o];s[i].fn.apply(s[i].context,g)}}return!0},_.prototype.on=function(x,D,E){return O(this,x,D,E,!1)},_.prototype.once=function(x,D,E){return O(this,x,D,E,!0)},_.prototype.removeListener=function(x,D,E,m){var p=L?L+x:x;if(!this._events[p])return this;if(!D)return b(this,p),this;var f=this._events[p];if(f.fn)f.fn===D&&(!m||f.once)&&(!E||f.context===E)&&b(this,p);else{for(var e=0,s=[],h=f.length;e<h;e++)(f[e].fn!==D||m&&!f[e].once||E&&f[e].context!==E)&&s.push(f[e]);s.length?this._events[p]=s.length===1?s[0]:s:b(this,p)}return this},_.prototype.removeAllListeners=function(x){var D;return x?(D=L?L+x:x,this._events[D]&&b(this,D)):(this._events=new A,this._eventsCount=0),this},_.prototype.off=_.prototype.removeListener,_.prototype.addListener=_.prototype.on,_.prefixed=L,_.EventEmitter=_,j.exports=_},"./node_modules/url-toolkit/src/url-toolkit.js":function(j,R,l){(function(P){var L=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,A=/^(?=([^\/?#]*))\1([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,b={buildAbsoluteURL:function(_,y,x){if(x=x||{},_=_.trim(),y=y.trim(),!y){if(!x.alwaysNormalize)return _;var D=b.parseURL(_);if(!D)throw new Error("Error trying to parse base URL.");return D.path=b.normalizePath(D.path),b.buildURLFromParts(D)}var E=b.parseURL(y);if(!E)throw new Error("Error trying to parse relative URL.");if(E.scheme)return x.alwaysNormalize?(E.path=b.normalizePath(E.path),b.buildURLFromParts(E)):y;var m=b.parseURL(_);if(!m)throw new Error("Error trying to parse base URL.");if(!m.netLoc&&m.path&&m.path[0]!=="/"){var p=A.exec(m.path);m.netLoc=p[1],m.path=p[2]}m.netLoc&&!m.path&&(m.path="/");var f={scheme:m.scheme,netLoc:E.netLoc,path:null,params:E.params,query:E.query,fragment:E.fragment};if(!E.netLoc&&(f.netLoc=m.netLoc,E.path[0]!=="/"))if(!E.path)f.path=m.path,E.params||(f.params=m.params,E.query||(f.query=m.query));else{var e=m.path,s=e.substring(0,e.lastIndexOf("/")+1)+E.path;f.path=b.normalizePath(s)}return f.path===null&&(f.path=x.alwaysNormalize?b.normalizePath(E.path):E.path),b.buildURLFromParts(f)},parseURL:function(_){var y=L.exec(_);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(_){for(_=_.split("").reverse().join("").replace(M,"");_.length!==(_=_.replace(O,"")).length;);return _.split("").reverse().join("")},buildURLFromParts:function(_){return _.scheme+_.netLoc+_.path+_.params+_.query+_.fragment}};j.exports=b})(this)},"./node_modules/webworkify-webpack/index.js":function(j,R,l){function P(x){var D={};function E(p){if(D[p])return D[p].exports;var f=D[p]={i:p,l:!1,exports:{}};return x[p].call(f.exports,f,f.exports,E),f.l=!0,f.exports}E.m=x,E.c=D,E.i=function(p){return p},E.d=function(p,f,e){E.o(p,f)||Object.defineProperty(p,f,{configurable:!1,enumerable:!0,get:e})},E.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},E.n=function(p){var f=p&&p.__esModule?function(){return p.default}:function(){return p};return E.d(f,"a",f),f},E.o=function(p,f){return Object.prototype.hasOwnProperty.call(p,f)},E.p="/",E.oe=function(p){throw console.error(p),p};var m=E(E.s=ENTRY_MODULE);return m.default||m}var L="[\\.|\\-|\\+|\\w|/|@]+",A="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function M(x){return(x+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function O(x){return!isNaN(1*x)}function b(x,D,E){var m={};m[E]=[];var p=D.toString(),f=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!f)return m;for(var e=f[1],s=new RegExp("(\\\\n|\\W)"+M(e)+A,"g"),h;h=s.exec(p);)h[3]!=="dll-reference"&&m[E].push(h[3]);for(s=new RegExp("\\("+M(e)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+A,"g");h=s.exec(p);)x[h[2]]||(m[E].push(h[1]),x[h[2]]=l(h[1]).m),m[h[2]]=m[h[2]]||[],m[h[2]].push(h[4]);for(var g=Object.keys(m),i=0;i<g.length;i++)for(var r=0;r<m[g[i]].length;r++)O(m[g[i]][r])&&(m[g[i]][r]=1*m[g[i]][r]);return m}function _(x){var D=Object.keys(x);return D.reduce(function(E,m){return E||x[m].length>0},!1)}function y(x,D){for(var E={main:[D]},m={main:[]},p={main:{}};_(E);)for(var f=Object.keys(E),e=0;e<f.length;e++){var s=f[e],h=E[s],g=h.pop();if(p[s]=p[s]||{},!(p[s][g]||!x[s][g])){p[s][g]=!0,m[s]=m[s]||[],m[s].push(g);for(var i=b(x,x[s][g],s),r=Object.keys(i),o=0;o<r.length;o++)E[r[o]]=E[r[o]]||[],E[r[o]]=E[r[o]].concat(i[r[o]])}}return m}j.exports=function(x,D){D=D||{};var E={main:l.m},m=D.all?{main:Object.keys(E.main)}:y(E,x),p="";Object.keys(m).filter(function(g){return g!=="main"}).forEach(function(g){for(var i=0;m[g][i];)i++;m[g].push(i),E[g][i]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+g+" = ("+P.toString().replace("ENTRY_MODULE",JSON.stringify(i))+")({"+m[g].map(function(r){return""+JSON.stringify(r)+": "+E[g][r].toString()}).join(",")+`});
|
|
6
|
+
`))this.processLine(this.buffer.substring(0,C)),this.buffer=this.buffer.substring(C+1)},ar.prototype.processLine=function(w){var C=w.indexOf(":"),F=Gi(w,C),N=F[0],K=F.length===2?Tr(F[1]):void 0;if(N[0]!=="#")this.currentUri.uri=N,this.manifest.segments.push(this.currentUri),this.manifest.targetDuration&&!("duration"in this.currentUri)&&(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(N){case Mi:if(!isFinite(K)||K<0)return;this.manifest.targetDuration=K,this.setHoldBack();break;case Fi:yr(this.manifest,F),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case wi:yr(this.manifest,F),this.setHoldBack();break;case ki:K===0?this.currentUri.duration=.01:K>0&&(this.currentUri.duration=K);break;case Bi:var V=K,H=new Date(V);this.manifest.dateTimeString||(this.manifest.dateTimeString=V,this.manifest.dateTimeObject=H),this.currentUri.dateTimeString=V,this.currentUri.dateTimeObject=H;break;case Ui:yr(this.manifest,F);break;case Ni:var Q=Hi(F[1]),J=a(Q);i()(this.manifest.sessionData,J)}},ar.prototype.setHoldBack=function(){var w=this.manifest,C=w.serverControl,F=w.targetDuration,N=w.partTargetDuration;if(C){var K="holdBack",V="partHoldBack",H=F&&3*F,Q=N&&2*N;F&&!C.hasOwnProperty(K)&&(C[K]=H),H&&C[K]<H&&(C[K]=H),N&&!C.hasOwnProperty(V)&&(C[V]=3*N),N&&C[V]<Q&&(C[V]=Q)}};var yr=function(w,C){var F,N=Hr(C[0].replace("#EXT-X-",""));Wi(C[1])?(F={},F=i()(ji(C[1]),F)):F=Tr(C[1]),w[N]=F},Hr=function(w){return w.toLowerCase().replace(/-(\w)/g,function(C){return C[1].toUpperCase()})},Tr=function(w){if(w.toLowerCase()==="yes"||w.toLowerCase()==="no")return w.toLowerCase()==="yes";var C=w.indexOf(":")!==-1?w:parseFloat(w);return isNaN(C)?w:C},Ki=function(w){var C={},F=w.split("=");return F.length>1&&(C[Hr(F[0])]=Tr(F[1])),C},ji=function(w){for(var C=w.split(","),F={},N=0;C.length>N;N++){var K=C[N],V=Ki(K);F=i()(V,F)}return F},Wi=function(w){return w.indexOf("=")>-1},Gi=function(w,C){return C===-1?[w]:[w.substring(0,C),w.substring(C+1)]},Hi=function(w){var C={};if(w){var F=w.search(",");return[w.slice(0,F),w.slice(F+1)].forEach(function(N,K){for(var V=N.replace(/['"]+/g,"").split("="),H=0;H<V.length;H++)V[H]==="DATA-ID"&&(C["DATA-ID"]=V[1-H]),V[H]==="VALUE"&&(C.VALUE=V[1-H])}),{data:C}}},Vi=ar,Yi={safeCall:function(w,C,F,N){var K=N;if(w&&typeof w[C]=="function")try{K=w[C].apply(w,F)}catch(V){e.info("safeCall error",V)}return K},safeIncrement:t,getComputedStyle:function(w,C){var F;if(w&&C&&_()&&typeof _().getComputedStyle=="function")return Pt&&Pt.has(w)&&(F=Pt.get(w)),F||(F=_().getComputedStyle(w,null),Pt&&Pt.set(w,F)),F.getPropertyValue(C)},secondsToMs:function(w){return Math.floor(1e3*w)},assign:i(),headersStringToObject:u,extractHostnameAndDomain:o,extractHostname:r,manifestParser:Vi,generateShortID:x,generateUUID:y,now:h.now},zi={PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"};function Xi(w,C){return function(F){if(Array.isArray(F))return F}(w)||function(F,N){var K=F==null?null:typeof Symbol!="undefined"&&F[Symbol.iterator]||F["@@iterator"];if(K!=null){var V,H,Q=[],J=!0,X=!1;try{for(K=K.call(F);!(J=(V=K.next()).done)&&(Q.push(V.value),!N||Q.length!==N);J=!0);}catch(ee){X=!0,H=ee}finally{try{J||K.return==null||K.return()}finally{if(X)throw H}}return Q}}(w,C)||function(F,N){if(F){if(typeof F=="string")return Vr(F,N);var K=Object.prototype.toString.call(F).slice(8,-1);return K==="Object"&&F.constructor&&(K=F.constructor.name),K==="Map"||K==="Set"?Array.from(F):K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K)?Vr(F,N):void 0}}(w,C)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Vr(w,C){(C==null||C>w.length)&&(C=w.length);for(var F=0,N=new Array(C);F<C;F++)N[F]=w[F];return N}var rt={},Wt=function w(C){var F=arguments;typeof C=="string"?w.hasOwnProperty(C)?_().setTimeout(function(){F=Array.prototype.splice.call(F,1),w[C].apply(null,F)},0):e.warn("`"+C+"` is an unknown task"):typeof C=="function"?_().setTimeout(function(){C(w)},0):e.warn("`"+C+"` is invalid.")},Qi={loaded:h.now(),NAME:"mux-embed",VERSION:"4.14.0",API_VERSION:"2.1",PLAYER_TRACKED:!1,monitor:function(w,C){return function(F,N,K){var V=Wr(E(N),3),H=V[0],Q=V[1],J=V[2],X=F.log,ee=F.utils.getComputedStyle,ce=F.utils.secondsToMs;if(!H)return X.error("No element was found with the `"+Q+"` query selector.");if(J!=="video"&&J!=="audio")return X.error("The element of `"+Q+"` was not a media element.");H.mux&&(H.mux.destroy(),delete H.mux,X.warn("Already monitoring this video element, replacing existing event listeners")),(K=i()({automaticErrorTracking:!0},K)).data=i()({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:F.VERSION},K.data),K.getPlayheadTime=function(){return ce(H.currentTime)},K.getStateData=function(){var ve=this.hlsjs&&this.hlsjs.url,se=this.dashjs&&Er(this.dashjs.getSource==="function")&&this.dashjs.getSource(),le={player_is_paused:H.paused,player_playhead_time:ce(H.currentTime),player_width:parseInt(ee(H,"width")),player_height:parseInt(ee(H,"height")),player_autoplay_on:H.autoplay,player_preload_on:H.preload,player_language_code:H.lang,player_is_fullscreen:jt()&&!!(jt().fullscreenElement||jt().webkitFullscreenElement||jt().mozFullScreenElement||jt().msFullscreenElement),video_poster_url:H.poster,video_source_url:ve||se||H.currentSrc,video_source_duration:ce(H.duration),video_source_height:H.videoHeight,video_source_width:H.videoWidth},Se=K.getPlayheadTime();if(H.getStartDate&&Se>0){var Ye=H.getStartDate();if(Ye&&typeof Ye.getTime=="function"&&Ye.getTime()){var Je=Ye.getTime();if(le.player_program_time=Je+Se,H.seekable.length>0){var Dt=Je+H.seekable.end(H.seekable.length-1);le.player_live_edge_program_time=Dt}}}return le},H.mux=H.mux||{},H.mux.deleted=!1,H.mux.emit=function(ve,se){F.emit(Q,ve,se)};var ye=function(){X.error("The monitor for this video element has already been destroyed.")};H.mux.destroy=function(){Object.keys(H.mux.listeners).forEach(function(ve){H.removeEventListener(ve,H.mux.listeners[ve],!1)}),delete H.mux.listeners,H.mux.destroy=ye,H.mux.swapElement=ye,H.mux.emit=ye,H.mux.addHLSJS=ye,H.mux.addDashJS=ye,H.mux.removeHLSJS=ye,H.mux.removeDashJS=ye,H.mux.deleted=!0,F.emit(Q,"destroy")},H.mux.swapElement=function(ve){var se=Wr(E(ve),3),le=se[0],Se=se[1],Ye=se[2];return le?Ye!=="video"&&Ye!=="audio"?F.log.error("The element of `"+Se+"` was not a media element."):(le.muxId=H.muxId,delete H.muxId,le.mux=le.mux||{},le.mux.listeners=i()({},H.mux.listeners),delete H.mux.listeners,Object.keys(le.mux.listeners).forEach(function(Je){H.removeEventListener(Je,le.mux.listeners[Je],!1),le.addEventListener(Je,le.mux.listeners[Je],!1)}),le.mux.swapElement=H.mux.swapElement,le.mux.destroy=H.mux.destroy,delete H.mux,void(H=le)):F.log.error("No element was found with the `"+Se+"` query selector.")},H.mux.addHLSJS=function(ve){F.addHLSJS(Q,ve)},H.mux.addDashJS=function(ve){F.addDashJS(Q,ve)},H.mux.removeHLSJS=function(){F.removeHLSJS(Q)},H.mux.removeDashJS=function(){F.removeDashJS(Q)},F.init(Q,K),F.emit(Q,"playerready"),H.paused||(F.emit(Q,"play"),H.readyState>2&&F.emit(Q,"playing")),H.mux.listeners={},Pi.forEach(function(ve){(ve!=="error"||K.automaticErrorTracking)&&(H.mux.listeners[ve]=function(){var se={};if(ve==="error"){if(!H.error||H.error.code===1)return;se.player_error_code=H.error.code,se.player_error_message=Ci[H.error.code]||H.error.message}F.emit(Q,ve,se)},H.addEventListener(ve,H.mux.listeners[ve],!1))})}(Wt,w,C)},destroyMonitor:function(w){var C=Xi(E(w),1)[0];C&&C.mux&&typeof C.mux.destroy=="function"?C.mux.destroy():e.error("A video element monitor for `"+w+"` has not been initialized via `mux.monitor`.")},addHLSJS:function(w,C){var F=D(w);rt[F]?rt[F].addHLSJS(C):e.error("A monitor for `"+F+"` has not been initialized.")},addDashJS:function(w,C){var F=D(w);rt[F]?rt[F].addDashJS(C):e.error("A monitor for `"+F+"` has not been initialized.")},removeHLSJS:function(w){var C=D(w);rt[C]?rt[C].removeHLSJS():e.error("A monitor for `"+C+"` has not been initialized.")},removeDashJS:function(w){var C=D(w);rt[C]?rt[C].removeDashJS():e.error("A monitor for `"+C+"` has not been initialized.")},init:function(w,C){s()&&C&&C.respectDoNotTrack&&e.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var F=D(w);rt[F]=new Ri(Wt,F,C)},emit:function(w,C,F){var N=D(w);rt[N]?(rt[N].emit(C,F),C==="destroy"&&delete rt[N]):e.error("A monitor for `"+N+"` has not been initialized.")},checkDoNotTrack:s,log:e,utils:Yi,events:zi,WINDOW_HIDDEN:!1,WINDOW_UNLOADING:!1};Object.assign(Wt,Qi),_()!==void 0&&typeof _().addEventListener=="function"&&_().addEventListener("pagehide",function(w){w.persisted||(Wt.WINDOW_UNLOADING=!0)},!1);var $i=Wt},655:function(A,M,O){var b,_;function y(x){return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},y(x);}(function(x){var D=!1;if((_=typeof(b=x)=="function"?b.call(M,O,M,A):b)===void 0||(A.exports=_),D=!0,y(M)==="object"&&(A.exports=x(),D=!0),!D){var E=window.Cookies,m=window.Cookies=x();m.noConflict=function(){return window.Cookies=E,m}}})(function(){var x=function(){for(var D=0,E={};D<arguments.length;D++){var m=arguments[D];for(var p in m)E[p]=m[p]}return E};return function D(E){function m(p,f,e){var s;if(typeof document!="undefined"){if(arguments.length>1){if(typeof(e=x({path:"/"},m.defaults,e)).expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*e.expires),e.expires=h}try{s=JSON.stringify(f),/^[\{\[]/.test(s)&&(f=s)}catch{}return f=E.write?E.write(f,p):encodeURIComponent(String(f)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=(p=(p=encodeURIComponent(String(p))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[p,"=",f,e.expires?"; expires="+e.expires.toUTCString():"",e.path?"; path="+e.path:"",e.domain?"; domain="+e.domain:"",e.secure?"; secure":""].join("")}p||(s={});for(var g=document.cookie?document.cookie.split("; "):[],i=/(%[0-9A-Z]{2})+/g,r=0;r<g.length;r++){var o=g[r].split("="),c=o.slice(1).join("=");c.charAt(0)==='"'&&(c=c.slice(1,-1));try{var t=o[0].replace(i,decodeURIComponent);if(c=E.read?E.read(c,t):E(c,t)||c.replace(i,decodeURIComponent),this.json)try{c=JSON.parse(c)}catch{}if(p===t){s=c;break}p||(s[t]=c)}catch{}}return s}}return m.set=m,m.get=function(p){return m.call(m,p)},m.getJSON=function(){return m.apply({json:!0},[].slice.call(arguments))},m.defaults={},m.remove=function(p,f){m(p,"",x(f,{expires:-1}))},m.withConverter=D,m}(function(){})})},153:function(A,M,O){var b,_=O.g!==void 0?O.g:typeof window!="undefined"?window:{},y=O(558);typeof document!="undefined"?b=document:(b=_["__GLOBAL_DOCUMENT_CACHE@4"])||(b=_["__GLOBAL_DOCUMENT_CACHE@4"]=y),A.exports=b},48:function(A,M,O){var b;b=typeof window!="undefined"?window:O.g!==void 0?O.g:typeof self!="undefined"?self:{},A.exports=b},678:function(A){var M=9007199254740991,O="[object Arguments]",b="[object Function]",_="[object GeneratorFunction]",y=/^(?:0|[1-9]\d*)$/;function x(S,T,I){switch(I.length){case 0:return S.call(T);case 1:return S.call(T,I[0]);case 2:return S.call(T,I[0],I[1]);case 3:return S.call(T,I[0],I[1],I[2])}return S.apply(T,I)}var D,E,m=Object.prototype,p=m.hasOwnProperty,f=m.toString,e=m.propertyIsEnumerable,s=(D=Object.keys,E=Object,function(S){return D(E(S))}),h=Math.max,g=!e.call({valueOf:1},"valueOf");function i(S,T){var I=n(S)||function(W){return function(G){return function(z){return!!z&&typeof z=="object"}(G)&&u(G)}(W)&&p.call(W,"callee")&&(!e.call(W,"callee")||f.call(W)==O)}(S)?function(W,G){for(var z=-1,Y=Array(W);++z<W;)Y[z]=G(z);return Y}(S.length,String):[],k=I.length,B=!!k;for(var U in S)!T&&!p.call(S,U)||B&&(U=="length"||o(U,k))||I.push(U);return I}function r(S,T,I){var k=S[T];p.call(S,T)&&t(k,I)&&(I!==void 0||T in S)||(S[T]=I)}function o(S,T){return!!(T=T==null?M:T)&&(typeof S=="number"||y.test(S))&&S>-1&&S%1==0&&S<T}function c(S){var T=S&&S.constructor;return S===(typeof T=="function"&&T.prototype||m)}function t(S,T){return S===T||S!=S&&T!=T}var n=Array.isArray;function u(S){return S!=null&&function(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=M}(S.length)&&!function(T){var I=a(T)?f.call(T):"";return I==b||I==_}(S)}function a(S){var T=typeof S;return!!S&&(T=="object"||T=="function")}var d,v=(d=function(S,T){if(g||c(T)||u(T))(function(k,B,U,W){U||(U={});for(var G=-1,z=B.length;++G<z;){var Y=B[G],$=W?W(U[Y],k[Y],Y,U,k):void 0;r(U,Y,$===void 0?k[Y]:$)}})(T,function(k){return u(k)?i(k):function(B){if(!c(B))return s(B);var U=[];for(var W in Object(B))p.call(B,W)&&W!="constructor"&&U.push(W);return U}(k)}(T),S);else for(var I in T)p.call(T,I)&&r(S,I,T[I])},function(S,T){return T=h(T===void 0?S.length-1:T,0),function(){for(var I=arguments,k=-1,B=h(I.length-T,0),U=Array(B);++k<B;)U[k]=I[T+k];k=-1;for(var W=Array(T+1);++k<T;)W[k]=I[k];return W[T]=U,x(S,this,W)}}(function(S,T){var I=-1,k=T.length,B=k>1?T[k-1]:void 0,U=k>2?T[2]:void 0;for(B=d.length>3&&typeof B=="function"?(k--,B):void 0,U&&function(G,z,Y){if(!a(Y))return!1;var $=typeof z;return!!($=="number"?u(Y)&&o(z,Y.length):$=="string"&&z in Y)&&t(Y[z],G)}(T[0],T[1],U)&&(B=k<3?void 0:B,k=1),S=Object(S);++I<k;){var W=T[I];W&&d(S,W,I,B)}return S}));A.exports=v},640:function(A,M,O){var b,_;(function(y,x){"use strict";b=function(){var D=function(){},E="undefined",m=typeof window!==E&&typeof window.navigator!==E&&/Trident\/|MSIE /.test(window.navigator.userAgent),p=["trace","debug","info","warn","error"];function f(n,u){var a=n[u];if(typeof a.bind=="function")return a.bind(n);try{return Function.prototype.bind.call(a,n)}catch{return function(){return Function.prototype.apply.apply(a,[n,arguments])}}}function e(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(n){return n==="debug"&&(n="log"),typeof console!==E&&(n==="trace"&&m?e:console[n]!==void 0?f(console,n):console.log!==void 0?f(console,"log"):D)}function h(n,u){for(var a=0;a<p.length;a++){var d=p[a];this[d]=a<n?D:this.methodFactory(d,n,u)}this.log=this.debug}function g(n,u,a){return function(){typeof console!==E&&(h.call(this,u,a),this[n].apply(this,arguments))}}function i(n,u,a){return s(n)||g.apply(this,arguments)}function r(n,u,a){var d,v=this;u=u==null?"WARN":u;var S="loglevel";function T(U){var W=(p[U]||"silent").toUpperCase();if(typeof window!==E&&S){try{return void(window.localStorage[S]=W)}catch{}try{window.document.cookie=encodeURIComponent(S)+"="+W+";"}catch{}}}function I(){var U;if(typeof window!==E&&S){try{U=window.localStorage[S]}catch{}if(typeof U===E)try{var W=window.document.cookie,G=W.indexOf(encodeURIComponent(S)+"=");G!==-1&&(U=/^([^;]+)/.exec(W.slice(G))[1])}catch{}return v.levels[U]===void 0&&(U=void 0),U}}function k(){if(typeof window!==E&&S){try{return void window.localStorage.removeItem(S)}catch{}try{window.document.cookie=encodeURIComponent(S)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}typeof n=="string"?S+=":"+n:typeof n=="symbol"&&(S=void 0),v.name=n,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=a||i,v.getLevel=function(){return d},v.setLevel=function(U,W){if(typeof U=="string"&&v.levels[U.toUpperCase()]!==void 0&&(U=v.levels[U.toUpperCase()]),!(typeof U=="number"&&U>=0&&U<=v.levels.SILENT))throw"log.setLevel() called with invalid level: "+U;if(d=U,W!==!1&&T(U),h.call(v,U,n),typeof console===E&&U<v.levels.SILENT)return"No console available for logging"},v.setDefaultLevel=function(U){u=U,I()||v.setLevel(U,!1)},v.resetLevel=function(){v.setLevel(u,!1),k()},v.enableAll=function(U){v.setLevel(v.levels.TRACE,U)},v.disableAll=function(U){v.setLevel(v.levels.SILENT,U)};var B=I();B==null&&(B=u),v.setLevel(B,!1)}var o=new r,c={};o.getLogger=function(n){if(typeof n!="symbol"&&typeof n!="string"||n==="")throw new TypeError("You must supply a name when creating a logger.");var u=c[n];return u||(u=c[n]=new r(n,o.getLevel(),o.methodFactory)),u};var t=typeof window!==E?window.log:void 0;return o.noConflict=function(){return typeof window!==E&&window.log===o&&(window.log=t),o},o.getLoggers=function(){return c},o.default=o,o},(_=typeof b=="function"?b.call(M,O,M,A):b)===void 0||(A.exports=_)})()},375:function(A,M){"use strict";var O=Object.prototype.hasOwnProperty;function b(y){try{return decodeURIComponent(y.replace(/\+/g," "))}catch{return null}}function _(y){try{return encodeURIComponent(y)}catch{return null}}M.stringify=function(y,x){x=x||"";var D,E,m=[];for(E in typeof x!="string"&&(x="?"),y)if(O.call(y,E)){if((D=y[E])||D!=null&&!isNaN(D)||(D=""),E=_(E),D=_(D),E===null||D===null)continue;m.push(E+"="+D)}return m.length?x+m.join("&"):""},M.parse=function(y){for(var x,D=/([^=?#&]+)=?([^&]*)/g,E={};x=D.exec(y);){var m=b(x[1]),p=b(x[2]);m===null||p===null||m in E||(E[m]=p)}return E}},558:function(){}},P={};function L(A){var M=P[A];if(M!==void 0)return M.exports;var O=P[A]={exports:{}};return l[A].call(O.exports,O,O.exports,L),O.exports}return L.n=function(A){var M=A&&A.__esModule?function(){return A.default}:function(){return A};return L.d(M,{a:M}),M},L.d=function(A,M){for(var O in M)L.o(M,O)&&!L.o(A,O)&&Object.defineProperty(A,O,{enumerable:!0,get:M[O]})},L.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),L.o=function(A,M){return Object.prototype.hasOwnProperty.call(A,M)},L(80)}()},typeof or=="object"&&typeof br=="object"?br.exports=R():typeof or=="object"?or.mux=R():j.mux=R()})()});var lr=zr((Yt,Or)=>{typeof window!="undefined"&&function(R,l){typeof Yt=="object"&&typeof Or=="object"?Or.exports=l():typeof define=="function"&&define.amd?define([],l):typeof Yt=="object"?Yt.Hls=l():R.Hls=l()}(Yt,function(){return function(j){var R={};function l(P){if(R[P])return R[P].exports;var L=R[P]={i:P,l:!1,exports:{}};return j[P].call(L.exports,L,L.exports,l),L.l=!0,L.exports}return l.m=j,l.c=R,l.d=function(P,L,A){l.o(P,L)||Object.defineProperty(P,L,{enumerable:!0,get:A})},l.r=function(P){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})},l.t=function(P,L){if(L&1&&(P=l(P)),L&8||L&4&&typeof P=="object"&&P&&P.__esModule)return P;var A=Object.create(null);if(l.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:P}),L&2&&typeof P!="string")for(var M in P)l.d(A,M,function(O){return P[O]}.bind(null,M));return A},l.n=function(P){var L=P&&P.__esModule?function(){return P.default}:function(){return P};return l.d(L,"a",L),L},l.o=function(P,L){return Object.prototype.hasOwnProperty.call(P,L)},l.p="/dist/",l(l.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(j,R,l){"use strict";var P=Object.prototype.hasOwnProperty,L="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(L=!1));function M(y,x,D){this.fn=y,this.context=x,this.once=D||!1}function O(y,x,D,E,m){if(typeof D!="function")throw new TypeError("The listener must be a function");var p=new M(D,E||y,m),f=L?L+x:x;return y._events[f]?y._events[f].fn?y._events[f]=[y._events[f],p]:y._events[f].push(p):(y._events[f]=p,y._eventsCount++),y}function b(y,x){--y._eventsCount===0?y._events=new A:delete y._events[x]}function _(){this._events=new A,this._eventsCount=0}_.prototype.eventNames=function(){var x=[],D,E;if(this._eventsCount===0)return x;for(E in D=this._events)P.call(D,E)&&x.push(L?E.slice(1):E);return Object.getOwnPropertySymbols?x.concat(Object.getOwnPropertySymbols(D)):x},_.prototype.listeners=function(x){var D=L?L+x:x,E=this._events[D];if(!E)return[];if(E.fn)return[E.fn];for(var m=0,p=E.length,f=new Array(p);m<p;m++)f[m]=E[m].fn;return f},_.prototype.listenerCount=function(x){var D=L?L+x:x,E=this._events[D];return E?E.fn?1:E.length:0},_.prototype.emit=function(x,D,E,m,p,f){var e=L?L+x:x;if(!this._events[e])return!1;var s=this._events[e],h=arguments.length,g,i;if(s.fn){switch(s.once&&this.removeListener(x,s.fn,void 0,!0),h){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,D),!0;case 3:return s.fn.call(s.context,D,E),!0;case 4:return s.fn.call(s.context,D,E,m),!0;case 5:return s.fn.call(s.context,D,E,m,p),!0;case 6:return s.fn.call(s.context,D,E,m,p,f),!0}for(i=1,g=new Array(h-1);i<h;i++)g[i-1]=arguments[i];s.fn.apply(s.context,g)}else{var r=s.length,o;for(i=0;i<r;i++)switch(s[i].once&&this.removeListener(x,s[i].fn,void 0,!0),h){case 1:s[i].fn.call(s[i].context);break;case 2:s[i].fn.call(s[i].context,D);break;case 3:s[i].fn.call(s[i].context,D,E);break;case 4:s[i].fn.call(s[i].context,D,E,m);break;default:if(!g)for(o=1,g=new Array(h-1);o<h;o++)g[o-1]=arguments[o];s[i].fn.apply(s[i].context,g)}}return!0},_.prototype.on=function(x,D,E){return O(this,x,D,E,!1)},_.prototype.once=function(x,D,E){return O(this,x,D,E,!0)},_.prototype.removeListener=function(x,D,E,m){var p=L?L+x:x;if(!this._events[p])return this;if(!D)return b(this,p),this;var f=this._events[p];if(f.fn)f.fn===D&&(!m||f.once)&&(!E||f.context===E)&&b(this,p);else{for(var e=0,s=[],h=f.length;e<h;e++)(f[e].fn!==D||m&&!f[e].once||E&&f[e].context!==E)&&s.push(f[e]);s.length?this._events[p]=s.length===1?s[0]:s:b(this,p)}return this},_.prototype.removeAllListeners=function(x){var D;return x?(D=L?L+x:x,this._events[D]&&b(this,D)):(this._events=new A,this._eventsCount=0),this},_.prototype.off=_.prototype.removeListener,_.prototype.addListener=_.prototype.on,_.prefixed=L,_.EventEmitter=_,j.exports=_},"./node_modules/url-toolkit/src/url-toolkit.js":function(j,R,l){(function(P){var L=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,A=/^(?=([^\/?#]*))\1([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,b={buildAbsoluteURL:function(_,y,x){if(x=x||{},_=_.trim(),y=y.trim(),!y){if(!x.alwaysNormalize)return _;var D=b.parseURL(_);if(!D)throw new Error("Error trying to parse base URL.");return D.path=b.normalizePath(D.path),b.buildURLFromParts(D)}var E=b.parseURL(y);if(!E)throw new Error("Error trying to parse relative URL.");if(E.scheme)return x.alwaysNormalize?(E.path=b.normalizePath(E.path),b.buildURLFromParts(E)):y;var m=b.parseURL(_);if(!m)throw new Error("Error trying to parse base URL.");if(!m.netLoc&&m.path&&m.path[0]!=="/"){var p=A.exec(m.path);m.netLoc=p[1],m.path=p[2]}m.netLoc&&!m.path&&(m.path="/");var f={scheme:m.scheme,netLoc:E.netLoc,path:null,params:E.params,query:E.query,fragment:E.fragment};if(!E.netLoc&&(f.netLoc=m.netLoc,E.path[0]!=="/"))if(!E.path)f.path=m.path,E.params||(f.params=m.params,E.query||(f.query=m.query));else{var e=m.path,s=e.substring(0,e.lastIndexOf("/")+1)+E.path;f.path=b.normalizePath(s)}return f.path===null&&(f.path=x.alwaysNormalize?b.normalizePath(E.path):E.path),b.buildURLFromParts(f)},parseURL:function(_){var y=L.exec(_);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(_){for(_=_.split("").reverse().join("").replace(M,"");_.length!==(_=_.replace(O,"")).length;);return _.split("").reverse().join("")},buildURLFromParts:function(_){return _.scheme+_.netLoc+_.path+_.params+_.query+_.fragment}};j.exports=b})(this)},"./node_modules/webworkify-webpack/index.js":function(j,R,l){function P(x){var D={};function E(p){if(D[p])return D[p].exports;var f=D[p]={i:p,l:!1,exports:{}};return x[p].call(f.exports,f,f.exports,E),f.l=!0,f.exports}E.m=x,E.c=D,E.i=function(p){return p},E.d=function(p,f,e){E.o(p,f)||Object.defineProperty(p,f,{configurable:!1,enumerable:!0,get:e})},E.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},E.n=function(p){var f=p&&p.__esModule?function(){return p.default}:function(){return p};return E.d(f,"a",f),f},E.o=function(p,f){return Object.prototype.hasOwnProperty.call(p,f)},E.p="/",E.oe=function(p){throw console.error(p),p};var m=E(E.s=ENTRY_MODULE);return m.default||m}var L="[\\.|\\-|\\+|\\w|/|@]+",A="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function M(x){return(x+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function O(x){return!isNaN(1*x)}function b(x,D,E){var m={};m[E]=[];var p=D.toString(),f=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!f)return m;for(var e=f[1],s=new RegExp("(\\\\n|\\W)"+M(e)+A,"g"),h;h=s.exec(p);)h[3]!=="dll-reference"&&m[E].push(h[3]);for(s=new RegExp("\\("+M(e)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+A,"g");h=s.exec(p);)x[h[2]]||(m[E].push(h[1]),x[h[2]]=l(h[1]).m),m[h[2]]=m[h[2]]||[],m[h[2]].push(h[4]);for(var g=Object.keys(m),i=0;i<g.length;i++)for(var r=0;r<m[g[i]].length;r++)O(m[g[i]][r])&&(m[g[i]][r]=1*m[g[i]][r]);return m}function _(x){var D=Object.keys(x);return D.reduce(function(E,m){return E||x[m].length>0},!1)}function y(x,D){for(var E={main:[D]},m={main:[]},p={main:{}};_(E);)for(var f=Object.keys(E),e=0;e<f.length;e++){var s=f[e],h=E[s],g=h.pop();if(p[s]=p[s]||{},!(p[s][g]||!x[s][g])){p[s][g]=!0,m[s]=m[s]||[],m[s].push(g);for(var i=b(x,x[s][g],s),r=Object.keys(i),o=0;o<r.length;o++)E[r[o]]=E[r[o]]||[],E[r[o]]=E[r[o]].concat(i[r[o]])}}return m}j.exports=function(x,D){D=D||{};var E={main:l.m},m=D.all?{main:Object.keys(E.main)}:y(E,x),p="";Object.keys(m).filter(function(g){return g!=="main"}).forEach(function(g){for(var i=0;m[g][i];)i++;m[g].push(i),E[g][i]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+g+" = ("+P.toString().replace("ENTRY_MODULE",JSON.stringify(i))+")({"+m[g].map(function(r){return""+JSON.stringify(r)+": "+E[g][r].toString()}).join(",")+`});
|
|
8
8
|
`}),p=p+"new (("+P.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+m.main.map(function(g){return""+JSON.stringify(g)+": "+E.main[g].toString()}).join(",")+"}))(self);";var f=new window.Blob([p],{type:"text/javascript"});if(D.bare)return f;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,s=e.createObjectURL(f),h=new window.Worker(s);return h.objectURL=s,h}},"./src/config.ts":function(j,R,l){"use strict";l.r(R),l.d(R,"hlsDefaultConfig",function(){return o}),l.d(R,"mergeConfig",function(){return t}),l.d(R,"enableStreamingMode",function(){return n});var P=l("./src/controller/abr-controller.ts"),L=l("./src/controller/audio-stream-controller.ts"),A=l("./src/controller/audio-track-controller.ts"),M=l("./src/controller/subtitle-stream-controller.ts"),O=l("./src/controller/subtitle-track-controller.ts"),b=l("./src/controller/buffer-controller.ts"),_=l("./src/controller/timeline-controller.ts"),y=l("./src/controller/cap-level-controller.ts"),x=l("./src/controller/fps-controller.ts"),D=l("./src/controller/eme-controller.ts"),E=l("./src/controller/cmcd-controller.ts"),m=l("./src/utils/xhr-loader.ts"),p=l("./src/utils/fetch-loader.ts"),f=l("./src/utils/cues.ts"),e=l("./src/utils/mediakeys-helper.ts"),s=l("./src/utils/logger.ts");function h(){return h=Object.assign?Object.assign.bind():function(u){for(var a=1;a<arguments.length;a++){var d=arguments[a];for(var v in d)Object.prototype.hasOwnProperty.call(d,v)&&(u[v]=d[v])}return u},h.apply(this,arguments)}function g(u,a){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);a&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(u,S).enumerable})),d.push.apply(d,v)}return d}function i(u){for(var a=1;a<arguments.length;a++){var d=arguments[a]!=null?arguments[a]:{};a%2?g(Object(d),!0).forEach(function(v){r(u,v,d[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):g(Object(d)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(d,v))})}return u}function r(u,a,d){return a in u?Object.defineProperty(u,a,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[a]=d,u}var o=i(i({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:m.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:P.default,bufferController:b.default,capLevelController:y.default,fpsController:x.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},c()),{},{subtitleStreamController:M.SubtitleStreamController,subtitleTrackController:O.default,timelineController:_.TimelineController,audioStreamController:L.default,audioTrackController:A.default,emeController:D.default,cmcdController:E.default});function c(){return{cueHandler:f.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function t(u,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},u,a)}function n(u){var a=u.loader;if(a!==p.default&&a!==m.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var d=Object(p.fetchSupported)();d&&(u.loader=p.default,u.progressive=!0,u.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(j,R,l){"use strict";l.r(R);var P=l("./src/polyfills/number.ts"),L=l("./src/utils/ewma-bandwidth-estimator.ts"),A=l("./src/events.ts"),M=l("./src/utils/buffer-helper.ts"),O=l("./src/errors.ts"),b=l("./src/types/loader.ts"),_=l("./src/utils/logger.ts");function y(E,m){for(var p=0;p<m.length;p++){var f=m[p];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(E,f.key,f)}}function x(E,m,p){return m&&y(E.prototype,m),p&&y(E,p),Object.defineProperty(E,"prototype",{writable:!1}),E}var D=function(){function E(p){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=p;var f=p.config;this.bwEstimator=new L.default(f.abrEwmaSlowVoD,f.abrEwmaFastVoD,f.abrEwmaDefaultEstimate),this.registerListeners()}var m=E.prototype;return m.registerListeners=function(){var f=this.hls;f.on(A.Events.FRAG_LOADING,this.onFragLoading,this),f.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(A.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){var f=this.hls;f.off(A.Events.FRAG_LOADING,this.onFragLoading,this),f.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(A.Events.ERROR,this.onError,this)},m.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},m.onFragLoading=function(f,e){var s=e.frag;if(s.type===b.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=s,this.partCurrent=(h=e.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},m.onLevelLoaded=function(f,e){var s=this.hls.config;e.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},m._abandonRulesCheck=function(){var f=this.fragCurrent,e=this.partCurrent,s=this.hls,h=s.autoLevelEnabled,g=s.config,i=s.media;if(!(!f||!i)){var r=e?e.stats:f.stats,o=e?e.duration:f.duration;if(r.aborted){_.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!(!h||i.paused||!i.playbackRate||!i.readyState)){var c=performance.now()-r.loading.start,t=Math.abs(i.playbackRate);if(!(c<=500*o/t)){var n=s.levels,u=s.minAutoLevel,a=n[f.level],d=r.total||Math.max(r.loaded,Math.round(o*a.maxBitrate/8)),v=Math.max(1,r.bwEstimate?r.bwEstimate/8:r.loaded*1e3/c),S=(d-r.loaded)/v,T=i.currentTime,I=(M.BufferHelper.bufferInfo(i,T,g.maxBufferHole).end-T)/t;if(!(I>=2*o/t||S<=I)){var k=Number.POSITIVE_INFINITY,B;for(B=f.level-1;B>u;B--){var U=n[B].maxBitrate;if(k=o*U/(8*.8*v),k<I)break}if(!(k>=S)){var W=this.bwEstimator.getEstimate();_.logger.warn("Fragment "+f.sn+(e?" part "+e.index:"")+" of level "+f.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+B+`
|
|
9
9
|
Current BW estimate: `+(Object(P.isFiniteNumber)(W)?(W/1024).toFixed(3):"Unknown")+` Kb/s
|
|
10
10
|
Estimated load time for current fragment: `+S.toFixed(3)+` s
|
|
@@ -27,7 +27,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
27
27
|
`,f.parse()),f.state==="INITIAL"||f.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){f.onparsingerror&&f.onparsingerror(e)}return f.onflush&&f.onflush(),this},E}()},"./src/utils/webvtt-parser.ts":function(j,R,l){"use strict";l.r(R),l.d(R,"generateCueId",function(){return D}),l.d(R,"parseWebVTT",function(){return m});var P=l("./src/polyfills/number.ts"),L=l("./src/utils/vttparser.ts"),A=l("./src/demux/id3.ts"),M=l("./src/utils/timescale-conversion.ts"),O=l("./src/remux/mp4-remuxer.ts"),b=/\r\n|\n\r|\n|\r/g,_=function(f,e,s){return s===void 0&&(s=0),f.slice(s,s+e.length)===e},y=function(f){var e=parseInt(f.slice(-3)),s=parseInt(f.slice(-6,-4)),h=parseInt(f.slice(-9,-7)),g=f.length>9?parseInt(f.substring(0,f.indexOf(":"))):0;if(!Object(P.isFiniteNumber)(e)||!Object(P.isFiniteNumber)(s)||!Object(P.isFiniteNumber)(h)||!Object(P.isFiniteNumber)(g))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+f);return e+=1e3*s,e+=60*1e3*h,e+=60*60*1e3*g,e},x=function(f){for(var e=5381,s=f.length;s;)e=e*33^f.charCodeAt(--s);return(e>>>0).toString()};function D(p,f,e){return x(p.toString())+x(f.toString())+x(e)}var E=function(f,e,s){var h=f[e],g=f[h.prevCC];if(!g||!g.new&&h.new){f.ccOffset=f.presentationOffset=h.start,h.new=!1;return}for(;(i=g)!==null&&i!==void 0&&i.new;){var i;f.ccOffset+=h.start-g.start,h.new=!1,h=g,g=f[h.prevCC]}f.presentationOffset=s};function m(p,f,e,s,h,g,i,r){var o=new L.VTTParser,c=Object(A.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(b,`
|
|
28
28
|
`).split(`
|
|
29
29
|
`),t=[],n=Object(M.toMpegTsClockFromTimescale)(f,e),u="00:00.000",a=0,d=0,v,S=!0;o.oncue=function(T){var I=s[h],k=s.ccOffset,B=(a-n)/9e4;I!=null&&I.new&&(d!==void 0?k=s.ccOffset=I.start:E(s,h,B)),B&&(k=B-s.presentationOffset);var U=T.endTime-T.startTime,W=Object(O.normalizePts)((T.startTime+k-d)*9e4,g*9e4)/9e4;T.startTime=Math.max(W,0),T.endTime=Math.max(W+U,0);var G=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(G)),T.id||(T.id=D(T.startTime,T.endTime,G)),T.endTime>0&&t.push(T)},o.onparsingerror=function(T){v=T},o.onflush=function(){if(v){r(v);return}i(t)},c.forEach(function(T){if(S)if(_(T,"X-TIMESTAMP-MAP=")){S=!1,T.slice(16).split(",").forEach(function(I){_(I,"LOCAL:")?u=I.slice(6):_(I,"MPEGTS:")&&(a=parseInt(I.slice(7)))});try{d=y(u)/1e3}catch(I){v=I}return}else T===""&&(S=!1);o.parse(T+`
|
|
30
|
-
`)}),o.flush()}},"./src/utils/xhr-loader.ts":function(j,R,l){"use strict";l.r(R);var P=l("./src/utils/logger.ts"),L=l("./src/loader/load-stats.ts"),A=/^age:\s*[\d.]+\s*$/m,M=function(){function O(_){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=_?_.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var b=O.prototype;return b.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},b.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},b.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},b.load=function(y,x,D){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=x,this.callbacks=D,this.retryDelay=x.retryDelay,this.loadInternal()},b.loadInternal=function(){var y=this.config,x=this.context;if(!!y){var D=this.loader=new self.XMLHttpRequest,E=this.stats;E.loading.first=0,E.loaded=0;var m=this.xhrSetup;try{if(m)try{m(D,x.url)}catch{D.open("GET",x.url,!0),m(D,x.url)}D.readyState||D.open("GET",x.url,!0);var p=this.context.headers;if(p)for(var f in p)D.setRequestHeader(f,p[f])}catch(e){this.callbacks.onError({code:D.status,text:e.message},x,D);return}x.rangeEnd&&D.setRequestHeader("Range","bytes="+x.rangeStart+"-"+(x.rangeEnd-1)),D.onreadystatechange=this.readystatechange.bind(this),D.onprogress=this.loadprogress.bind(this),D.responseType=x.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),D.send()}},b.readystatechange=function(){var y=this.context,x=this.loader,D=this.stats;if(!(!y||!x)){var E=x.readyState,m=this.config;if(!D.aborted&&E>=2)if(self.clearTimeout(this.requestTimeout),D.loading.first===0&&(D.loading.first=Math.max(self.performance.now(),D.loading.start)),E===4){x.onreadystatechange=null,x.onprogress=null;var p=x.status;if(p>=200&&p<300){D.loading.end=Math.max(self.performance.now(),D.loading.first);var f,e;if(y.responseType==="arraybuffer"?(f=x.response,e=f.byteLength):(f=x.responseText,e=f.length),D.loaded=D.total=e,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(D,y,f,x),!this.callbacks)return;var h={url:x.responseURL,data:f};this.callbacks.onSuccess(h,D,y,x)}else D.retry>=m.maxRetry||p>=400&&p<499?(P.logger.error(p+" while loading "+y.url),this.callbacks.onError({code:p,text:x.statusText},y,x)):(P.logger.warn(p+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,m.maxRetryDelay),D.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout)}},b.loadtimeout=function(){P.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},b.loadprogress=function(y){var x=this.stats;x.loaded=y.loaded,y.lengthComputable&&(x.total=y.total)},b.getCacheAge=function(){var y=null;if(this.loader&&A.test(this.loader.getAllResponseHeaders())){var x=this.loader.getResponseHeader("age");y=x?parseFloat(x):null}return y},O}();R.default=M}}).default})});var Ct=class{addEventListener(){}removeEventListener(){}dispatchEvent(R){return!0}};if(typeof DocumentFragment=="undefined"){class j extends Ct{}globalThis.DocumentFragment=j}var Ht=class extends Ct{},Ar=class extends Ct{},nn={get(j){},define(j,R,l){},upgrade(j){},whenDefined(j){return Promise.resolve(Ht)}},Vt,Lr=class{constructor(R,l={}){lt(this,Vt,void 0);ut(this,Vt,l==null?void 0:l.detail)}get detail(){return ze(this,Vt)}initCustomEvent(){}};Vt=new WeakMap;function an(j,R){return new Ht}var zr={document:{createElement:an},DocumentFragment,customElements:nn,CustomEvent:Lr,EventTarget:Ct,HTMLElement:Ht,HTMLVideoElement:Ar},Xr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",mt=Xr?zr:globalThis,_r=Xr?zr.document:globalThis.document;var fr=sr(Qr(),1),Lt=sr(lr(),1),Ir=sr(lr(),1),Mt=sr(lr(),1),zt=class extends Error{constructor(j,R=zt.MEDIA_ERR_CUSTOM,l){var P;super(j),this.name="MediaError",this.code=R,this.fatal=l!=null?l:R>=zt.MEDIA_ERR_NETWORK&&R<=zt.MEDIA_ERR_ENCRYPTED,this.message||(this.message=(P=zt.defaultMessages[this.code])!=null?P:"")}},Xe=zt;Xe.MEDIA_ERR_ABORTED=1,Xe.MEDIA_ERR_NETWORK=2,Xe.MEDIA_ERR_DECODE=3,Xe.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Xe.MEDIA_ERR_ENCRYPTED=5,Xe.MEDIA_ERR_CUSTOM=100,Xe.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."};var ti=(j,R)=>j in R,Pr={ANY:"any",MUTED:"muted"},ur={VOD:"on-demand",ON_DEMAND:"on-demand",LIVE:"live",LL_LIVE:"ll-live",DVR:"live:dvr",LL_DVR:"ll-live:dvr"},_t={MSE:"mse",NATIVE:"native"},ri={HEADER:"header",QUERY:"query"},Fn=Object.values(ri),Ft={M3U8:"application/vnd.apple.mpegurl",MP4:"video/mp4"},Cr={HLS:Ft.M3U8},wn=Object.keys(Cr),kn=[...Object.values(Ft),"hls","HLS"],Xt=(j,R,l,P)=>{j.addEventListener(R,l,P),j.addEventListener("teardown",()=>{j.removeEventListener(R,l)},{once:!0})};function sn(j,R,l){R&&l>R&&(l=R);for(let P=0;P<j.length;P++)if(j.start(P)<=l&&j.end(P)>=l)return!0;return!1}var on=j=>{let R=j.indexOf("?");if(R<0)return[j];let l=j.slice(0,R),P=j.slice(R);return[l,P]},ii=j=>{let R=j.type;if(R){let P=R.toUpperCase();return ti(P,Cr)?Cr[P]:R}let{src:l}=j;return l?ln(l):""},ln=j=>{let R="";try{R=new URL(j).pathname}catch{console.error("invalid url")}let l=R.lastIndexOf(".");if(l<0)return"";let P=R.slice(l+1).toUpperCase();return ti(P,Ft)?Ft[P]:""},un=Object.values(Pr),$r=j=>typeof j=="boolean"||typeof j=="string"&&un.includes(j),fn=({autoplay:j},R,l)=>{let P=!1,L=!1,A=$r(j)?j:!!j,M=()=>{P||Xt(R,"playing",()=>{P=!0},{once:!0})};if(M(),Xt(R,"loadstart",()=>{P=!1,M(),Rr(R,A)},{once:!0}),Xt(R,"loadstart",()=>{l||(L=!Number.isFinite(R.duration)),Rr(R,A)},{once:!0}),l&&l.once(Ir.default.Events.LEVEL_LOADED,(O,b)=>{var _;L=(_=b.details.live)!=null?_:!1}),!A){let O=()=>{!L||(l!=null&&l.liveSyncPosition?R.currentTime=l.liveSyncPosition:Number.isFinite(R.seekable.end(0))&&(R.currentTime=R.seekable.end(0)))};l&&Xt(R,"play",()=>{R.preload==="metadata"?l.once(Ir.default.Events.LEVEL_UPDATED,O):O()},{once:!0})}return O=>{P||(A=$r(O)?O:!!O,Rr(R,A))}},Rr=(j,R)=>{if(!R)return;let l=j.muted,P=()=>j.muted=l;switch(R){case Pr.ANY:j.play().catch(()=>{j.muted=!0,j.play().catch(P)});break;case Pr.MUTED:j.muted=!0,j.play().catch(P);break;default:j.play().catch(()=>{});break}},dn=({preload:j,src:R},l,P)=>{let L=x=>{x!=null&&["","none","metadata","auto"].includes(x)?l.setAttribute("preload",x):l.removeAttribute("preload")};if(!P)return L(j),L;let A=!1,M=!1,O=P.config.maxBufferLength,b=P.config.maxBufferSize,_=x=>{L(x);let D=x!=null?x:l.preload;M||D==="none"||(D==="metadata"?(P.config.maxBufferLength=1,P.config.maxBufferSize=1):(P.config.maxBufferLength=O,P.config.maxBufferSize=b),y())},y=()=>{!A&&R&&(A=!0,P.loadSource(R))};return Xt(l,"play",()=>{M=!0,P.config.maxBufferLength=O,P.config.maxBufferSize=b,y()},{once:!0}),_(j),_};function cn(j,R){R.on(Mt.default.Events.NON_NATIVE_TEXT_TRACKS_FOUND,(L,{tracks:A})=>{A.forEach(M=>{var O;let b=(O=M.subtitleTrack)!=null?O:M.closedCaptions,_=R.subtitleTracks.findIndex(({lang:y,name:x,type:D})=>y==(b==null?void 0:b.lang)&&x===M.label&&D.toLowerCase()===M.kind);hn(j,M.kind,M.label,b==null?void 0:b.lang,`${M.kind}${_}`)})});let l=()=>{var L;if(!R.subtitleTracks.length)return;let A=Array.from(j.textTracks).find(O=>O.id&&O.mode==="showing"&&["subtitles","captions"].includes(O.kind)),M=`${(L=R.subtitleTracks[R.subtitleTrack])==null?void 0:L.type.toLowerCase()}${R.subtitleTrack}`;if(A&&(R.subtitleTrack<0||(A==null?void 0:A.id)!==M)){let O=R.subtitleTracks.findIndex(({lang:b,name:_,type:y})=>b==A.language&&_===A.label&&y.toLowerCase()===A.kind);R.subtitleTrack=O}A&&(A==null?void 0:A.id)===M&&A.cues&&Array.from(A.cues).forEach(O=>{A.addCue(O)})};j.textTracks.addEventListener("change",l),R.on(Mt.default.Events.CUES_PARSED,(L,{track:A,cues:M})=>{let O=j.textTracks.getTrackById(A);if(!O)return;let b=O.mode==="disabled";b&&(O.mode="hidden"),M.forEach(_=>{var y;(y=O.cues)!=null&&y.getCueById(_.id)||O.addCue(_)}),b&&(O.mode="disabled")}),R.once(Mt.default.Events.DESTROYING,()=>{j.textTracks.removeEventListener("change",l),j.querySelectorAll("track[data-removeondestroy]").forEach(L=>{L.remove()})});let P=()=>{Array.from(j.textTracks).forEach(L=>{var A,M;if(!["subtitles","caption"].includes(L.kind)&&L.label==="thumbnails"){if(!((A=L.cues)!=null&&A.length)){let O=j.querySelector('track[label="thumbnails"]'),b=(M=O==null?void 0:O.getAttribute("src"))!=null?M:"";O==null||O.removeAttribute("src"),setTimeout(()=>{O==null||O.setAttribute("src",b)},0)}L.mode!=="hidden"&&(L.mode="hidden")}})};R.once(Mt.default.Events.MANIFEST_LOADED,P),R.once(Mt.default.Events.MEDIA_ATTACHED,P)}function hn(j,R,l,P,L){let A=document.createElement("track");return A.kind=R,A.label=l,P&&(A.srclang=P),L&&(A.id=L),A.track.mode="disabled",A.setAttribute("data-removeondestroy",""),j.append(A),A.track}var Jr,Zr,vn=(Zr=(Jr=globalThis==null?void 0:globalThis.navigator)==null?void 0:Jr.userAgent)!=null?Zr:"",gn=vn.toLowerCase().indexOf("android")!==-1,Qt=new WeakMap,ni="mux.com",qr,ei,ai=(ei=(qr=Lt.default).isSupported)==null?void 0:ei.call(qr),mn=gn,si=()=>fr.default.utils.now(),pn=fr.default.utils.generateUUID,oi=(j,{domain:R=ni}={})=>{if(!j)return;let[l,P=""]=on(j);return`https://stream.${R}/${l}.m3u8${P}`},En=j=>{if(!j)return;let[R]=j.split("?");return R||void 0},yn=j=>{if(!j||!j.startsWith("https://stream."))return;let[R]=new URL(j).pathname.slice(1).split(".m3u8");return R||void 0},Tn=j=>{var R,l,P;return(R=j==null?void 0:j.metadata)!=null&&R.video_id?j.metadata.video_id:fi(j)&&(P=(l=En(j.playbackId))!=null?l:yn(j.src))!=null?P:j.src};var li=(j,R,l)=>{Fr(R,l);let{metadata:P={}}=j,{view_session_id:L=pn()}=P,A=Tn(j);P.view_session_id=L,P.video_id=A,j.metadata=P,Qt.set(R,{});let M=xn(j,R);Dn(j,R,M),An(j,R,M);let O=fn(j,R,M),b=dn(j,R,M);return{engine:M,setAutoplay:O,setPreload:b}},Fr=(j,R)=>{let l=R==null?void 0:R.engine;l&&(l.detachMedia(),l.destroy()),(j==null?void 0:j.mux)&&!j.mux.deleted&&(j.mux.destroy(),delete j.mux),j&&(j.removeAttribute("src"),j.load(),j.removeEventListener("error",ci),j.removeEventListener("error",Mr),j.removeEventListener("durationchange",di),Qt.delete(j),j.dispatchEvent(new Event("teardown")))};function ui(j,R){var l;let P=ii(j);if(P!==Ft.M3U8)return!0;let L=!P||((l=R.canPlayType(P))!=null?l:!0),{preferPlayback:A}=j,M=A===_t.MSE,O=A===_t.NATIVE;return L&&(O||!(ai&&(M||mn)))}var xn=(j,R)=>{let{debug:l,streamType:P,startTime:L=-1,metadata:A,experimentalCmcd:M,preferCmcd:O}=j,b=ii(j)===Ft.M3U8,_=ui(j,R);if(b&&!_&&ai){let y={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0},x=Sn(P),D=M?{useHeaders:O===ri.HEADER,sessionId:A.view_session_id,contentId:A.video_id}:void 0;return new Lt.default({debug:l,startPosition:L,cmcd:D,...y,...x})}},Sn=j=>[ur.LIVE,ur.DVR].includes(j)?{backBufferLength:8}:[ur.LL_LIVE,ur.LL_DVR].includes(j)?{backBufferLength:4,maxFragLookUpTolerance:.001}:{},fi=({playbackId:j,src:R,customDomain:l})=>{if(j)return!0;if(typeof R!="string")return!1;let P=window==null?void 0:window.location.href,L=new URL(R,P).hostname.toLocaleLowerCase();return L.includes(ni)||!!l&&L.includes(l.toLocaleLowerCase())},Dn=(j,R,l)=>{var P;let{envKey:L}=j,A=fi(j);if(L||A){let{playerInitTime:M,playerSoftwareName:O,playerSoftwareVersion:b,beaconCollectionDomain:_,debug:y,disableCookies:x}=j,D={...j.metadata,video_title:((P=j==null?void 0:j.metadata)==null?void 0:P.video_title)||void 0},E=m=>typeof m.player_error_code=="string"?!1:typeof j.errorTranslator=="function"?j.errorTranslator(m):m;fr.default.monitor(R,{debug:y,beaconCollectionDomain:_,hlsjs:l,Hls:l?Lt.default:void 0,automaticErrorTracking:!1,errorTranslator:E,disableCookies:x,data:{...L?{env_key:L}:{},player_software_name:O,player_software:O,player_software_version:b,player_init_time:M,...D}})}},An=(j,R,l)=>{var P;let L=ui(j,R),{src:A}=j;R&&L?(typeof A=="string"?(R.setAttribute("src",A),j.startTime&&(((P=Qt.get(R))!=null?P:{}).startTime=j.startTime,R.addEventListener("durationchange",di,{once:!0}))):R.removeAttribute("src"),R.addEventListener("error",ci),R.addEventListener("error",Mr)):l&&A?(l.on(Lt.default.Events.ERROR,(M,O)=>{let b={[Lt.default.ErrorTypes.NETWORK_ERROR]:Xe.MEDIA_ERR_NETWORK,[Lt.default.ErrorTypes.MEDIA_ERROR]:Xe.MEDIA_ERR_DECODE},_=new Xe("",b[O.type]);_.fatal=O.fatal,_.data=O,R.dispatchEvent(new CustomEvent("error",{detail:_}))}),R.addEventListener("error",Mr),cn(R,l),l.attachMedia(R)):console.error("It looks like the video you're trying to play will not work on this system! If possible, try upgrading to the newest versions of your browser or software.")};function di(j){var R;let l=j.target,P=(R=Qt.get(l))==null?void 0:R.startTime;if(!!P&&sn(l.seekable,l.duration,P)){let L=l.preload==="auto";L&&(l.preload="none"),l.currentTime=P,L&&(l.preload="auto")}}async function ci(j){if(!j.isTrusted)return;j.stopImmediatePropagation();let R=j.target;if(!(R!=null&&R.error))return;let{message:l,code:P}=R.error,L=new Xe(l,P);if(R.src&&(P!==Xe.MEDIA_ERR_DECODE||P!==void 0))try{let{status:A}=await fetch(R.src);L.data={response:{code:A}}}catch{}R.dispatchEvent(new CustomEvent("error",{detail:L}))}function Mr(j){var R,l;if(!(j instanceof CustomEvent)||!(j.detail instanceof Xe))return;let P=j.target,L=j.detail;!L||!L.fatal||(((R=Qt.get(P))!=null?R:{}).error=L,(l=P.mux)==null||l.emit("error",{player_error_code:L.code,player_error_message:L.message}))}var Ln=()=>{try{return"0.8.1"}catch{}return"UNKNOWN"},_n=Ln(),hi=()=>_n;var vi=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],gi=_r.createElement("template");gi.innerHTML=`
|
|
30
|
+
`)}),o.flush()}},"./src/utils/xhr-loader.ts":function(j,R,l){"use strict";l.r(R);var P=l("./src/utils/logger.ts"),L=l("./src/loader/load-stats.ts"),A=/^age:\s*[\d.]+\s*$/m,M=function(){function O(_){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=_?_.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var b=O.prototype;return b.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},b.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},b.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},b.load=function(y,x,D){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=x,this.callbacks=D,this.retryDelay=x.retryDelay,this.loadInternal()},b.loadInternal=function(){var y=this.config,x=this.context;if(!!y){var D=this.loader=new self.XMLHttpRequest,E=this.stats;E.loading.first=0,E.loaded=0;var m=this.xhrSetup;try{if(m)try{m(D,x.url)}catch{D.open("GET",x.url,!0),m(D,x.url)}D.readyState||D.open("GET",x.url,!0);var p=this.context.headers;if(p)for(var f in p)D.setRequestHeader(f,p[f])}catch(e){this.callbacks.onError({code:D.status,text:e.message},x,D);return}x.rangeEnd&&D.setRequestHeader("Range","bytes="+x.rangeStart+"-"+(x.rangeEnd-1)),D.onreadystatechange=this.readystatechange.bind(this),D.onprogress=this.loadprogress.bind(this),D.responseType=x.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),D.send()}},b.readystatechange=function(){var y=this.context,x=this.loader,D=this.stats;if(!(!y||!x)){var E=x.readyState,m=this.config;if(!D.aborted&&E>=2)if(self.clearTimeout(this.requestTimeout),D.loading.first===0&&(D.loading.first=Math.max(self.performance.now(),D.loading.start)),E===4){x.onreadystatechange=null,x.onprogress=null;var p=x.status;if(p>=200&&p<300){D.loading.end=Math.max(self.performance.now(),D.loading.first);var f,e;if(y.responseType==="arraybuffer"?(f=x.response,e=f.byteLength):(f=x.responseText,e=f.length),D.loaded=D.total=e,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(D,y,f,x),!this.callbacks)return;var h={url:x.responseURL,data:f};this.callbacks.onSuccess(h,D,y,x)}else D.retry>=m.maxRetry||p>=400&&p<499?(P.logger.error(p+" while loading "+y.url),this.callbacks.onError({code:p,text:x.statusText},y,x)):(P.logger.warn(p+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,m.maxRetryDelay),D.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout)}},b.loadtimeout=function(){P.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},b.loadprogress=function(y){var x=this.stats;x.loaded=y.loaded,y.lengthComputable&&(x.total=y.total)},b.getCacheAge=function(){var y=null;if(this.loader&&A.test(this.loader.getAllResponseHeaders())){var x=this.loader.getResponseHeader("age");y=x?parseFloat(x):null}return y},O}();R.default=M}}).default})});var Ct=class{addEventListener(){}removeEventListener(){}dispatchEvent(R){return!0}};if(typeof DocumentFragment=="undefined"){class j extends Ct{}globalThis.DocumentFragment=j}var Ht=class extends Ct{},Ar=class extends Ct{},nn={get(j){},define(j,R,l){},upgrade(j){},whenDefined(j){return Promise.resolve(Ht)}},Vt,Lr=class{constructor(R,l={}){lt(this,Vt,void 0);ut(this,Vt,l==null?void 0:l.detail)}get detail(){return ze(this,Vt)}initCustomEvent(){}};Vt=new WeakMap;function an(j,R){return new Ht}var Xr={document:{createElement:an},DocumentFragment,customElements:nn,CustomEvent:Lr,EventTarget:Ct,HTMLElement:Ht,HTMLVideoElement:Ar},Qr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",mt=Qr?Xr:globalThis,_r=Qr?Xr.document:globalThis.document;var fr=sr($r(),1),Lt=sr(lr(),1),Ir=sr(lr(),1),Mt=sr(lr(),1),zt=class extends Error{constructor(j,R=zt.MEDIA_ERR_CUSTOM,l){var P;super(j),this.name="MediaError",this.code=R,this.fatal=l!=null?l:R>=zt.MEDIA_ERR_NETWORK&&R<=zt.MEDIA_ERR_ENCRYPTED,this.message||(this.message=(P=zt.defaultMessages[this.code])!=null?P:"")}},Xe=zt;Xe.MEDIA_ERR_ABORTED=1,Xe.MEDIA_ERR_NETWORK=2,Xe.MEDIA_ERR_DECODE=3,Xe.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Xe.MEDIA_ERR_ENCRYPTED=5,Xe.MEDIA_ERR_CUSTOM=100,Xe.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."};var ri=(j,R)=>j in R,Pr={ANY:"any",MUTED:"muted"},ur={VOD:"on-demand",ON_DEMAND:"on-demand",LIVE:"live",LL_LIVE:"ll-live",DVR:"live:dvr",LL_DVR:"ll-live:dvr"},_t={MSE:"mse",NATIVE:"native"},Cr={HEADER:"header",QUERY:"query",NONE:"none"},Fn=Object.values(Cr),Ft={M3U8:"application/vnd.apple.mpegurl",MP4:"video/mp4"},Mr={HLS:Ft.M3U8},wn=Object.keys(Mr),kn=[...Object.values(Ft),"hls","HLS"],Xt=(j,R,l,P)=>{j.addEventListener(R,l,P),j.addEventListener("teardown",()=>{j.removeEventListener(R,l)},{once:!0})};function sn(j,R,l){R&&l>R&&(l=R);for(let P=0;P<j.length;P++)if(j.start(P)<=l&&j.end(P)>=l)return!0;return!1}var on=j=>{let R=j.indexOf("?");if(R<0)return[j];let l=j.slice(0,R),P=j.slice(R);return[l,P]},ii=j=>{let R=j.type;if(R){let P=R.toUpperCase();return ri(P,Mr)?Mr[P]:R}let{src:l}=j;return l?ln(l):""},ln=j=>{let R="";try{R=new URL(j).pathname}catch{console.error("invalid url")}let l=R.lastIndexOf(".");if(l<0)return"";let P=R.slice(l+1).toUpperCase();return ri(P,Ft)?Ft[P]:""},un=Object.values(Pr),Jr=j=>typeof j=="boolean"||typeof j=="string"&&un.includes(j),fn=({autoplay:j},R,l)=>{let P=!1,L=!1,A=Jr(j)?j:!!j,M=()=>{P||Xt(R,"playing",()=>{P=!0},{once:!0})};if(M(),Xt(R,"loadstart",()=>{P=!1,M(),Rr(R,A)},{once:!0}),Xt(R,"loadstart",()=>{l||(L=!Number.isFinite(R.duration)),Rr(R,A)},{once:!0}),l&&l.once(Ir.default.Events.LEVEL_LOADED,(O,b)=>{var _;L=(_=b.details.live)!=null?_:!1}),!A){let O=()=>{!L||(l!=null&&l.liveSyncPosition?R.currentTime=l.liveSyncPosition:Number.isFinite(R.seekable.end(0))&&(R.currentTime=R.seekable.end(0)))};l&&Xt(R,"play",()=>{R.preload==="metadata"?l.once(Ir.default.Events.LEVEL_UPDATED,O):O()},{once:!0})}return O=>{P||(A=Jr(O)?O:!!O,Rr(R,A))}},Rr=(j,R)=>{if(!R)return;let l=j.muted,P=()=>j.muted=l;switch(R){case Pr.ANY:j.play().catch(()=>{j.muted=!0,j.play().catch(P)});break;case Pr.MUTED:j.muted=!0,j.play().catch(P);break;default:j.play().catch(()=>{});break}},dn=({preload:j,src:R},l,P)=>{let L=x=>{x!=null&&["","none","metadata","auto"].includes(x)?l.setAttribute("preload",x):l.removeAttribute("preload")};if(!P)return L(j),L;let A=!1,M=!1,O=P.config.maxBufferLength,b=P.config.maxBufferSize,_=x=>{L(x);let D=x!=null?x:l.preload;M||D==="none"||(D==="metadata"?(P.config.maxBufferLength=1,P.config.maxBufferSize=1):(P.config.maxBufferLength=O,P.config.maxBufferSize=b),y())},y=()=>{!A&&R&&(A=!0,P.loadSource(R))};return Xt(l,"play",()=>{M=!0,P.config.maxBufferLength=O,P.config.maxBufferSize=b,y()},{once:!0}),_(j),_};function cn(j,R){R.on(Mt.default.Events.NON_NATIVE_TEXT_TRACKS_FOUND,(L,{tracks:A})=>{A.forEach(M=>{var O;let b=(O=M.subtitleTrack)!=null?O:M.closedCaptions,_=R.subtitleTracks.findIndex(({lang:y,name:x,type:D})=>y==(b==null?void 0:b.lang)&&x===M.label&&D.toLowerCase()===M.kind);hn(j,M.kind,M.label,b==null?void 0:b.lang,`${M.kind}${_}`)})});let l=()=>{var L;if(!R.subtitleTracks.length)return;let A=Array.from(j.textTracks).find(O=>O.id&&O.mode==="showing"&&["subtitles","captions"].includes(O.kind)),M=`${(L=R.subtitleTracks[R.subtitleTrack])==null?void 0:L.type.toLowerCase()}${R.subtitleTrack}`;if(A&&(R.subtitleTrack<0||(A==null?void 0:A.id)!==M)){let O=R.subtitleTracks.findIndex(({lang:b,name:_,type:y})=>b==A.language&&_===A.label&&y.toLowerCase()===A.kind);R.subtitleTrack=O}A&&(A==null?void 0:A.id)===M&&A.cues&&Array.from(A.cues).forEach(O=>{A.addCue(O)})};j.textTracks.addEventListener("change",l),R.on(Mt.default.Events.CUES_PARSED,(L,{track:A,cues:M})=>{let O=j.textTracks.getTrackById(A);if(!O)return;let b=O.mode==="disabled";b&&(O.mode="hidden"),M.forEach(_=>{var y;(y=O.cues)!=null&&y.getCueById(_.id)||O.addCue(_)}),b&&(O.mode="disabled")}),R.once(Mt.default.Events.DESTROYING,()=>{j.textTracks.removeEventListener("change",l),j.querySelectorAll("track[data-removeondestroy]").forEach(L=>{L.remove()})});let P=()=>{Array.from(j.textTracks).forEach(L=>{var A,M;if(!["subtitles","caption"].includes(L.kind)&&L.label==="thumbnails"){if(!((A=L.cues)!=null&&A.length)){let O=j.querySelector('track[label="thumbnails"]'),b=(M=O==null?void 0:O.getAttribute("src"))!=null?M:"";O==null||O.removeAttribute("src"),setTimeout(()=>{O==null||O.setAttribute("src",b)},0)}L.mode!=="hidden"&&(L.mode="hidden")}})};R.once(Mt.default.Events.MANIFEST_LOADED,P),R.once(Mt.default.Events.MEDIA_ATTACHED,P)}function hn(j,R,l,P,L){let A=document.createElement("track");return A.kind=R,A.label=l,P&&(A.srclang=P),L&&(A.id=L),A.track.mode="disabled",A.setAttribute("data-removeondestroy",""),j.append(A),A.track}var Zr,qr,vn=(qr=(Zr=globalThis==null?void 0:globalThis.navigator)==null?void 0:Zr.userAgent)!=null?qr:"",gn=vn.toLowerCase().indexOf("android")!==-1,Qt=new WeakMap,ni="mux.com",ei,ti,ai=(ti=(ei=Lt.default).isSupported)==null?void 0:ti.call(ei),mn=gn,si=()=>fr.default.utils.now(),pn=fr.default.utils.generateUUID,oi=(j,{domain:R=ni}={})=>{if(!j)return;let[l,P=""]=on(j);return`https://stream.${R}/${l}.m3u8${P}`},En=j=>{if(!j)return;let[R]=j.split("?");return R||void 0},yn=j=>{if(!j||!j.startsWith("https://stream."))return;let[R]=new URL(j).pathname.slice(1).split(".m3u8");return R||void 0},Tn=j=>{var R,l,P;return(R=j==null?void 0:j.metadata)!=null&&R.video_id?j.metadata.video_id:fi(j)&&(P=(l=En(j.playbackId))!=null?l:yn(j.src))!=null?P:j.src};var li=(j,R,l)=>{wr(R,l);let{metadata:P={}}=j,{view_session_id:L=pn()}=P,A=Tn(j);P.view_session_id=L,P.video_id=A,j.metadata=P,Qt.set(R,{});let M=xn(j,R);Dn(j,R,M),An(j,R,M);let O=fn(j,R,M),b=dn(j,R,M);return{engine:M,setAutoplay:O,setPreload:b}},wr=(j,R)=>{let l=R==null?void 0:R.engine;l&&(l.detachMedia(),l.destroy()),(j==null?void 0:j.mux)&&!j.mux.deleted&&(j.mux.destroy(),delete j.mux),j&&(j.removeAttribute("src"),j.load(),j.removeEventListener("error",ci),j.removeEventListener("error",Fr),j.removeEventListener("durationchange",di),Qt.delete(j),j.dispatchEvent(new Event("teardown")))};function ui(j,R){var l;let P=ii(j);if(P!==Ft.M3U8)return!0;let L=!P||((l=R.canPlayType(P))!=null?l:!0),{preferPlayback:A}=j,M=A===_t.MSE,O=A===_t.NATIVE;return L&&(O||!(ai&&(M||mn)))}var xn=(j,R)=>{let{debug:l,streamType:P,startTime:L=-1,metadata:A,preferCmcd:M}=j,O=ii(j)===Ft.M3U8,b=ui(j,R);if(O&&!b&&ai){let _={backBufferLength:30,renderTextTracksNatively:!1,liveDurationInfinity:!0},y=Sn(P),x=M!==Cr.NONE?{useHeaders:M===Cr.HEADER,sessionId:A.view_session_id,contentId:A.video_id}:void 0;return new Lt.default({debug:l,startPosition:L,cmcd:x,..._,...y})}},Sn=j=>[ur.LIVE,ur.DVR].includes(j)?{backBufferLength:8}:[ur.LL_LIVE,ur.LL_DVR].includes(j)?{backBufferLength:4,maxFragLookUpTolerance:.001}:{},fi=({playbackId:j,src:R,customDomain:l})=>{if(j)return!0;if(typeof R!="string")return!1;let P=window==null?void 0:window.location.href,L=new URL(R,P).hostname.toLocaleLowerCase();return L.includes(ni)||!!l&&L.includes(l.toLocaleLowerCase())},Dn=(j,R,l)=>{var P;let{envKey:L}=j,A=fi(j);if(L||A){let{playerInitTime:M,playerSoftwareName:O,playerSoftwareVersion:b,beaconCollectionDomain:_,debug:y,disableCookies:x}=j,D={...j.metadata,video_title:((P=j==null?void 0:j.metadata)==null?void 0:P.video_title)||void 0},E=m=>typeof m.player_error_code=="string"?!1:typeof j.errorTranslator=="function"?j.errorTranslator(m):m;fr.default.monitor(R,{debug:y,beaconCollectionDomain:_,hlsjs:l,Hls:l?Lt.default:void 0,automaticErrorTracking:!1,errorTranslator:E,disableCookies:x,data:{...L?{env_key:L}:{},player_software_name:O,player_software:O,player_software_version:b,player_init_time:M,...D}})}},An=(j,R,l)=>{var P;let L=ui(j,R),{src:A}=j;R&&L?(typeof A=="string"?(R.setAttribute("src",A),j.startTime&&(((P=Qt.get(R))!=null?P:{}).startTime=j.startTime,R.addEventListener("durationchange",di,{once:!0}))):R.removeAttribute("src"),R.addEventListener("error",ci),R.addEventListener("error",Fr)):l&&A?(l.on(Lt.default.Events.ERROR,(M,O)=>{let b={[Lt.default.ErrorTypes.NETWORK_ERROR]:Xe.MEDIA_ERR_NETWORK,[Lt.default.ErrorTypes.MEDIA_ERROR]:Xe.MEDIA_ERR_DECODE},_=new Xe("",b[O.type]);_.fatal=O.fatal,_.data=O,R.dispatchEvent(new CustomEvent("error",{detail:_}))}),R.addEventListener("error",Fr),cn(R,l),l.attachMedia(R)):console.error("It looks like the video you're trying to play will not work on this system! If possible, try upgrading to the newest versions of your browser or software.")};function di(j){var R;let l=j.target,P=(R=Qt.get(l))==null?void 0:R.startTime;if(!!P&&sn(l.seekable,l.duration,P)){let L=l.preload==="auto";L&&(l.preload="none"),l.currentTime=P,L&&(l.preload="auto")}}async function ci(j){if(!j.isTrusted)return;j.stopImmediatePropagation();let R=j.target;if(!(R!=null&&R.error))return;let{message:l,code:P}=R.error,L=new Xe(l,P);if(R.src&&(P!==Xe.MEDIA_ERR_DECODE||P!==void 0))try{let{status:A}=await fetch(R.src);L.data={response:{code:A}}}catch{}R.dispatchEvent(new CustomEvent("error",{detail:L}))}function Fr(j){var R,l;if(!(j instanceof CustomEvent)||!(j.detail instanceof Xe))return;let P=j.target,L=j.detail;!L||!L.fatal||(((R=Qt.get(P))!=null?R:{}).error=L,(l=P.mux)==null||l.emit("error",{player_error_code:L.code,player_error_message:L.message}))}var Ln=()=>{try{return"0.9.0"}catch{}return"UNKNOWN"},_n=Ln(),hi=()=>_n;var vi=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],gi=_r.createElement("template");gi.innerHTML=`
|
|
31
31
|
<style>
|
|
32
32
|
:host {
|
|
33
33
|
/* display:inline (like the native el) makes it so you can't fill
|
|
@@ -50,7 +50,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
50
50
|
|
|
51
51
|
<audio part="audio" crossorigin></audio>
|
|
52
52
|
<slot></slot>
|
|
53
|
-
`;var $t,wt,dr,bt=class extends mt.HTMLElement{constructor(){super();lt(this,wt);lt(this,$t,void 0);this.attachShadow({mode:"open"}),this.isConnected&&At(this,wt,dr).call(this)}static get observedAttributes(){let l=[];Object.getOwnPropertyNames(this.prototype).forEach(L=>{let A=!1;try{typeof this.prototype[L]=="function"&&(A=!0)}catch{}!A&&L!==L.toUpperCase()&&l.push(L.toLowerCase())});let P=Object.getPrototypeOf(this).observedAttributes;return P&&(l=l.concat(P)),l}attributeChangedCallback(l,P,L){At(this,wt,dr).call(this),this.forwardAttribute(l,P,L)}forwardAttribute(l,P,L){let A=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),M=On(A,l),O=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;M&&!O?typeof this[M]=="boolean"?L===null?this[M]=!1:this[M]=!0:this[M]=L:L===null?this.nativeEl.removeAttribute(l):["id","class"].indexOf(l)===-1&&this.nativeEl.setAttribute(l,L)}connectedCallback(){At(this,wt,dr).call(this)}};$t=new WeakMap,wt=new WeakSet,dr=function(){if(ze(this,$t))return;ut(this,$t,!0),this.shadowRoot.append(gi.content.cloneNode(!0));let l=this.nativeEl=this.shadowRoot.querySelector("audio");vi.forEach(L=>{l.addEventListener(L,A=>{this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))})});let P=this.shadowRoot.querySelector("slot");P.addEventListener("slotchange",()=>{P.assignedElements().forEach(L=>{!["track","source"].includes(L.localName)||l.append(L)})}),Array.from(this.attributes).forEach(L=>{this.forwardAttribute(L.name,null,L.value)}),l.defaultMuted&&(l.muted=!0)};var mi=[],pi=_r.createElement("audio"),bn=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let j=Object.getPrototypeOf(pi);j&&j!==mt.HTMLElement.prototype;j=Object.getPrototypeOf(j))Object.keys(j).forEach(R=>{bn.indexOf(R)===-1&&mi.push(R)});mi.forEach(j=>{if(typeof pi[j]=="function")bt.prototype[j]=function(){return this.nativeEl[j].apply(this.nativeEl,arguments)};else{let l={get(){return this.nativeEl[j]}};j!==j.toUpperCase()&&(l.set=function(P){this.nativeEl[j]=P}),Object.defineProperty(bt.prototype,j,l)}});function On(j,R){let l=null;return j.forEach(P=>{P.toLowerCase()==R.toLowerCase()&&(l=P)}),l}mt.customElements.get("custom-audio")||(mt.customElements.define("custom-audio",bt),mt.CustomAudioElement=bt);var
|
|
53
|
+
`;var $t,wt,dr,bt=class extends mt.HTMLElement{constructor(){super();lt(this,wt);lt(this,$t,void 0);this.attachShadow({mode:"open"}),this.isConnected&&At(this,wt,dr).call(this)}static get observedAttributes(){let l=[];Object.getOwnPropertyNames(this.prototype).forEach(L=>{let A=!1;try{typeof this.prototype[L]=="function"&&(A=!0)}catch{}!A&&L!==L.toUpperCase()&&l.push(L.toLowerCase())});let P=Object.getPrototypeOf(this).observedAttributes;return P&&(l=l.concat(P)),l}attributeChangedCallback(l,P,L){At(this,wt,dr).call(this),this.forwardAttribute(l,P,L)}forwardAttribute(l,P,L){let A=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),M=On(A,l),O=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;M&&!O?typeof this[M]=="boolean"?L===null?this[M]=!1:this[M]=!0:this[M]=L:L===null?this.nativeEl.removeAttribute(l):["id","class"].indexOf(l)===-1&&this.nativeEl.setAttribute(l,L)}connectedCallback(){At(this,wt,dr).call(this)}};$t=new WeakMap,wt=new WeakSet,dr=function(){if(ze(this,$t))return;ut(this,$t,!0),this.shadowRoot.append(gi.content.cloneNode(!0));let l=this.nativeEl=this.shadowRoot.querySelector("audio");vi.forEach(L=>{l.addEventListener(L,A=>{this.dispatchEvent(new CustomEvent(A.type,{detail:A.detail}))})});let P=this.shadowRoot.querySelector("slot");P.addEventListener("slotchange",()=>{P.assignedElements().forEach(L=>{!["track","source"].includes(L.localName)||l.append(L)})}),Array.from(this.attributes).forEach(L=>{this.forwardAttribute(L.name,null,L.value)}),l.defaultMuted&&(l.muted=!0)};var mi=[],pi=_r.createElement("audio"),bn=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let j=Object.getPrototypeOf(pi);j&&j!==mt.HTMLElement.prototype;j=Object.getPrototypeOf(j))Object.keys(j).forEach(R=>{bn.indexOf(R)===-1&&mi.push(R)});mi.forEach(j=>{if(typeof pi[j]=="function")bt.prototype[j]=function(){return this.nativeEl[j].apply(this.nativeEl,arguments)};else{let l={get(){return this.nativeEl[j]}};j!==j.toUpperCase()&&(l.set=function(P){this.nativeEl[j]=P}),Object.defineProperty(bt.prototype,j,l)}});function On(j,R){let l=null;return j.forEach(P=>{P.toLowerCase()==R.toLowerCase()&&(l=P)}),l}mt.customElements.get("custom-audio")||(mt.customElements.define("custom-audio",bt),mt.CustomAudioElement=bt);var kr=bt;var xe={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",DISABLE_COOKIES:"disable-cookies",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Rn=Object.values(xe),In=hi(),Pn="mux-audio",pt,kt,Zt,Bt,qt,Br,Jt=class extends kr{constructor(){super();lt(this,qt);lt(this,pt,void 0);lt(this,kt,void 0);lt(this,Zt,void 0);lt(this,Bt,{});ut(this,Zt,si())}static get observedAttributes(){var l;return[...Rn,...(l=kr.observedAttributes)!=null?l:[]]}get playerInitTime(){return ze(this,Zt)}get playerSoftwareName(){return Pn}get playerSoftwareVersion(){return In}get _hls(){var l;return(l=ze(this,pt))==null?void 0:l.engine}get mux(){return this.nativeEl.mux}get src(){return this.getAttribute("src")}set src(l){l!==this.src&&(l==null?this.removeAttribute("src"):this.setAttribute("src",l))}get preload(){let l=this.getAttribute("preload");return l===""?"auto":["none","metadata","auto"].includes(l)?l:super.preload}set preload(l){l!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(l)?this.setAttribute("preload",l):this.removeAttribute("preload"))}get debug(){return this.getAttribute(xe.DEBUG)!=null}set debug(l){l!==this.debug&&(l?this.setAttribute(xe.DEBUG,""):this.removeAttribute(xe.DEBUG))}get disableCookies(){return this.hasAttribute(xe.DISABLE_COOKIES)}set disableCookies(l){l!==this.disableCookies&&(l?this.setAttribute(xe.DISABLE_COOKIES,""):this.removeAttribute(xe.DISABLE_COOKIES))}get startTime(){let l=this.getAttribute(xe.START_TIME);if(l==null)return;let P=+l;return Number.isNaN(P)?void 0:P}set startTime(l){l!==this.startTime&&(l==null?this.removeAttribute(xe.START_TIME):this.setAttribute(xe.START_TIME,`${l}`))}get playbackId(){var l;return(l=this.getAttribute(xe.PLAYBACK_ID))!=null?l:void 0}set playbackId(l){l!==this.playbackId&&(l?this.setAttribute(xe.PLAYBACK_ID,l):this.removeAttribute(xe.PLAYBACK_ID))}get envKey(){var l;return(l=this.getAttribute(xe.ENV_KEY))!=null?l:void 0}set envKey(l){l!==this.envKey&&(l?this.setAttribute(xe.ENV_KEY,l):this.removeAttribute(xe.ENV_KEY))}get beaconCollectionDomain(){var l;return(l=this.getAttribute(xe.BEACON_COLLECTION_DOMAIN))!=null?l:void 0}set beaconCollectionDomain(l){l!==this.beaconCollectionDomain&&(l?this.setAttribute(xe.BEACON_COLLECTION_DOMAIN,l):this.removeAttribute(xe.BEACON_COLLECTION_DOMAIN))}get streamType(){var l;return(l=this.getAttribute(xe.STREAM_TYPE))!=null?l:void 0}set streamType(l){l!==this.streamType&&(l?this.setAttribute(xe.STREAM_TYPE,l):this.removeAttribute(xe.STREAM_TYPE))}get preferPlayback(){let l=this.getAttribute(xe.PREFER_PLAYBACK);if(l===_t.MSE||l===_t.NATIVE)return l}set preferPlayback(l){l!==this.preferPlayback&&(l===_t.MSE||l===_t.NATIVE?this.setAttribute(xe.PREFER_PLAYBACK,l):this.removeAttribute(xe.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(P=>P.startsWith("metadata-")&&![xe.METADATA_URL].includes(P)).reduce((P,L)=>{let A=this.getAttribute(L);return A!=null&&(P[L.replace(/^metadata-/,"").replace(/-/g,"_")]=A),P},{}),...ze(this,Bt)}}set metadata(l){ut(this,Bt,l!=null?l:{}),this.mux&&(console.info("Some metadata values may not be overridable at this time. Make sure you set all metadata to override before setting the src."),this.mux.emit("hb",ze(this,Bt)))}load(){ut(this,pt,li(this,this.nativeEl,ze(this,pt)))}unload(){wr(this.nativeEl,ze(this,pt)),ut(this,pt,void 0)}attributeChangedCallback(l,P,L){var A,M;switch(super.attributeChangedCallback(l,P,L),l){case"src":{let O=!!P,b=!!L;!O&&b?At(this,qt,Br).call(this):O&&!b?this.unload():O&&b&&(this.unload(),At(this,qt,Br).call(this));break}case"autoplay":if(L===P)break;(A=ze(this,pt))==null||A.setAutoplay(this.autoplay);break;case"preload":if(L===P)break;(M=ze(this,pt))==null||M.setPreload(L);break;case xe.PLAYBACK_ID:this.src=oi(L!=null?L:void 0);break;case xe.DEBUG:{let O=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=O);break}case xe.METADATA_URL:L&&fetch(L).then(O=>O.json()).then(O=>this.metadata=O).catch(O=>console.error(`Unable to load or parse metadata JSON from metadata-url ${L}!`));break;default:break}}disconnectedCallback(){this.unload()}};pt=new WeakMap,kt=new WeakMap,Zt=new WeakMap,Bt=new WeakMap,qt=new WeakSet,Br=async function(){ze(this,kt)||(await ut(this,kt,Promise.resolve()),ut(this,kt,null),this.load())};mt.customElements.get("mux-audio")||(mt.customElements.define("mux-audio",Jt),mt.MuxAudioElement=Jt);var $n=Jt;})();
|
|
54
54
|
/*!
|
|
55
55
|
* JavaScript Cookie v2.1.3
|
|
56
56
|
* https://github.com/js-cookie/js-cookie
|