vendor: 79,998 bytes, line 1
1import{g as Xt}from"./commonjsHelpers-Cpj98o6Y.js";var at={exports:{}},yt;function Qt(){return yt||(yt=1,function(vt,$t){(function(ge,te){vt.exports=te()})(window,function(){return function(ge){var te={};function B(G){if(te[G])return te[G].exports;var w=te[G]={i:G,l:!1,exports:{}};return ge[G].call(w.exports,w,w.exports,B),w.l=!0,w.exports}return B.m=ge,B.c=te,B.d=function(G,w,p){B.o(G,w)||Object.defineProperty(G,w,{enumerable:!0,get:p})},B.r=function(G){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},B.t=function(G,w){if(1&w&&(G=B(G)),8&w||4&w&&typeof G=="object"&&G&&G.__esModule)return G;var p=Object.create(null);if(B.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:G}),2&w&&typeof G!="string")for(var v in G)B.d(p,v,(function(S){return G[S]}).bind(null,v));return p},B.n=function(G){var w=G&&G.__esModule?function(){return G.default}:function(){return G};return B.d(w,"a",w),w},B.o=function(G,w){return Object.prototype.hasOwnProperty.call(G,w)},B.p="",B(B.s=20)}([function(ge,te,B){var G=B(9),w=B.n(G),p=function(){function v(){}return v.e=function(S,g){S&&!v.FORCE_GLOBAL_TAG||(S=v.GLOBAL_TAG);var T="[".concat(S,"] > ").concat(g);v.ENABLE_CALLBACK&&v.emitter.emit("log","error",T),v.ENABLE_ERROR&&(console.error?console.error(T):console.warn?console.warn(T):console.log(T))},v.i=function(S,g){S&&!v.FORCE_GLOBAL_TAG||(S=v.GLOBAL_TAG);var T="[".concat(S,"] > ").concat(g);v.ENABLE_CALLBACK&&v.emitter.emit("log","info",T),v.ENABLE_INFO&&(console.info?console.info(T):console.log(T))},v.w=function(S,g){S&&!v.FORCE_GLOBAL_TAG||(S=v.GLOBAL_TAG);var T="[".concat(S,"] > ").concat(g);v.ENABLE_CALLBACK&&v.emitter.emit("log","warn",T),v.ENABLE_WARN&&(console.warn?console.warn(T):console.log(T))},v.d=function(S,g){S&&!v.FORCE_GLOBAL_TAG||(S=v.GLOBAL_TAG);var T="[".concat(S,"] > ").concat(g);v.ENABLE_CALLBACK&&v.emitter.emit("log","debug",T),v.ENABLE_DEBUG&&(console.debug?console.debug(T):console.log(T))},v.v=function(S,g){S&&!v.FORCE_GLOBAL_TAG||(S=v.GLOBAL_TAG);var T="[".concat(S,"] > ").concat(g);v.ENABLE_CALLBACK&&v.emitter.emit("log","verbose",T),v.ENABLE_VERBOSE&&console.log(T)},v}();p.GLOBAL_TAG="mpegts.js",p.FORCE_GLOBAL_TAG=!1,p.ENABLE_ERROR=!0,p.ENABLE_INFO=!0,p.ENABLE_WARN=!0,p.ENABLE_DEBUG=!0,p.ENABLE_VERBOSE=!0,p.ENABLE_CALLBACK=!1,p.emitter=new w.a,te.a=p},function(ge,te,B){var G;(function(w){w.IO_ERROR="io_error",w.DEMUX_ERROR="demux_error",w.INIT_SEGMENT="init_segment",w.MEDIA_SEGMENT="media_segment",w.LOADING_COMPLETE="loading_complete",w.RECOVERED_EARLY_EOF="recovered_early_eof",w.MEDIA_INFO="media_info",w.METADATA_ARRIVED="metadata_arrived",w.SCRIPTDATA_ARRIVED="scriptdata_arrived",w.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",w.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",w.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",w.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",w.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",w.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",w.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",w.STATISTICS_INFO="statistics_info",w.RECOMMEND_SEEKPOINT="recommend_seekpoint"})(G||(G={})),te.a=G},function(ge,te,B){B.d(te,"c",function(){return w}),B.d(te,"b",function(){return p}),B.d(te,"a",function(){return v});var G=B(3),w={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},p={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},v=function(){function S(g){this._type=g||"undefined",this._status=w.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return S.prototype.destroy=function(){this._status=w.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},S.prototype.isWorking=function(){return this._status===w.kConnecting||this._status===w.kBuffering},Object.defineProperty(S.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(g){this._onContentLengthKnown=g},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(g){this._onURLRedirect=g},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(g){this._onDataArrival=g},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onError",{get:function(){return this._onError},set:function(g){this._onError=g},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onComplete",{get:function(){return this._onComplete},set:function(g){this._onComplete=g},enumerable:!1,configurable:!0}),S.prototype.open=function(g,T){throw new G.c("Unimplemented abstract function!")},S.prototype.abort=function(){throw new G.c("Unimplemented abstract function!")},S}()},function(ge,te,B){B.d(te,"d",function(){return p}),B.d(te,"a",function(){return v}),B.d(te,"b",function(){return S}),B.d(te,"c",function(){return g});var G,w=(G=function(T,E){return(G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,O){L.__proto__=O}||function(L,O){for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&(L[M]=O[M])})(T,E)},function(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function L(){this.constructor=T}G(T,E),T.prototype=E===null?Object.create(E):(L.prototype=E.prototype,new L)}),p=function(){function T(E){this._message=E}return Object.defineProperty(T.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),T.prototype.toString=function(){return this.name+": "+this.message},T}(),v=function(T){function E(L){return T.call(this,L)||this}return w(E,T),Object.defineProperty(E.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),E}(p),S=function(T){function E(L){return T.call(this,L)||this}return w(E,T),Object.defineProperty(E.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),E}(p),g=function(T){function E(L){return T.call(this,L)||this}return w(E,T),Object.defineProperty(E.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),E}(p)},function(ge,te,B){var G;(function(w){w.ERROR="error",w.LOADING_COMPLETE="loading_complete",w.RECOVERED_EARLY_EOF="recovered_early_eof",w.MEDIA_INFO="media_info",w.METADATA_ARRIVED="metadata_arrived",w.SCRIPTDATA_ARRIVED="scriptdata_arrived",w.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",w.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",w.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",w.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",w.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",w.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",w.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",w.STATISTICS_INFO="statistics_info",w.DESTROYING="destroying"})(G||(G={})),te.a=G},function(ge,te,B){var G={};(function(){var w=self.navigator.userAgent.toLowerCase(),p=/(edge)\/([\w.]+)/.exec(w)||/(opr)[\/]([\w.]+)/.exec(w)||/(chrome)[ \/]([\w.]+)/.exec(w)||/(iemobile)[\/]([\w.]+)/.exec(w)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(w)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(w)||/(webkit)[ \/]([\w.]+)/.exec(w)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(w)||/(msie) ([\w.]+)/.exec(w)||w.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(w)||w.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(w)||[],v=/(ipad)/.exec(w)||/(ipod)/.exec(w)||/(windows phone)/.exec(w)||/(iphone)/.exec(w)||/(kindle)/.exec(w)||/(android)/.exec(w)||/(windows)/.exec(w)||/(mac)/.exec(w)||/(linux)/.exec(w)||/(cros)/.exec(w)||[],S={browser:p[5]||p[3]||p[1]||"",version:p[2]||p[4]||"0",majorVersion:p[4]||p[2]||"0",platform:v[0]||""},g={};if(S.browser){g[S.browser]=!0;var T=S.majorVersion.split(".");g.version={major:parseInt(S.majorVersion,10),string:S.version},T.length>1&&(g.version.minor=parseInt(T[1],10)),T.length>2&&(g.version.build=parseInt(T[2],10))}S.platform&&(g[S.platform]=!0),(g.chrome||g.opr||g.safari)&&(g.webkit=!0),(g.rv||g.iemobile)&&(g.rv&&delete g.rv,S.browser="msie",g.msie=!0),g.edge&&(delete g.edge,S.browser="msedge",g.msedge=!0),g.opr&&(S.browser="opera",g.opera=!0),g.safari&&g.android&&(S.browser="android",g.android=!0);for(var E in g.name=S.browser,g.platform=S.platform,G)G.hasOwnProperty(E)&&delete G[E];Object.assign(G,g)})(),te.a=G},function(ge,te,B){te.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(ge,te,B){var G;(function(w){w.ERROR="error",w.SOURCE_OPEN="source_open",w.UPDATE_END="update_end",w.BUFFER_FULL="buffer_full",w.START_STREAMING="start_streaming",w.END_STREAMING="end_streaming"})(G||(G={})),te.a=G},function(ge,te,B){var G=B(9),w=B.n(G),p=B(0),v=function(){function S(){}return Object.defineProperty(S,"forceGlobalTag",{get:function(){return p.a.FORCE_GLOBAL_TAG},set:function(g){p.a.FORCE_GLOBAL_TAG=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"globalTag",{get:function(){return p.a.GLOBAL_TAG},set:function(g){p.a.GLOBAL_TAG=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableAll",{get:function(){return p.a.ENABLE_VERBOSE&&p.a.ENABLE_DEBUG&&p.a.ENABLE_INFO&&p.a.ENABLE_WARN&&p.a.ENABLE_ERROR},set:function(g){p.a.ENABLE_VERBOSE=g,p.a.ENABLE_DEBUG=g,p.a.ENABLE_INFO=g,p.a.ENABLE_WARN=g,p.a.ENABLE_ERROR=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableDebug",{get:function(){return p.a.ENABLE_DEBUG},set:function(g){p.a.ENABLE_DEBUG=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableVerbose",{get:function(){return p.a.ENABLE_VERBOSE},set:function(g){p.a.ENABLE_VERBOSE=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableInfo",{get:function(){return p.a.ENABLE_INFO},set:function(g){p.a.ENABLE_INFO=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableWarn",{get:function(){return p.a.ENABLE_WARN},set:function(g){p.a.ENABLE_WARN=g,S._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(S,"enableError",{get:function(){return p.a.ENABLE_ERROR},set:function(g){p.a.ENABLE_ERROR=g,S._notifyChange()},enumerable:!1,configurable:!0}),S.getConfig=function(){return{globalTag:p.a.GLOBAL_TAG,forceGlobalTag:p.a.FORCE_GLOBAL_TAG,enableVerbose:p.a.ENABLE_VERBOSE,enableDebug:p.a.ENABLE_DEBUG,enableInfo:p.a.ENABLE_INFO,enableWarn:p.a.ENABLE_WARN,enableError:p.a.ENABLE_ERROR,enableCallback:p.a.ENABLE_CALLBACK}},S.applyConfig=function(g){p.a.GLOBAL_TAG=g.globalTag,p.a.FORCE_GLOBAL_TAG=g.forceGlobalTag,p.a.ENABLE_VERBOSE=g.enableVerbose,p.a.ENABLE_DEBUG=g.enableDebug,p.a.ENABLE_INFO=g.enableInfo,p.a.ENABLE_WARN=g.enableWarn,p.a.ENABLE_ERROR=g.enableError,p.a.ENABLE_CALLBACK=g.enableCallback},S._notifyChange=function(){var g=S.emitter;if(g.listenerCount("change")>0){var T=S.getConfig();g.emit("change",T)}},S.registerListener=function(g){S.emitter.addListener("change",g)},S.removeListener=function(g){S.emitter.removeListener("change",g)},S.addLogListener=function(g){p.a.emitter.addListener("log",g),p.a.emitter.listenerCount("log")>0&&(p.a.ENABLE_CALLBACK=!0,S._notifyChange())},S.removeLogListener=function(g){p.a.emitter.removeListener("log",g),p.a.emitter.listenerCount("log")===0&&(p.a.ENABLE_CALLBACK=!1,S._notifyChange())},S}();v.emitter=new w.a,te.a=v},function(ge,te,B){var G,w=typeof Reflect=="object"?Reflect:null,p=w&&typeof w.apply=="function"?w.apply:function(k,q,Q){return Function.prototype.apply.call(k,q,Q)};G=w&&typeof w.ownKeys=="function"?w.ownKeys:Object.getOwnPropertySymbols?function(k){return Object.getOwnPropertyNames(k).concat(Object.getOwnPropertySymbols(k))}:function(k){return Object.getOwnPropertyNames(k)};var v=Number.isNaN||function(k){return k!=k};function S(){S.init.call(this)}ge.exports=S,ge.exports.once=function(k,q){return new Promise(function(Q,D){function c(d){k.removeListener(q,_),D(d)}function _(){typeof k.removeListener=="function"&&k.removeListener("error",c),Q([].slice.call(arguments))}X(k,q,_,{once:!0}),q!=="error"&&function(d,f,V){typeof d.on=="function"&&X(d,"error",f,V)}(k,c,{once:!0})})},S.EventEmitter=S,S.prototype._events=void 0,S.prototype._eventsCount=0,S.prototype._maxListeners=void 0;var g=10;function T(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}function E(k){return k._maxListeners===void 0?S.defaultMaxListeners:k._maxListeners}function L(k,q,Q,D){var c,_,d,f;if(T(Q),(_=k._events)===void 0?(_=k._events=Object.create(null),k._eventsCount=0):(_.newListener!==void 0&&(k.emit("newListener",q,Q.listener?Q.listener:Q),_=k._events),d=_[q]),d===void 0)d=_[q]=Q,++k._eventsCount;else if(typeof d=="function"?d=_[q]=D?[Q,d]:[d,Q]:D?d.unshift(Q):d.push(Q),(c=E(k))>0&&d.length>c&&!d.warned){d.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+d.length+" "+String(q)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=k,V.type=q,V.count=d.length,f=V,console&&console.warn&&console.warn(f)}return k}function O(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function M(k,q,Q){var D={fired:!1,wrapFn:void 0,target:k,type:q,listener:Q},c=O.bind(D);return c.listener=Q,D.wrapFn=c,c}function U(k,q,Q){var D=k._events;if(D===void 0)return[];var c=D[q];return c===void 0?[]:typeof c=="function"?Q?[c.listener||c]:[c]:Q?function(_){for(var d=new Array(_.length),f=0;f<d.length;++f)d[f]=_[f].listener||_[f];return d}(c):P(c,c.length)}function N(k){var q=this._events;if(q!==void 0){var Q=q[k];if(typeof Q=="function")return 1;if(Q!==void 0)return Q.length}return 0}function P(k,q){for(var Q=new Array(q),D=0;D<q;++D)Q[D]=k[D];return Q}function X(k,q,Q,D){if(typeof k.on=="function")D.once?k.once(q,Q):k.on(q,Q);else{if(typeof k.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof k);k.addEventListener(q,function c(_){D.once&&k.removeEventListener(q,c),Q(_)})}}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(k){if(typeof k!="number"||k<0||v(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");g=k}}),S.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},S.prototype.setMaxListeners=function(k){if(typeof k!="number"||k<0||v(k))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+k+".");return this._maxListeners=k,this},S.prototype.getMaxListeners=function(){return E(this)},S.prototype.emit=function(k){for(var q=[],Q=1;Q<arguments.length;Q++)q.push(arguments[Q]);var D=k==="error",c=this._events;if(c!==void 0)D=D&&c.error===void 0;else if(!D)return!1;if(D){var _;if(q.length>0&&(_=q[0]),_ instanceof Error)throw _;var d=new Error("Unhandled error."+(_?" ("+_.message+")":""));throw d.context=_,d}var f=c[k];if(f===void 0)return!1;if(typeof f=="function")p(f,this,q);else{var V=f.length,J=P(f,V);for(Q=0;Q<V;++Q)p(J[Q],this,q)}return!0},S.prototype.addListener=function(k,q){return L(this,k,q,!1)},S.prototype.on=S.prototype.addListener,S.prototype.prependListener=function(k,q){return L(this,k,q,!0)},S.prototype.once=function(k,q){return T(q),this.on(k,M(this,k,q)),this},S.prototype.prependOnceListener=function(k,q){return T(q),this.prependListener(k,M(this,k,q)),this},S.prototype.removeListener=function(k,q){var Q,D,c,_,d;if(T(q),(D=this._events)===void 0)return this;if((Q=D[k])===void 0)return this;if(Q===q||Q.listener===q)--this._eventsCount==0?this._events=Object.create(null):(delete D[k],D.removeListener&&this.emit("removeListener",k,Q.listener||q));else if(typeof Q!="function"){for(c=-1,_=Q.length-1;_>=0;_--)if(Q[_]===q||Q[_].listener===q){d=Q[_].listener,c=_;break}if(c<0)return this;c===0?Q.shift():function(f,V){for(;V+1<f.length;V++)f[V]=f[V+1];f.pop()}(Q,c),Q.length===1&&(D[k]=Q[0]),D.removeListener!==void 0&&this.emit("removeListener",k,d||q)}return this},S.prototype.off=S.prototype.removeListener,S.prototype.removeAllListeners=function(k){var q,Q,D;if((Q=this._events)===void 0)return this;if(Q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Q[k]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete Q[k]),this;if(arguments.length===0){var c,_=Object.keys(Q);for(D=0;D<_.length;++D)(c=_[D])!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(q=Q[k])=="function")this.removeListener(k,q);else if(q!==void 0)for(D=q.length-1;D>=0;D--)this.removeListener(k,q[D]);return this},S.prototype.listeners=function(k){return U(this,k,!0)},S.prototype.rawListeners=function(k){return U(this,k,!1)},S.listenerCount=function(k,q){return typeof k.listenerCount=="function"?k.listenerCount(q):N.call(k,q)},S.prototype.listenerCount=N,S.prototype.eventNames=function(){return this._eventsCount>0?G(this._events):[]}},function(ge,te,B){B.d(te,"b",function(){return p}),B.d(te,"a",function(){return v});var G=B(2),w=B(6),p={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},v={NETWORK_EXCEPTION:G.b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:G.b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:G.b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:G.b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:w.a.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:w.a.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:w.a.CODEC_UNSUPPORTED}},function(ge,te,B){B.d(te,"d",function(){return G}),B.d(te,"b",function(){return w}),B.d(te,"a",function(){return p}),B.d(te,"c",function(){return v});var G=function(S,g,T,E,L){this.dts=S,this.pts=g,this.duration=T,this.originalDts=E,this.isSyncPoint=L,this.fileposition=null},w=function(){function S(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return S.prototype.appendSyncPoint=function(g){g.isSyncPoint=!0,this.syncPoints.push(g)},S}(),p=function(){function S(){this._list=[]}return S.prototype.clear=function(){this._list=[]},S.prototype.appendArray=function(g){var T=this._list;g.length!==0&&(T.length>0&&g[0].originalDts<T[T.length-1].originalDts&&this.clear(),Array.prototype.push.apply(T,g))},S.prototype.getLastSyncPointBeforeDts=function(g){if(this._list.length==0)return null;var T=this._list,E=0,L=T.length-1,O=0,M=0,U=L;for(g<T[0].dts&&(E=0,M=U+1);M<=U;){if((O=M+Math.floor((U-M)/2))===L||g>=T[O].dts&&g<T[O+1].dts){E=O;break}T[O].dts<g?M=O+1:U=O-1}return this._list[E]},S}(),v=function(){function S(g){this._type=g,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(S.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),S.prototype.isEmpty=function(){return this._list.length===0},S.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},S.prototype._searchNearestSegmentBefore=function(g){var T=this._list;if(T.length===0)return-2;var E=T.length-1,L=0,O=0,M=E,U=0;if(g<T[0].originalBeginDts)return U=-1;for(;O<=M;){if((L=O+Math.floor((M-O)/2))===E||g>T[L].lastSample.originalDts&&g<T[L+1].originalBeginDts){U=L;break}T[L].originalBeginDts<g?O=L+1:M=L-1}return U},S.prototype._searchNearestSegmentAfter=function(g){return this._searchNearestSegmentBefore(g)+1},S.prototype.append=function(g){var T=this._list,E=g,L=this._lastAppendLocation,O=0;L!==-1&&L<T.length&&E.originalBeginDts>=T[L].lastSample.originalDts&&(L===T.length-1||L<T.length-1&&E.originalBeginDts<T[L+1].originalBeginDts)?O=L+1:T.length>0&&(O=this._searchNearestSegmentBefore(E.originalBeginDts)+1),this._lastAppendLocation=O,this._list.splice(O,0,E)},S.prototype.getLastSegmentBefore=function(g){var T=this._searchNearestSegmentBefore(g);return T>=0?this._list[T]:null},S.prototype.getLastSampleBefore=function(g){var T=this.getLastSegmentBefore(g);return T!=null?T.lastSample:null},S.prototype.getLastSyncPointBefore=function(g){for(var T=this._searchNearestSegmentBefore(g),E=this._list[T].syncPoints;E.length===0&&T>0;)T--,E=this._list[T].syncPoints;return E.length>0?E[E.length-1]:null},S}()},function(ge,te,B){var G=function(){function w(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return w.prototype.isComplete=function(){var p=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,v=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&p&&v},w.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},w.prototype.getNearestKeyframe=function(p){if(this.keyframesIndex==null)return null;var v=this.keyframesIndex,S=this._search(v.times,p);return{index:S,milliseconds:v.times[S],fileposition:v.filepositions[S]}},w.prototype._search=function(p,v){var S=0,g=p.length-1,T=0,E=0,L=g;for(v<p[0]&&(S=0,E=L+1);E<=L;){if((T=E+Math.floor((L-E)/2))===g||v>=p[T]&&v<p[T+1]){S=T;break}p[T]<v?E=T+1:L=T-1}return S},w}();te.a=G},function(ge,te,B){var G=B(9),w=B.n(G),p=B(0),v=B(5),S=B(12);function g(a,i,t){var e=a;if(i+t<e.length){for(;t--;)if((192&e[++i])!=128)return!1;return!0}return!1}var T,E=function(a){for(var i=[],t=a,e=0,n=a.length;e<n;)if(t[e]<128)i.push(String.fromCharCode(t[e])),++e;else{if(!(t[e]<192)){if(t[e]<224){if(g(t,e,1)&&(s=(31&t[e])<<6|63&t[e+1])>=128){i.push(String.fromCharCode(65535&s)),e+=2;continue}}else if(t[e]<240){if(g(t,e,2)&&(s=(15&t[e])<<12|(63&t[e+1])<<6|63&t[e+2])>=2048&&(63488&s)!=55296){i.push(String.fromCharCode(65535&s)),e+=3;continue}}else if(t[e]<248){var s;if(g(t,e,3)&&(s=(7&t[e])<<18|(63&t[e+1])<<12|(63&t[e+2])<<6|63&t[e+3])>65536&&s<1114112){s-=65536,i.push(String.fromCharCode(s>>>10|55296)),i.push(String.fromCharCode(1023&s|56320)),e+=4;continue}}}i.push("�"),++e}return i.join("")},L=B(3),O=(T=new ArrayBuffer(2),new DataView(T).setInt16(0,256,!0),new Int16Array(T)[0]===256),M=function(){function a(){}return a.parseScriptData=function(i,t,e){var n={};try{var s=a.parseValue(i,t,e),r=a.parseValue(i,t+s.size,e-s.size);n[s.data]=r.data}catch(o){p.a.e("AMF",o.toString())}return n},a.parseObject=function(i,t,e){if(e<3)throw new L.a("Data not enough when parse ScriptDataObject");var n=a.parseString(i,t,e),s=a.parseValue(i,t+n.size,e-n.size),r=s.objectEnd;return{data:{name:n.data,value:s.data},size:n.size+s.size,objectEnd:r}},a.parseVariable=function(i,t,e){return a.parseObject(i,t,e)},a.parseString=function(i,t,e){if(e<2)throw new L.a("Data not enough when parse String");var n=new DataView(i,t,e).getUint16(0,!O);return{data:n>0?E(new Uint8Array(i,t+2,n)):"",size:2+n}},a.parseLongString=function(i,t,e){if(e<4)throw new L.a("Data not enough when parse LongString");var n=new DataView(i,t,e).getUint32(0,!O);return{data:n>0?E(new Uint8Array(i,t+4,n)):"",size:4+n}},a.parseDate=function(i,t,e){if(e<10)throw new L.a("Data size invalid when parse Date");var n=new DataView(i,t,e),s=n.getFloat64(0,!O),r=n.getInt16(8,!O);return{data:new Date(s+=60*r*1e3),size:10}},a.parseValue=function(i,t,e){if(e<1)throw new L.a("Data not enough when parse Value");var n,s=new DataView(i,t,e),r=1,o=s.getUint8(0),h=!1;try{switch(o){case 0:n=s.getFloat64(1,!O),r+=8;break;case 1:n=!!s.getUint8(1),r+=1;break;case 2:var l=a.parseString(i,t+1,e-1);n=l.data,r+=l.size;break;case 3:n={};var m=0;for((16777215&s.getUint32(e-4,!O))==9&&(m=3);r<e-4;){var A=a.parseObject(i,t+r,e-r-m);if(A.objectEnd)break;n[A.data.name]=A.data.value,r+=A.size}r<=e-3&&(16777215&s.getUint32(r-1,!O))===9&&(r+=3);break;case 8:for(n={},r+=4,m=0,(16777215&s.getUint32(e-4,!O))==9&&(m=3);r<e-8;){var y=a.parseVariable(i,t+r,e-r-m);if(y.objectEnd)break;n[y.data.name]=y.data.value,r+=y.size}r<=e-3&&(16777215&s.getUint32(r-1,!O))===9&&(r+=3);break;case 9:n=void 0,r=1,h=!0;break;case 10:n=[];var R=s.getUint32(1,!O);r+=4;for(var I=0;I<R;I++){var H=a.parseValue(i,t+r,e-r);n.push(H.data),r+=H.size}break;case 11:var x=a.parseDate(i,t+1,e-1);n=x.data,r+=x.size;break;case 12:var ee=a.parseString(i,t+1,e-1);n=ee.data,r+=ee.size;break;default:r=e,p.a.w("AMF","Unsupported AMF value type "+o)}}catch(Z){p.a.e("AMF",Z.toString())}return{data:n,size:r,objectEnd:h}},a}(),U=function(){function a(i){this.TAG="ExpGolomb",this._buffer=i,this._buffer_index=0,this._total_bytes=i.byteLength,this._total_bits=8*i.byteLength,this._current_word=0,this._current_word_bits_left=0}return a.prototype.destroy=function(){this._buffer=null},a.prototype._fillCurrentWord=function(){var i=this._total_bytes-this._buffer_index;if(i<=0)throw new L.a("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,i),e=new Uint8Array(4);e.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(e.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t},a.prototype.readBits=function(i){if(i>32)throw new L.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(i<=this._current_word_bits_left){var t=this._current_word>>>32-i;return this._current_word<<=i,this._current_word_bits_left-=i,t}var e=this._current_word_bits_left?this._current_word:0;e>>>=32-this._current_word_bits_left;var n=i-this._current_word_bits_left;this._fillCurrentWord();var s=Math.min(n,this._current_word_bits_left),r=this._current_word>>>32-s;return this._current_word<<=s,this._current_word_bits_left-=s,e=e<<s|r},a.prototype.readBool=function(){return this.readBits(1)===1},a.prototype.readByte=function(){return this.readBits(8)},a.prototype._skipLeadingZero=function(){var i;for(i=0;i<this._current_word_bits_left;i++)if(this._current_word&2147483648>>>i)return this._current_word<<=i,this._current_word_bits_left-=i,i;return this._fillCurrentWord(),i+this._skipLeadingZero()},a.prototype.readUEG=function(){var i=this._skipLeadingZero();return this.readBits(i+1)-1},a.prototype.readSEG=function(){var i=this.readUEG();return 1&i?i+1>>>1:-1*(i>>>1)},a}(),N=function(){function a(){}return a._ebsp2rbsp=function(i){for(var t=i,e=t.byteLength,n=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&t[r]===3&&t[r-1]===0&&t[r-2]===0||(n[s]=t[r],s++);return new Uint8Array(n.buffer,0,s)},a.parseSPS=function(i){for(var t=i.subarray(1,4),e="avc1.",n=0;n<3;n++){var s=t[n].toString(16);s.length<2&&(s="0"+s),e+=s}var r=a._ebsp2rbsp(i),o=new U(r);o.readByte();var h=o.readByte();o.readByte();var l=o.readByte();o.readUEG();var m=a.getProfileString(h),A=a.getLevelString(l),y=1,R=420,I=8,H=8;if((h===100||h===110||h===122||h===244||h===44||h===83||h===86||h===118||h===128||h===138||h===144)&&((y=o.readUEG())===3&&o.readBits(1),y<=3&&(R=[0,420,422,444][y]),I=o.readUEG()+8,H=o.readUEG()+8,o.readBits(1),o.readBool()))for(var x=y!==3?8:12,ee=0;ee<x;ee++)o.readBool()&&(ee<6?a._skipScalingList(o,16):a._skipScalingList(o,64));o.readUEG();var Z=o.readUEG();if(Z===0)o.readUEG();else if(Z===1){o.readBits(1),o.readSEG(),o.readSEG();var Y=o.readUEG();for(ee=0;ee<Y;ee++)o.readSEG()}var re=o.readUEG();o.readBits(1);var fe=o.readUEG(),$=o.readUEG(),ae=o.readBits(1);ae===0&&o.readBits(1),o.readBits(1);var pe=0,se=0,ce=0,Se=0;o.readBool()&&(pe=o.readUEG(),se=o.readUEG(),ce=o.readUEG(),Se=o.readUEG());var Ae=1,he=1,me=0,Re=!0,Le=0,xe=0;if(o.readBool()){if(o.readBool()){var De=o.readByte();De>0&&De<16?(Ae=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][De-1],he=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][De-1]):De===255&&(Ae=o.readByte()<<8|o.readByte(),he=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var Pe=o.readBits(32),Be=o.readBits(32);Re=o.readBool(),me=(Le=Be)/(xe=2*Pe)}}var Oe=1;Ae===1&&he===1||(Oe=Ae/he);var Ie=0,be=0;y===0?(Ie=1,be=2-ae):(Ie=y===3?1:2,be=(y===1?2:1)*(2-ae));var Ve=16*(fe+1),Fe=16*($+1)*(2-ae);Ve-=(pe+se)*Ie,Fe-=(ce+Se)*be;var Ye=Math.ceil(Ve*Oe);return o.destroy(),o=null,{codec_mimetype:e,profile_idc:h,level_idc:l,profile_string:m,level_string:A,chroma_format_idc:y,bit_depth:I,bit_depth_luma:I,bit_depth_chroma:H,ref_frames:re,chroma_format:R,chroma_format_string:a.getChromaFormatString(R),frame_rate:{fixed:Re,fps:me,fps_den:xe,fps_num:Le},sar_ratio:{width:Ae,height:he},codec_size:{width:Ve,height:Fe},present_size:{width:Ye,height:Fe}}},a._skipScalingList=function(i,t){for(var e=8,n=8,s=0;s<t;s++)n!==0&&(n=(e+i.readSEG()+256)%256),e=n===0?e:n},a.getProfileString=function(i){switch(i){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},a.getLevelString=function(i){return(i/10).toFixed(1)},a.getChromaFormatString=function(i){switch(i){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},a}(),P=B(6),X=function(){function a(){}return a._ebsp2rbsp=function(i){for(var t=i,e=t.byteLength,n=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&t[r]===3&&t[r-1]===0&&t[r-2]===0||(n[s]=t[r],s++);return new Uint8Array(n.buffer,0,s)},a.parseVPS=function(i){var t=a._ebsp2rbsp(i),e=new U(t);return e.readByte(),e.readByte(),e.readBits(4),e.readBits(2),e.readBits(6),{num_temporal_layers:e.readBits(3)+1,temporal_id_nested:e.readBool()}},a.parseSPS=function(i){var t=a._ebsp2rbsp(i),e=new U(t);e.readByte(),e.readByte();for(var n=0,s=0,r=0,o=0,h=(e.readBits(4),e.readBits(3)),l=(e.readBool(),e.readBits(2)),m=e.readBool(),A=e.readBits(5),y=e.readByte(),R=e.readByte(),I=e.readByte(),H=e.readByte(),x=e.readByte(),ee=e.readByte(),Z=e.readByte(),Y=e.readByte(),re=e.readByte(),fe=e.readByte(),$=e.readByte(),ae=[],pe=[],se=0;se<h;se++)ae.push(e.readBool()),pe.push(e.readBool());if(h>0)for(se=h;se<8;se++)e.readBits(2);for(se=0;se<h;se++)ae[se]&&(e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte()),pe[se]&&e.readByte();e.readUEG();var ce=e.readUEG();ce==3&&e.readBits(1);var Se=e.readUEG(),Ae=e.readUEG();e.readBool()&&(n+=e.readUEG(),s+=e.readUEG(),r+=e.readUEG(),o+=e.readUEG());var he=e.readUEG(),me=e.readUEG(),Re=e.readUEG();for(se=e.readBool()?0:h;se<=h;se++)e.readUEG(),e.readUEG(),e.readUEG();if(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readBool()&&e.readBool())for(var Le=0;Le<4;Le++)for(var xe=0;xe<(Le===3?2:6);xe++)if(e.readBool()){var De=Math.min(64,1<<4+(Le<<1));for(Le>1&&e.readSEG(),se=0;se<De;se++)e.readSEG()}else e.readUEG();e.readBool(),e.readBool(),e.readBool()&&(e.readByte(),e.readUEG(),e.readUEG(),e.readBool());var Pe=e.readUEG(),Be=0;for(se=0;se<Pe;se++){var Oe=!1;if(se!==0&&(Oe=e.readBool()),Oe){se===Pe&&e.readUEG(),e.readBool(),e.readUEG();for(var Ie=0,be=0;be<=Be;be++){var Ve=e.readBool(),Fe=!1;Ve||(Fe=e.readBool()),(Ve||Fe)&&Ie++}Be=Ie}else{var Ye=e.readUEG(),_t=e.readUEG();for(Be=Ye+_t,be=0;be<Ye;be++)e.readUEG(),e.readBool();for(be=0;be<_t;be++)e.readUEG(),e.readBool()}}if(e.readBool()){var Wt=e.readUEG();for(se=0;se<Wt;se++){for(be=0;be<Re+4;be++)e.readBits(1);e.readBits(1)}}var ut=0,He=1,qe=1,lt=!1,Ze=1,$e=1;if(e.readBool(),e.readBool(),e.readBool()){if(e.readBool()){var Ke=e.readByte();Ke>0&&Ke<=16?(He=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Ke-1],qe=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Ke-1]):Ke===255&&(He=e.readBits(16),qe=e.readBits(16))}if(e.readBool()&&e.readBool(),e.readBool()&&(e.readBits(3),e.readBool(),e.readBool()&&(e.readByte(),e.readByte(),e.readByte())),e.readBool()&&(e.readUEG(),e.readUEG()),e.readBool(),e.readBool(),e.readBool(),e.readBool()&&(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG()),e.readBool()&&(Ze=e.readBits(32),$e=e.readBits(32),e.readBool()&&e.readUEG(),e.readBool())){var et=!1,tt=!1,Xe=!1;for(et=e.readBool(),tt=e.readBool(),(et||tt)&&((Xe=e.readBool())&&(e.readByte(),e.readBits(5),e.readBool(),e.readBits(5)),e.readBits(4),e.readBits(4),Xe&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5)),se=0;se<=h;se++){var ct=e.readBool();lt=ct;var ht=!0,it=1;ct||(ht=e.readBool());var ft=!1;if(ht?e.readUEG():ft=e.readBool(),ft||(it=e.readUEG()+1),et){for(be=0;be<it;be++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG());e.readBool()}if(tt){for(be=0;be<it;be++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG());e.readBool()}}}e.readBool()&&(e.readBool(),e.readBool(),e.readBool(),ut=e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG())}e.readBool();var Yt="hvc1.".concat(A,".1.L").concat($,".B0"),pt=Se-(n+s)*(ce===1||ce===2?2:1),mt=Ae-(r+o)*(ce===1?2:1),gt=1;return He!==1&&qe!==1&&(gt=He/qe),e.destroy(),e=null,{codec_mimetype:Yt,profile_string:a.getProfileString(A),level_string:a.getLevelString($),profile_idc:A,bit_depth:he+8,ref_frames:1,chroma_format:ce,chroma_format_string:a.getChromaFormatString(ce),general_level_idc:$,general_profile_space:l,general_tier_flag:m,general_profile_idc:A,general_profile_compatibility_flags_1:y,general_profile_compatibility_flags_2:R,general_profile_compatibility_flags_3:I,general_profile_compatibility_flags_4:H,general_constraint_indicator_flags_1:x,general_constraint_indicator_flags_2:ee,general_constraint_indicator_flags_3:Z,general_constraint_indicator_flags_4:Y,general_constraint_indicator_flags_5:re,general_constraint_indicator_flags_6:fe,min_spatial_segmentation_idc:ut,constant_frame_rate:0,chroma_format_idc:ce,bit_depth_luma_minus8:he,bit_depth_chroma_minus8:me,frame_rate:{fixed:lt,fps:$e/Ze,fps_den:Ze,fps_num:$e},sar_ratio:{width:He,height:qe},codec_size:{width:pt,height:mt},present_size:{width:pt*gt,height:mt}}},a.parsePPS=function(i){var t=a._ebsp2rbsp(i),e=new U(t);e.readByte(),e.readByte(),e.readUEG(),e.readUEG(),e.readBool(),e.readBool(),e.readBits(3),e.readBool(),e.readBool(),e.readUEG(),e.readUEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool()&&e.readUEG(),e.readSEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool(),e.readBool();var n=e.readBool(),s=e.readBool(),r=1;return s&&n?r=0:s?r=3:n&&(r=2),{parallelismType:r}},a.getChromaFormatString=function(i){switch(i){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},a.getProfileString=function(i){switch(i){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},a.getLevelString=function(i){return(i/30).toFixed(1)},a}();function k(a){return a.byteOffset%2==0&&a.byteLength%2==0}function q(a){return a.byteOffset%4==0&&a.byteLength%4==0}function Q(a,i){for(var t=0;t<a.length;t++)if(a[t]!==i[t])return!1;return!0}var D=function(a,i){return a.byteLength===i.byteLength&&(q(a)&&q(i)?function(t,e){return Q(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4))}(a,i):k(a)&&k(i)?function(t,e){return Q(new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2))}(a,i):function(t,e){return Q(t,e)}(a,i))},c=function(){return(c=Object.assign||function(a){for(var i,t=1,e=arguments.length;t<e;t++)for(var n in i=arguments[t])Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=i[n]);return a}).apply(this,arguments)},_=function(){function a(){}return a.parseOBUs=function(i,t){for(var e=0;e<i.byteLength;){var n=e,s=(i[e],(120&i[e])>>3),r=(4&i[e])!=0,o=(2&i[e])!=0;i[e],e+=1,r&&(e+=1);var h=Number.POSITIVE_INFINITY;if(o){h=0;for(var l=0;;l++){var m=i[e++];if(h|=(127&m)<<7*l,(128&m)==0)break}}console.log(s),s===1?t=c(c({},a.parseSeuqneceHeader(i.subarray(e,e+h))),{sequence_header_data:i.subarray(n,e+h)}):(s==3&&t||s==6&&t)&&(t=a.parseOBUFrameHeader(i.subarray(e,e+h),0,0,t)),e+=h}return t},a.parseSeuqneceHeader=function(i){var t=new U(i),e=t.readBits(3),n=(t.readBool(),t.readBool()),s=!0,r=0,o=1,h=void 0,l=[];if(n)l.push({operating_point_idc:0,level:t.readBits(5),tier:0});else{if(t.readBool()){var m=t.readBits(32),A=t.readBits(32),y=t.readBool();if(y){for(var R=0;t.readBits(1)===0;)R+=1;R>=32||(1<<R)-1+t.readBits(R)}(r=A)/(o=m),s=y,t.readBool()&&(t.readBits(5),t.readBits(32),h=t.readBits(5),t.readBits(5))}for(var I=t.readBool(),H=t.readBits(5),x=0;x<=H;x++){var ee=t.readBits(12),Z=t.readBits(5),Y=Z>7?t.readBits(1):0;l.push({operating_point_idc:ee,level:Z,tier:Y}),I&&t.readBool()&&t.readBits(4)}}var re=l[0],fe=re.level,$=re.tier,ae=t.readBits(4),pe=t.readBits(4),se=t.readBits(ae+1)+1,ce=t.readBits(pe+1)+1,Se=!1;n||(Se=t.readBool()),Se&&(t.readBits(4),t.readBits(4)),t.readBool(),t.readBool(),t.readBool();var Ae=!1,he=2,me=2,Re=0;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),(Ae=t.readBool())&&(t.readBool(),t.readBool()),(he=t.readBool()?2:t.readBits(1))?me=t.readBool()?2:t.readBits(1):me=2,Ae?Re=t.readBits(3)+1:Re=0);var Le=t.readBool(),xe=(t.readBool(),t.readBool(),t.readBool()),De=8;e===2&&xe?De=t.readBool()?12:10:De=xe?10:8;var Pe=!1;e!==1&&(Pe=t.readBool()),t.readBool()&&(t.readBits(8),t.readBits(8),t.readBits(8));var Be=1,Oe=1;return Pe?(t.readBits(1),Be=1,Oe=1):(t.readBits(1),e==0?(Be=1,Oe=1):e==1?(Be=0,Oe=0):De==12?t.readBits(1)&&t.readBits(1):(Be=1,Oe=0),Be&&Oe&&t.readBits(2),t.readBits(1)),t.readBool(),t.destroy(),t=null,{codec_mimetype:"av01.".concat(e,".").concat(a.getLevelString(fe,$),".").concat(De.toString(10).padStart(2,"0")),level:fe,tier:$,level_string:a.getLevelString(fe,$),profile_idc:e,profile_string:"".concat(e),bit_depth:De,ref_frames:1,chroma_format:a.getChromaFormat(Pe,Be,Oe),chroma_format_string:a.getChromaFormatString(Pe,Be,Oe),sequence_header:{frame_id_numbers_present_flag:Se,additional_frame_id_length_minus_1:void 0,delta_frame_id_length_minus_2:void 0,reduced_still_picture_header:n,decoder_model_info_present_flag:!1,operating_points:l,buffer_removal_time_length_minus_1:h,equal_picture_interval:s,seq_force_screen_content_tools:he,seq_force_integer_mv:me,enable_order_hint:Ae,order_hint_bits:Re,enable_superres:Le,frame_width_bit:ae+1,frame_height_bit:pe+1,max_frame_width:se,max_frame_height:ce},keyframe:void 0,frame_rate:{fixed:s,fps:r/o,fps_den:o,fps_num:r}}},a.parseOBUFrameHeader=function(i,t,e,n){var s=n.sequence_header,r=new U(i),o=(s.max_frame_width,s.max_frame_height,0);s.frame_id_numbers_present_flag&&(o=s.additional_frame_id_length_minus_1+s.delta_frame_id_length_minus_2+3);var h=0,l=!0,m=!0,A=!1;if(!s.reduced_still_picture_header){if(r.readBool())return n;l=(h=r.readBits(2))===2||h===0,(m=r.readBool())&&s.decoder_model_info_present_flag&&s.equal_picture_interval,m&&r.readBool(),A=!!(h===3||h===0&&m)||r.readBool()}n.keyframe=l,r.readBool();var y=s.seq_force_screen_content_tools;s.seq_force_screen_content_tools===2&&(y=r.readBits(1)),y&&(s.seq_force_integer_mv,s.seq_force_integer_mv==2&&r.readBits(1)),s.frame_id_numbers_present_flag&&r.readBits(o);var R=!1;if(R=h==3||!s.reduced_still_picture_header&&r.readBool(),r.readBits(s.order_hint_bits),l||A||r.readBits(3),s.decoder_model_info_present_flag&&r.readBool()){for(var I=0;I<=s.operating_points_cnt_minus_1;I++)if(s.operating_points[I].decoder_model_present_for_this_op[I]){var H=s.operating_points[I].operating_point_idc;(H===0||H>>t&1&&H>>e+8&1)&&r.readBits(s.buffer_removal_time_length_minus_1+1)}}var x=255;if(h===3||h==0&&m||(x=r.readBits(8)),(l||x!==255)&&A&&s.enable_order_hint)for(var ee=0;ee<8;ee++)r.readBits(s.order_hint_bits);if(l){var Z=a.frameSizeAndRenderSize(r,R,s);n.codec_size={width:Z.FrameWidth,height:Z.FrameHeight},n.present_size={width:Z.RenderWidth,height:Z.RenderHeight},n.sar_ratio={width:Z.RenderWidth/Z.FrameWidth,height:Z.RenderHeight/Z.FrameHeight}}return r.destroy(),r=null,n},a.frameSizeAndRenderSize=function(i,t,e){var n=e.max_frame_width,s=e.max_frame_height;t&&(n=i.readBits(e.frame_width_bit)+1,s=i.readBits(e.frame_height_bit)+1);var r=!1;e.enable_superres&&(r=i.readBool());var o=8;r&&(o=i.readBits(3)+9);var h=n;n=Math.floor((8*h+o/2)/o);var l=h,m=s;if(i.readBool()){var A=i.readBits(16)+1,y=i.readBits(16)+1;l=i.readBits(A)+1,m=i.readBits(y)+1}return{UpscaledWidth:h,FrameWidth:n,FrameHeight:s,RenderWidth:l,RenderHeight:m}},a.getLevelString=function(i,t){return"".concat(i.toString(10).padStart(2,"0")).concat(t===0?"M":"H")},a.getChromaFormat=function(i,t,e){return i?0:t===0&&e===0?3:t===1&&e===0?2:t===1&&e===1?1:Number.NaN},a.getChromaFormatString=function(i,t,e){return i?"4:0:0":t===0&&e===0?"4:4:4":t===1&&e===0?"4:2:2":t===1&&e===1?"4:2:0":"Unknown"},a}(),d,f=function(){function a(i,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=i.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=i.hasAudioTrack,this._hasVideo=i.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new S.a,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256}()}return a.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},a.probe=function(i){var t=new Uint8Array(i);if(t.byteLength<9)return{needMoreData:!0};var e={match:!1};if(t[0]!==70||t[1]!==76||t[2]!==86||t[3]!==1)return e;var n,s,r=(4&t[4])>>>2!=0,o=(1&t[4])!=0,h=(n=t)[s=5]<<24|n[s+1]<<16|n[s+2]<<8|n[s+3];return h<9?e:{match:!0,consumed:h,dataOffset:h,hasAudioTrack:r,hasVideoTrack:o}},a.prototype.bindDataSource=function(i){return i.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(a.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(i){this._onTrackMetadata=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(i){this._onMediaInfo=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(i){this._onMetaDataArrived=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(i){this._onScriptDataArrived=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onError",{get:function(){return this._onError},set:function(i){this._onError=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(i){this._onDataAvailable=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(i){this._timestampBase=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"overridedDuration",{get:function(){return this._duration},set:function(i){this._durationOverrided=!0,this._duration=i,this._mediaInfo.duration=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"overridedHasAudio",{set:function(i){this._hasAudioFlagOverrided=!0,this._hasAudio=i,this._mediaInfo.hasAudio=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"overridedHasVideo",{set:function(i){this._hasVideoFlagOverrided=!0,this._hasVideo=i,this._mediaInfo.hasVideo=i},enumerable:!1,configurable:!0}),a.prototype.resetMediaInfo=function(){this._mediaInfo=new S.a},a.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},a.prototype.parseChunks=function(i,t){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new L.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var e=0,n=this._littleEndian;if(t===0){if(!(i.byteLength>13))return 0;e=a.probe(i).dataOffset}for(this._firstParse&&(this._firstParse=!1,t+e!==this._dataOffset&&p.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(s=new DataView(i,e)).getUint32(0,!n)!==0&&p.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),e+=4);e<i.byteLength;){this._dispatch=!0;var s=new DataView(i,e);if(e+11+4>i.byteLength)break;var r=s.getUint8(0),o=16777215&s.getUint32(0,!n);if(e+11+o+4>i.byteLength)break;if(r===8||r===9||r===18){var h=s.getUint8(4),l=s.getUint8(5),m=s.getUint8(6)|l<<8|h<<16|s.getUint8(7)<<24;16777215&s.getUint32(7,!n)&&p.a.w(this.TAG,"Meet tag which has StreamID != 0!");var A=e+11;switch(r){case 8:this._parseAudioData(i,A,o,m);break;case 9:this._parseVideoData(i,A,o,m,t+e);break;case 18:this._parseScriptData(i,A,o)}var y=s.getUint32(11+o,!n);y!==11+o&&p.a.w(this.TAG,"Invalid PrevTagSize ".concat(y)),e+=11+o+4}else p.a.w(this.TAG,"Unsupported tag type ".concat(r,", skipped")),e+=11+o+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),e},a.prototype._parseScriptData=function(i,t,e){var n=M.parseScriptData(i,t,e);if(n.hasOwnProperty("onMetaData")){if(n.onMetaData==null||typeof n.onMetaData!="object")return void p.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&p.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var s=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),typeof s.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=s.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof s.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=s.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof s.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=s.audiodatarate),typeof s.videodatarate=="number"&&(this._mediaInfo.videoDataRate=s.videodatarate),typeof s.width=="number"&&(this._mediaInfo.width=s.width),typeof s.height=="number"&&(this._mediaInfo.height=s.height),typeof s.duration=="number"){if(!this._durationOverrided){var r=Math.floor(s.duration*this._timescale);this._duration=r,this._mediaInfo.duration=r}}else this._mediaInfo.duration=0;if(typeof s.framerate=="number"){var o=Math.floor(1e3*s.framerate);if(o>0){var h=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=h,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=h}}if(typeof s.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var l=s.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(l),s.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=s,p.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},a.prototype._parseKeyframesIndex=function(i){for(var t=[],e=[],n=1;n<i.times.length;n++){var s=this._timestampBase+Math.floor(1e3*i.times[n]);t.push(s),e.push(i.filepositions[n])}return{times:t,filepositions:e}},a.prototype._parseAudioData=function(i,t,e,n){if(e<=1)p.a.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(this._hasAudioFlagOverrided!==!0||this._hasAudio!==!1){this._littleEndian;var s=new DataView(i,t,e).getUint8(0),r=s>>>4;if(r!==9)if(r===2||r===10){var o=0,h=(12&s)>>>2;if(h>=0&&h<=4){o=this._flvSoundRateTable[h];var l=1&s,m=this._audioMetadata,A=this._audioTrack;if(m||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(m=this._audioMetadata={}).type="audio",m.id=A.id,m.timescale=this._timescale,m.duration=this._duration,m.audioSampleRate=o,m.channelCount=l===0?1:2),r===10){var y=this._parseAACAudioData(i,t+1,e-1);if(y==null)return;if(y.packetType===0){if(m.config){if(D(y.data.config,m.config))return;p.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var R=y.data;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.config=R.config,m.refSampleDuration=1024/m.audioSampleRate*m.timescale,p.a.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",m),(x=this._mediaInfo).audioCodec=m.originalCodec,x.audioSampleRate=m.audioSampleRate,x.audioChannelCount=m.channelCount,x.hasVideo?x.videoCodec!=null&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.audioCodec+'"',x.isComplete()&&this._onMediaInfo(x)}else if(y.packetType===1){var I=this._timestampBase+n,H={unit:y.data,length:y.data.byteLength,dts:I,pts:I};A.samples.push(H),A.length+=y.data.length}else p.a.e(this.TAG,"Flv: Unsupported AAC data type ".concat(y.packetType))}else if(r===2){if(!m.codec){var x;if((R=this._parseMP3AudioData(i,t+1,e-1,!0))==null)return;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.refSampleDuration=1152/m.audioSampleRate*m.timescale,p.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",m),(x=this._mediaInfo).audioCodec=m.codec,x.audioSampleRate=m.audioSampleRate,x.audioChannelCount=m.channelCount,x.audioDataRate=R.bitRate,x.hasVideo?x.videoCodec!=null&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.audioCodec+'"',x.isComplete()&&this._onMediaInfo(x)}var ee=this._parseMP3AudioData(i,t+1,e-1,!1);if(ee==null)return;I=this._timestampBase+n;var Z={unit:ee,length:ee.byteLength,dts:I,pts:I};A.samples.push(Z),A.length+=ee.length}}else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+h)}else this._onError(P.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+r);else{if(e<=5)return void p.a.w(this.TAG,"Flv: Invalid audio packet, missing AudioFourCC in Ehnanced FLV payload!");var Y=15&s,re=String.fromCharCode.apply(String,new Uint8Array(i,t,e).slice(1,5));switch(re){case"Opus":this._parseOpusAudioPacket(i,t+5,e-5,n,Y);break;case"fLaC":this._parseFlacAudioPacket(i,t+5,e-5,n,Y);break;default:this._onError(P.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec: "+re)}}}},a.prototype._parseAACAudioData=function(i,t,e){if(!(e<=1)){var n={},s=new Uint8Array(i,t,e);return n.packetType=s[0],s[0]===0?n.data=this._parseAACAudioSpecificConfig(i,t+1,e-1):n.data=s.subarray(1),n}p.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},a.prototype._parseAACAudioSpecificConfig=function(i,t,e){var n,s,r=new Uint8Array(i,t,e),o=null,h=0,l=null;if(h=n=r[0]>>>3,(s=(7&r[0])<<1|r[1]>>>7)<0||s>=this._mpegSamplingRates.length)this._onError(P.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var m=this._mpegSamplingRates[s],A=(120&r[1])>>>3;if(!(A<0||A>=8)){h===5&&(l=(7&r[1])<<1|r[2]>>>7,(124&r[2])>>>2);var y=self.navigator.userAgent.toLowerCase();return y.indexOf("firefox")!==-1?s>=6?(h=5,o=new Array(4),l=s-3):(h=2,o=new Array(2),l=s):y.indexOf("android")!==-1?(h=2,o=new Array(2),l=s):(h=5,l=s,o=new Array(4),s>=6?l=s-3:A===1&&(h=2,o=new Array(2),l=s)),o[0]=h<<3,o[0]|=(15&s)>>>1,o[1]=(15&s)<<7,o[1]|=(15&A)<<3,h===5&&(o[1]|=(15&l)>>>1,o[2]=(1&l)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:m,channelCount:A,codec:"mp4a.40."+h,originalCodec:"mp4a.40."+n}}this._onError(P.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},a.prototype._parseMP3AudioData=function(i,t,e,n){if(!(e<4)){this._littleEndian;var s=new Uint8Array(i,t,e),r=null;if(n){if(s[0]!==255)return;var o=s[1]>>>3&3,h=(6&s[1])>>1,l=(240&s[2])>>>4,m=(12&s[2])>>>2,A=(s[3]>>>6&3)!==3?2:1,y=0,R=0;switch(o){case 0:y=this._mpegAudioV25SampleRateTable[m];break;case 2:y=this._mpegAudioV20SampleRateTable[m];break;case 3:y=this._mpegAudioV10SampleRateTable[m]}switch(h){case 1:l<this._mpegAudioL3BitRateTable.length&&(R=this._mpegAudioL3BitRateTable[l]);break;case 2:l<this._mpegAudioL2BitRateTable.length&&(R=this._mpegAudioL2BitRateTable[l]);break;case 3:l<this._mpegAudioL1BitRateTable.length&&(R=this._mpegAudioL1BitRateTable[l])}r={bitRate:R,samplingRate:y,channelCount:A,codec:"mp3",originalCodec:"mp3"}}else r=s;return r}p.a.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},a.prototype._parseOpusAudioPacket=function(i,t,e,n,s){if(s===0)this._parseOpusSequenceHeader(i,t,e);else if(s===1)this._parseOpusAudioData(i,t,e,n);else if(s!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(s))},a.prototype._parseOpusSequenceHeader=function(i,t,e){if(e<=16)p.a.w(this.TAG,"Flv: Invalid OpusSequenceHeader, lack of data!");else{var n=this._audioMetadata,s=this._audioTrack;n||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration);var r=new DataView(i,t,e);r.setUint8(8,0);var o=r.getUint8(9);r.setUint16(10,r.getUint16(10,!0),!1);var h=r.getUint32(12,!0);r.setUint32(12,r.getUint32(12,!0),!1);var l={config:new Uint8Array(i,t+8,e-8),channelCount:o,samplingFrequence:h,codec:"opus",originalCodec:"opus"};if(n.config){if(D(l.config,n.config))return;p.a.w(this.TAG,"OpusSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=l.samplingFrequence,n.channelCount=l.channelCount,n.codec=l.codec,n.originalCodec=l.originalCodec,n.config=l.config,n.refSampleDuration=20,p.a.v(this.TAG,"Parsed OpusSequenceHeader"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",n);var m=this._mediaInfo;m.audioCodec=n.originalCodec,m.audioSampleRate=n.audioSampleRate,m.audioChannelCount=n.channelCount,m.hasVideo?m.videoCodec!=null&&(m.mimeType='video/x-flv; codecs="'+m.videoCodec+","+m.audioCodec+'"'):m.mimeType='video/x-flv; codecs="'+m.audioCodec+'"',m.isComplete()&&this._onMediaInfo(m)}},a.prototype._parseOpusAudioData=function(i,t,e,n){var s=this._audioTrack,r=new Uint8Array(i,t,e),o=this._timestampBase+n,h={unit:r,length:r.byteLength,dts:o,pts:o};s.samples.push(h),s.length+=r.length},a.prototype._parseFlacAudioPacket=function(i,t,e,n,s){if(s===0)this._parseFlacSequenceHeader(i,t,e);else if(s===1)this._parseFlacAudioData(i,t,e,n);else if(s!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid Flac audio packet type ".concat(s))},a.prototype._parseFlacSequenceHeader=function(i,t,e){var n=this._audioMetadata,s=this._audioTrack;n||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration);var r=new Uint8Array(i,t+4,e-4),o=new U(r),h=o.readBits(16),l=o.readBits(16),m=l===h?l:null;o.readBits(24),o.readBits(24);var A=o.readBits(20),y=o.readBits(3)+1,R=o.readBits(5)+1;o.destroy();var I=new Uint8Array(r.byteLength+4);I.set(r,4),I[0]=128,I[1]=r.byteLength>>>16&255,I[2]=r.byteLength>>>8&255,I[3]=r.byteLength>>>0&255;var H={config:I,channelCount:y,samplingFrequence:A,sampleSize:R,codec:"flac",originalCodec:"flac"};if(n.config){if(D(H.config,n.config))return;p.a.w(this.TAG,"FlacSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=H.samplingFrequence,n.channelCount=H.channelCount,n.sampleSize=H.sampleSize,n.codec=H.codec,n.originalCodec=H.originalCodec,n.config=H.config,n.refSampleDuration=m!=null?1e3*m/H.samplingFrequence:null,p.a.v(this.TAG,"Parsed FlacSequenceHeader"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",n);var x=this._mediaInfo;x.audioCodec=n.originalCodec,x.audioSampleRate=n.audioSampleRate,x.audioChannelCount=n.channelCount,x.hasVideo?x.videoCodec!=null&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.audioCodec+'"',x.isComplete()&&this._onMediaInfo(x)},a.prototype._parseFlacAudioData=function(i,t,e,n){var s=this._audioTrack,r=new Uint8Array(i,t,e),o=this._timestampBase+n,h={unit:r,length:r.byteLength,dts:o,pts:o};s.samples.push(h),s.length+=r.length},a.prototype._parseVideoData=function(i,t,e,n,s){if(e<=1)p.a.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(this._hasVideoFlagOverrided!==!0||this._hasVideo!==!1){var r=new Uint8Array(i,t,e)[0],o=(112&r)>>>4;if(128&r){var h=15&r,l=String.fromCharCode.apply(String,new Uint8Array(i,t,e).slice(1,5));if(l==="hvc1")this._parseEnhancedHEVCVideoPacket(i,t+5,e-5,n,s,o,h);else{if(l!=="av01")return void this._onError(P.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(l));this._parseEnhancedAV1VideoPacket(i,t+5,e-5,n,s,o,h)}}else{var m=15&r;if(m===7)this._parseAVCVideoPacket(i,t+1,e-1,n,s,o);else{if(m!==12)return void this._onError(P.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(m));this._parseHEVCVideoPacket(i,t+1,e-1,n,s,o)}}}},a.prototype._parseAVCVideoPacket=function(i,t,e,n,s,r){if(e<4)p.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var o=this._littleEndian,h=new DataView(i,t,e),l=h.getUint8(0),m=(16777215&h.getUint32(0,!o))<<8>>8;if(l===0)this._parseAVCDecoderConfigurationRecord(i,t+4,e-4);else if(l===1)this._parseAVCVideoData(i,t+4,e-4,n,s,r,m);else if(l!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}},a.prototype._parseHEVCVideoPacket=function(i,t,e,n,s,r){if(e<4)p.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var o=this._littleEndian,h=new DataView(i,t,e),l=h.getUint8(0),m=(16777215&h.getUint32(0,!o))<<8>>8;if(l===0)this._parseHEVCDecoderConfigurationRecord(i,t+4,e-4);else if(l===1)this._parseHEVCVideoData(i,t+4,e-4,n,s,r,m);else if(l!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}},a.prototype._parseEnhancedHEVCVideoPacket=function(i,t,e,n,s,r,o){var h=this._littleEndian,l=new DataView(i,t,e);if(o===0)this._parseHEVCDecoderConfigurationRecord(i,t,e);else if(o===1){var m=(4294967040&l.getUint32(0,!h))>>8;this._parseHEVCVideoData(i,t+3,e-3,n,s,r,m)}else if(o===3)this._parseHEVCVideoData(i,t,e,n,s,r,0);else if(o!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},a.prototype._parseEnhancedAV1VideoPacket=function(i,t,e,n,s,r,o){if(this._littleEndian,o===0)this._parseAV1CodecConfigurationRecord(i,t,e);else if(o===1)this._parseAV1VideoData(i,t,e,n,s,r,0);else{if(o===5)return void this._onError(P.a.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(o));if(o!==2)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))}},a.prototype._parseAVCDecoderConfigurationRecord=function(i,t,e){if(e<7)p.a.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,s=this._videoTrack,r=this._littleEndian,o=new DataView(i,t,e);if(n){if(n.avcc!==void 0){var h=new Uint8Array(i,t,e);if(D(h,n.avcc))return;p.a.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration;var l=o.getUint8(0),m=o.getUint8(1);if(o.getUint8(2),o.getUint8(3),l===1&&m!==0)if(this._naluLengthSize=1+(3&o.getUint8(4)),this._naluLengthSize===3||this._naluLengthSize===4){var A=31&o.getUint8(5);if(A!==0){A>1&&p.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(A));for(var y=6,R=0;R<A;R++){var I=o.getUint16(y,!r);if(y+=2,I!==0){var H=new Uint8Array(i,t+y,I);y+=I;var x=N.parseSPS(H);if(R===0){n.codecWidth=x.codec_size.width,n.codecHeight=x.codec_size.height,n.presentWidth=x.present_size.width,n.presentHeight=x.present_size.height,n.profile=x.profile_string,n.level=x.level_string,n.bitDepth=x.bit_depth,n.chromaFormat=x.chroma_format,n.sarRatio=x.sar_ratio,n.frameRate=x.frame_rate,x.frame_rate.fixed!==!1&&x.frame_rate.fps_num!==0&&x.frame_rate.fps_den!==0||(n.frameRate=this._referenceFrameRate);var ee=n.frameRate.fps_den,Z=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(ee/Z);for(var Y=H.subarray(1,4),re="avc1.",fe=0;fe<3;fe++){var $=Y[fe].toString(16);$.length<2&&($="0"+$),re+=$}n.codec=re;var ae=this._mediaInfo;ae.width=n.codecWidth,ae.height=n.codecHeight,ae.fps=n.frameRate.fps,ae.profile=n.profile,ae.level=n.level,ae.refFrames=x.ref_frames,ae.chromaFormat=x.chroma_format_string,ae.sarNum=n.sarRatio.width,ae.sarDen=n.sarRatio.height,ae.videoCodec=re,ae.hasAudio?ae.audioCodec!=null&&(ae.mimeType='video/x-flv; codecs="'+ae.videoCodec+","+ae.audioCodec+'"'):ae.mimeType='video/x-flv; codecs="'+ae.videoCodec+'"',ae.isComplete()&&this._onMediaInfo(ae)}}}var pe=o.getUint8(y);if(pe!==0){for(pe>1&&p.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(pe)),y++,R=0;R<pe;R++)I=o.getUint16(y,!r),y+=2,I!==0&&(y+=I);n.avcc=new Uint8Array(e),n.avcc.set(new Uint8Array(i,t,e),0),p.a.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(P.a.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},a.prototype._parseHEVCDecoderConfigurationRecord=function(i,t,e){if(e<22)p.a.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,s=this._videoTrack,r=this._littleEndian,o=new DataView(i,t,e);if(n){if(n.hvcc!==void 0){var h=new Uint8Array(i,t,e);if(D(h,n.hvcc))return;p.a.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration;var l=o.getUint8(0),m=31&o.getUint8(1);if(l!==0&&l!==1||m===0)this._onError(P.a.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord");else if(this._naluLengthSize=1+(3&o.getUint8(21)),this._naluLengthSize===3||this._naluLengthSize===4){for(var A=o.getUint8(22),y=0,R=23;y<A;y++){var I=63&o.getUint8(R+0),H=o.getUint16(R+1,!r);R+=3;for(var x=0;x<H;x++){var ee=o.getUint16(R+0,!r);if(x===0)if(I===33){R+=2;var Z=new Uint8Array(i,t+R,ee),Y=X.parseSPS(Z);n.codecWidth=Y.codec_size.width,n.codecHeight=Y.codec_size.height,n.presentWidth=Y.present_size.width,n.presentHeight=Y.present_size.height,n.profile=Y.profile_string,n.level=Y.level_string,n.bitDepth=Y.bit_depth,n.chromaFormat=Y.chroma_format,n.sarRatio=Y.sar_ratio,n.frameRate=Y.frame_rate,Y.frame_rate.fixed!==!1&&Y.frame_rate.fps_num!==0&&Y.frame_rate.fps_den!==0||(n.frameRate=this._referenceFrameRate);var re=n.frameRate.fps_den,fe=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(re/fe),n.codec=Y.codec_mimetype;var $=this._mediaInfo;$.width=n.codecWidth,$.height=n.codecHeight,$.fps=n.frameRate.fps,$.profile=n.profile,$.level=n.level,$.refFrames=Y.ref_frames,$.chromaFormat=Y.chroma_format_string,$.sarNum=n.sarRatio.width,$.sarDen=n.sarRatio.height,$.videoCodec=Y.codec_mimetype,$.hasAudio?$.audioCodec!=null&&($.mimeType='video/x-flv; codecs="'+$.videoCodec+","+$.audioCodec+'"'):$.mimeType='video/x-flv; codecs="'+$.videoCodec+'"',$.isComplete()&&this._onMediaInfo($),R+=ee}else R+=2+ee;else R+=2+ee}}n.hvcc=new Uint8Array(e),n.hvcc.set(new Uint8Array(i,t,e),0),p.a.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(P.a.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1))}},a.prototype._parseAV1CodecConfigurationRecord=function(i,t,e){if(e<4)p.a.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var n=this._videoMetadata,s=this._videoTrack,r=(this._littleEndian,new DataView(i,t,e));n?n.av1c!==void 0&&p.a.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration);var o=127&r.getUint8(0);if(r.getUint8(1),r.getUint8(1),r.getUint8(2),o===1){var h=_.parseOBUs(new Uint8Array(i,t+4,e-4));if(h!=null){n.profile=h.profile_string,n.level=h.level_string,n.bitDepth=h.bit_depth,n.chromaFormat=h.chroma_format,n.frameRate=h.frame_rate,h.frame_rate.fixed!==!1&&h.frame_rate.fps_num!==0&&h.frame_rate.fps_den!==0||(n.frameRate=this._referenceFrameRate);var l=n.frameRate.fps_den,m=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(l/m),n.codec=h.codec_mimetype,n.extra=h;var A=this._mediaInfo;A.fps=n.frameRate.fps,A.profile=n.profile,A.level=n.level,A.refFrames=h.ref_frames,A.chromaFormat=h.chroma_format_string,A.videoCodec=h.codec_mimetype,A.hasAudio?A.audioCodec!=null&&(A.mimeType='video/x-flv; codecs="'+A.videoCodec+","+A.audioCodec+'"'):A.mimeType='video/x-flv; codecs="'+A.videoCodec+'"',A.isComplete()&&this._onMediaInfo(A),n.av1c=new Uint8Array(e),n.av1c.set(new Uint8Array(i,t,e),0),p.a.v(this.TAG,"Preparing AV1CodecConfigurationRecord")}else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},a.prototype._parseAVCVideoData=function(i,t,e,n,s,r,o){for(var h=this._littleEndian,l=new DataView(i,t,e),m=[],A=0,y=0,R=this._naluLengthSize,I=this._timestampBase+n,H=r===1;y<e;){if(y+4>=e){p.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(I,", offset = ").concat(y,", dataSize = ").concat(e));break}var x=l.getUint32(y,!h);if(R===3&&(x>>>=8),x>e-R)return void p.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(I,", NaluSize > DataSize!"));var ee=31&l.getUint8(y+R);ee===5&&(H=!0);var Z=new Uint8Array(i,t+y,R+x),Y={type:ee,data:Z};m.push(Y),A+=Z.byteLength,y+=R+x}if(m.length){var re=this._videoTrack,fe={units:m,length:A,isKeyframe:H,dts:I,cts:o,pts:I+o};H&&(fe.fileposition=s),re.samples.push(fe),re.length+=A}},a.prototype._parseHEVCVideoData=function(i,t,e,n,s,r,o){for(var h=this._littleEndian,l=new DataView(i,t,e),m=[],A=0,y=0,R=this._naluLengthSize,I=this._timestampBase+n,H=r===1;y<e;){if(y+4>=e){p.a.w(this.TAG,"Malformed Nalu near timestamp ".concat(I,", offset = ").concat(y,", dataSize = ").concat(e));break}var x=l.getUint32(y,!h);if(R===3&&(x>>>=8),x>e-R)return void p.a.w(this.TAG,"Malformed Nalus near timestamp ".concat(I,", NaluSize > DataSize!"));var ee=l.getUint8(y+R)>>1&63;ee!==19&&ee!==20&&ee!==21||(H=!0);var Z=new Uint8Array(i,t+y,R+x),Y={type:ee,data:Z};m.push(Y),A+=Z.byteLength,y+=R+x}if(m.length){var re=this._videoTrack,fe={units:m,length:A,isKeyframe:H,dts:I,cts:o,pts:I+o};H&&(fe.fileposition=s),re.samples.push(fe),re.length+=A}},a.prototype._parseAV1VideoData=function(i,t,e,n,s,r,o){this._littleEndian;var h,l=[],m=this._timestampBase+n,A=r===1;if(A){var y=this._videoMetadata,R=_.parseOBUs(new Uint8Array(i,t,e),y.extra);if(R==null)return void this._onError(P.a.FORMAT_ERROR,"Flv: Invalid AV1 VideoData");console.log(R),y.codecWidth=R.codec_size.width,y.codecHeight=R.codec_size.height,y.presentWidth=R.present_size.width,y.presentHeight=R.present_size.height,y.sarRatio=R.sar_ratio;var I=this._mediaInfo;I.width=y.codecWidth,I.height=y.codecHeight,I.sarNum=y.sarRatio.width,I.sarDen=y.sarRatio.height,p.a.v(this.TAG,"Parsed AV1DecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",y)}if(h=e,l.push({unitType:0,data:new Uint8Array(i,t+0,e)}),l.length){var H=this._videoTrack,x={units:l,length:h,isKeyframe:A,dts:m,cts:o,pts:m+o};A&&(x.fileposition=s),H.samples.push(x),H.length+=h}},a}(),V=function(){function a(){}return a.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSynchronousKLVMetadata=null,this.onAsynchronousKLVMetadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},a}(),J=function(){this.program_pmt_pid={}};(function(a){a[a.kMPEG1Audio=3]="kMPEG1Audio",a[a.kMPEG2Audio=4]="kMPEG2Audio",a[a.kPESPrivateData=6]="kPESPrivateData",a[a.kADTSAAC=15]="kADTSAAC",a[a.kLOASAAC=17]="kLOASAAC",a[a.kAC3=129]="kAC3",a[a.kEAC3=135]="kEAC3",a[a.kMetadata=21]="kMetadata",a[a.kSCTE35=134]="kSCTE35",a[a.kH264=27]="kH264",a[a.kH265=36]="kH265"})(d||(d={}));var F,K=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,av1:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.synchronous_klv_pids={},this.asynchronous_klv_pids={},this.scte_35_pids={},this.smpte2038_pids={}},oe=function(){},Ee=function(){},_e=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};(function(a){a[a.kUnspecified=0]="kUnspecified",a[a.kSliceNonIDR=1]="kSliceNonIDR",a[a.kSliceDPA=2]="kSliceDPA",a[a.kSliceDPB=3]="kSliceDPB",a[a.kSliceDPC=4]="kSliceDPC",a[a.kSliceIDR=5]="kSliceIDR",a[a.kSliceSEI=6]="kSliceSEI",a[a.kSliceSPS=7]="kSliceSPS",a[a.kSlicePPS=8]="kSlicePPS",a[a.kSliceAUD=9]="kSliceAUD",a[a.kEndOfSequence=10]="kEndOfSequence",a[a.kEndOfStream=11]="kEndOfStream",a[a.kFiller=12]="kFiller",a[a.kSPSExt=13]="kSPSExt",a[a.kReserved0=14]="kReserved0"})(F||(F={}));var b,u,C=function(){},z=function(a){var i=a.data.byteLength;this.type=a.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(a.data,4)},ne=function(){function a(i){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not find H264 startcode until payload end!")}return a.prototype.findNextStartCodeOffset=function(i){for(var t=i,e=this.data_;;){if(t+3>=e.byteLength)return this.eof_flag_=!0,e.byteLength;var n=e[t+0]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],s=e[t+0]<<16|e[t+1]<<8|e[t+2];if(n===1||s===1)return t;t++}},a.prototype.readNextNaluPayload=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_startcode_offset_,n=31&i[e+=(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])===1?4:3],s=(128&i[e])>>>7,r=this.findNextStartCodeOffset(e);if(this.current_startcode_offset_=r,!(n>=F.kReserved0)&&s===0){var o=i.subarray(e,r);(t=new C).type=n,t.data=o}}return t},a}(),de=function(){function a(i,t,e){var n=8+i.byteLength+1+2+t.byteLength,s=!1;i[3]!==66&&i[3]!==77&&i[3]!==88&&(s=!0,n+=4);var r=this.data=new Uint8Array(n);r[0]=1,r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=255,r[5]=225;var o=i.byteLength;r[6]=o>>>8,r[7]=255&o;var h=8;r.set(i,8),r[h+=o]=1;var l=t.byteLength;r[h+1]=l>>>8,r[h+2]=255&l,r.set(t,h+3),h+=3+l,s&&(r[h]=252|e.chroma_format_idc,r[h+1]=248|e.bit_depth_luma-8,r[h+2]=248|e.bit_depth_chroma-8,r[h+3]=0,h+=4)}return a.prototype.getData=function(){return this.data},a}();(function(a){a[a.kNull=0]="kNull",a[a.kAACMain=1]="kAACMain",a[a.kAAC_LC=2]="kAAC_LC",a[a.kAAC_SSR=3]="kAAC_SSR",a[a.kAAC_LTP=4]="kAAC_LTP",a[a.kAAC_SBR=5]="kAAC_SBR",a[a.kAAC_Scalable=6]="kAAC_Scalable",a[a.kLayer1=32]="kLayer1",a[a.kLayer2=33]="kLayer2",a[a.kLayer3=34]="kLayer3"})(b||(b={})),function(a){a[a.k96000Hz=0]="k96000Hz",a[a.k88200Hz=1]="k88200Hz",a[a.k64000Hz=2]="k64000Hz",a[a.k48000Hz=3]="k48000Hz",a[a.k44100Hz=4]="k44100Hz",a[a.k32000Hz=5]="k32000Hz",a[a.k24000Hz=6]="k24000Hz",a[a.k22050Hz=7]="k22050Hz",a[a.k16000Hz=8]="k16000Hz",a[a.k12000Hz=9]="k12000Hz",a[a.k11025Hz=10]="k11025Hz",a[a.k8000Hz=11]="k8000Hz",a[a.k7350Hz=12]="k7350Hz"}(u||(u={}));var Te,ye,j=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],W=(Te=function(a,i){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(a,i)},function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function t(){this.constructor=a}Te(a,i),a.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}),ie=function(){},ue=function(a){function i(){return a!==null&&a.apply(this,arguments)||this}return W(i,a),i}(ie),le=function(){function a(i){this.TAG="AACADTSParser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not found ADTS syncword until payload end")}return a.prototype.findNextSyncwordOffset=function(i){for(var t=i,e=this.data_;;){if(t+7>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[t+0]<<8|e[t+1])>>>4===4095)return t;t++}},a.prototype.readNextAACFrame=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_syncword_offset_,n=(8&i[e+1])>>>3,s=(6&i[e+1])>>>1,r=1&i[e+1],o=(192&i[e+2])>>>6,h=(60&i[e+2])>>>2,l=(1&i[e+2])<<2|(192&i[e+3])>>>6,m=(3&i[e+3])<<11|i[e+4]<<3|(224&i[e+5])>>>5;if(i[e+6],e+m>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var A=r===1?7:9,y=m-A;e+=A;var R=this.findNextSyncwordOffset(e+y);if(this.current_syncword_offset_=R,(n===0||n===1)&&s===0){var I=i.subarray(e,e+y);(t=new ie).audio_object_type=o+1,t.sampling_freq_index=h,t.sampling_frequency=j[h],t.channel_config=l,t.data=I}}return t},a.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},a.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},a}(),ve=function(){function a(i){this.TAG="AACLOASParser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not found LOAS syncword until payload end")}return a.prototype.findNextSyncwordOffset=function(i){for(var t=i,e=this.data_;;){if(t+1>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[t+0]<<3|e[t+1]>>>5)===695)return t;t++}},a.prototype.getLATMValue=function(i){for(var t=i.readBits(2),e=0,n=0;n<=t;n++)e<<=8,e|=i.readByte();return e},a.prototype.readNextAACFrame=function(i){for(var t=this.data_,e=null;e==null&&!this.eof_flag_;){var n=this.current_syncword_offset_,s=(31&t[n+1])<<8|t[n+2];if(n+3+s>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=new U(t.subarray(n+3,n+3+s)),o=null;if(r.readBool()){if(i==null){p.a.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+s),r.destroy();continue}o=i}else{var h=r.readBool();if(h&&r.readBool()){p.a.e(this.TAG,"audioMuxVersionA is Not Supported"),r.destroy();break}if(h&&this.getLATMValue(r),!r.readBool()){p.a.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),r.destroy();break}if(r.readBits(6)!==0){p.a.e(this.TAG,"more than 2 numSubFrames Not Supported"),r.destroy();break}if(r.readBits(4)!==0){p.a.e(this.TAG,"more than 2 numProgram Not Supported"),r.destroy();break}if(r.readBits(3)!==0){p.a.e(this.TAG,"more than 2 numLayer Not Supported"),r.destroy();break}var l=h?this.getLATMValue(r):0,m=r.readBits(5);l-=5;var A=r.readBits(4);l-=4;var y=r.readBits(4);l-=4,r.readBits(3),(l-=3)>0&&r.readBits(l);var R=r.readBits(3);if(R!==0){p.a.e(this.TAG,"frameLengthType = ".concat(R,". Only frameLengthType = 0 Supp
1orted")),r.destroy();break}r.readByte();var I=r.readBool();if(I)if(h)this.getLATMValue(r);else{for(var H=0;;){H<<=8;var x=r.readBool();if(H+=r.readByte(),!x)break}console.log(H)}r.readBool()&&r.readByte(),(o=new ue).audio_object_type=m,o.sampling_freq_index=A,o.sampling_frequency=j[o.sampling_freq_index],o.channel_config=y,o.other_data_present=I}for(var ee=0;;){var Z=r.readByte();if(ee+=Z,Z!==255)break}for(var Y=new Uint8Array(ee),re=0;re<ee;re++)Y[re]=r.readByte();(e=new ue).audio_object_type=o.audio_object_type,e.sampling_freq_index=o.sampling_freq_index,e.sampling_frequency=j[o.sampling_freq_index],e.channel_config=o.channel_config,e.other_data_present=o.other_data_present,e.data=Y,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+s)}return e},a.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},a.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},a}(),we=function(a){var i=null,t=a.audio_object_type,e=a.audio_object_type,n=a.sampling_freq_index,s=a.channel_config,r=0,o=navigator.userAgent.toLowerCase();o.indexOf("firefox")!==-1?n>=6?(e=5,i=new Array(4),r=n-3):(e=2,i=new Array(2),r=n):o.indexOf("android")!==-1?(e=2,i=new Array(2),r=n):(e=5,r=n,i=new Array(4),n>=6?r=n-3:s===1&&(e=2,i=new Array(2),r=n)),i[0]=e<<3,i[0]|=(15&n)>>>1,i[1]=(15&n)<<7,i[1]|=(15&s)<<3,e===5&&(i[1]|=(15&r)>>>1,i[2]=(1&r)<<7,i[2]|=8,i[3]=0),this.config=i,this.sampling_rate=j[n],this.channel_count=s,this.codec_mimetype="mp4a.40."+e,this.original_codec_mimetype="mp4a.40."+t},Ce=function(){},Ue=function(){};(function(a){a[a.kSpliceNull=0]="kSpliceNull",a[a.kSpliceSchedule=4]="kSpliceSchedule",a[a.kSpliceInsert=5]="kSpliceInsert",a[a.kTimeSignal=6]="kTimeSignal",a[a.kBandwidthReservation=7]="kBandwidthReservation",a[a.kPrivateCommand=255]="kPrivateCommand"})(ye||(ye={}));var ke,ze=function(a){var i=a.readBool();return i?(a.readBits(6),{time_specified_flag:i,pts_time:4*a.readBits(31)+a.readBits(2)}):(a.readBits(7),{time_specified_flag:i})},We=function(a){var i=a.readBool();return a.readBits(6),{auto_return:i,duration:4*a.readBits(31)+a.readBits(2)}},Qe=function(a,i){var t=i.readBits(8);return a?{component_tag:t}:{component_tag:t,splice_time:ze(i)}},Je=function(a){return{component_tag:a.readBits(8),utc_splice_time:a.readBits(32)}},St=function(a){var i=a.readBits(32),t=a.readBool();a.readBits(7);var e={splice_event_id:i,splice_event_cancel_indicator:t};if(t)return e;if(e.out_of_network_indicator=a.readBool(),e.program_splice_flag=a.readBool(),e.duration_flag=a.readBool(),a.readBits(5),e.program_splice_flag)e.utc_splice_time=a.readBits(32);else{e.component_count=a.readBits(8),e.components=[];for(var n=0;n<e.component_count;n++)e.components.push(Je(a))}return e.duration_flag&&(e.break_duration=We(a)),e.unique_program_id=a.readBits(16),e.avail_num=a.readBits(8),e.avails_expected=a.readBits(8),e},bt=function(a,i,t,e){return{descriptor_tag:a,descriptor_length:i,identifier:t,provider_avail_id:e.readBits(32)}},At=function(a,i,t,e){var n=e.readBits(8),s=e.readBits(3);e.readBits(5);for(var r="",o=0;o<s;o++)r+=String.fromCharCode(e.readBits(8));return{descriptor_tag:a,descriptor_length:i,identifier:t,preroll:n,dtmf_count:s,DTMF_char:r}},Et=function(a){var i=a.readBits(8);return a.readBits(7),{component_tag:i,pts_offset:4*a.readBits(31)+a.readBits(2)}},Rt=function(a,i,t,e){var n=e.readBits(32),s=e.readBool();e.readBits(7);var r={descriptor_tag:a,descriptor_length:i,identifier:t,segmentation_event_id:n,segmentation_event_cancel_indicator:s};if(s)return r;if(r.program_segmentation_flag=e.readBool(),r.segmentation_duration_flag=e.readBool(),r.delivery_not_restricted_flag=e.readBool(),r.delivery_not_restricted_flag?e.readBits(5):(r.web_delivery_allowed_flag=e.readBool(),r.no_regional_blackout_flag=e.readBool(),r.archive_allowed_flag=e.readBool(),r.device_restrictions=e.readBits(2)),!r.program_segmentation_flag){r.component_count=e.readBits(8),r.components=[];for(var o=0;o<r.component_count;o++)r.components.push(Et(e))}r.segmentation_duration_flag&&(r.segmentation_duration=e.readBits(40)),r.segmentation_upid_type=e.readBits(8),r.segmentation_upid_length=e.readBits(8);var h=new Uint8Array(r.segmentation_upid_length);for(o=0;o<r.segmentation_upid_length;o++)h[o]=e.readBits(8);return r.segmentation_upid=h.buffer,r.segmentation_type_id=e.readBits(8),r.segment_num=e.readBits(8),r.segments_expected=e.readBits(8),r.segmentation_type_id!==52&&r.segmentation_type_id!==54&&r.segmentation_type_id!==56&&r.segmentation_type_id!==58||(r.sub_segment_num=e.readBits(8),r.sub_segments_expected=e.readBits(8)),r},Tt=function(a,i,t,e){return{descriptor_tag:a,descriptor_length:i,identifier:t,TAI_seconds:e.readBits(48),TAI_ns:e.readBits(32),UTC_offset:e.readBits(16)}},kt=function(a){return{component_tag:a.readBits(8),ISO_code:String.fromCharCode(a.readBits(8),a.readBits(8),a.readBits(8)),Bit_Stream_Mode:
vendor: 32,102 bytes, line 1
1a.readBits(3),Num_Channels:a.readBits(4),Full_Srvc_Audio:a.readBool()}},Lt=function(a,i,t,e){for(var n=e.readBits(4),s=[],r=0;r<n;r++)s.push(kt(e));return{descriptor_tag:a,descriptor_length:i,identifier:t,audio_count:n,components:s}},Mt=function(a){var i=new U(a),t=i.readBits(8),e=i.readBool(),n=i.readBool();i.readBits(2);var s=i.readBits(12),r=i.readBits(8),o=i.readBool(),h=i.readBits(6),l=4*i.readBits(31)+i.readBits(2),m=i.readBits(8),A=i.readBits(12),y=i.readBits(12),R=i.readBits(8),I=null;R===ye.kSpliceNull?I={}:R===ye.kSpliceSchedule?I=function(ce){for(var Se=ce.readBits(8),Ae=[],he=0;he<Se;he++)Ae.push(St(ce));return{splice_count:Se,events:Ae}}(i):R===ye.kSpliceInsert?I=function(ce){var Se=ce.readBits(32),Ae=ce.readBool();ce.readBits(7);var he={splice_event_id:Se,splice_event_cancel_indicator:Ae};if(Ae)return he;if(he.out_of_network_indicator=ce.readBool(),he.program_splice_flag=ce.readBool(),he.duration_flag=ce.readBool(),he.splice_immediate_flag=ce.readBool(),ce.readBits(4),he.program_splice_flag&&!he.splice_immediate_flag&&(he.splice_time=ze(ce)),!he.program_splice_flag){he.component_count=ce.readBits(8),he.components=[];for(var me=0;me<he.component_count;me++)he.components.push(Qe(he.splice_immediate_flag,ce))}return he.duration_flag&&(he.break_duration=We(ce)),he.unique_program_id=ce.readBits(16),he.avail_num=ce.readBits(8),he.avails_expected=ce.readBits(8),he}(i):R===ye.kTimeSignal?I=function(ce){return{splice_time:ze(ce)}}(i):R===ye.kBandwidthReservation?I={}:R===ye.kPrivateCommand?I=function(ce,Se){for(var Ae=String.fromCharCode(Se.readBits(8),Se.readBits(8),Se.readBits(8),Se.readBits(8)),he=new Uint8Array(ce-4),me=0;me<ce-4;me++)he[me]=Se.readBits(8);return{identifier:Ae,private_data:he.buffer}}(y,i):i.readBits(8*y);for(var H=[],x=i.readBits(16),ee=0;ee<x;){var Z=i.readBits(8),Y=i.readBits(8),re=String.fromCharCode(i.readBits(8),i.readBits(8),i.readBits(8),i.readBits(8));Z===0?H.push(bt(Z,Y,re,i)):Z===1?H.push(At(Z,Y,re,i)):Z===2?H.push(Rt(Z,Y,re,i)):Z===3?H.push(Tt(Z,Y,re,i)):Z===4?H.push(Lt(Z,Y,re,i)):i.readBits(8*(Y-4)),ee+=2+Y}var fe={table_id:t,section_syntax_indicator:e,private_indicator:n,section_length:s,protocol_version:r,encrypted_packet:o,encryption_algorithm:h,pts_adjustment:l,cw_index:m,tier:A,splice_command_length:y,splice_command_type:R,splice_command:I,descriptor_loop_length:x,splice_descriptors:H,E_CRC32:o?i.readBits(32):void 0,CRC32:i.readBits(32)};if(R===ye.kSpliceInsert){var $=I;if($.splice_event_cancel_indicator)return{splice_command_type:R,detail:fe,data:a};if($.program_splice_flag&&!$.splice_immediate_flag){var ae=$.duration_flag?$.break_duration.auto_return:void 0,pe=$.duration_flag?$.break_duration.duration/90:void 0;return $.splice_time.time_specified_flag?{splice_command_type:R,pts:(l+$.splice_time.pts_time)%Math.pow(2,33),auto_return:ae,duraiton:pe,detail:fe,data:a}:{splice_command_type:R,auto_return:ae,duraiton:pe,detail:fe,data:a}}return{splice_command_type:R,auto_return:ae=$.duration_flag?$.break_duration.auto_return:void 0,duraiton:pe=$.duration_flag?$.break_duration.duration/90:void 0,detail:fe,data:a}}if(R===ye.kTimeSignal){var se=I;return se.splice_time.time_specified_flag?{splice_command_type:R,pts:(l+se.splice_time.pts_time)%Math.pow(2,33),detail:fe,data:a}:{splice_command_type:R,detail:fe,data:a}}return{splice_command_type:R,detail:fe,data:a}};(function(a){a[a.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",a[a.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",a[a.kSliceCRA_NUT=21]="kSliceCRA_NUT",a[a.kSliceVPS=32]="kSliceVPS",a[a.kSliceSPS=33]="kSliceSPS",a[a.kSlicePPS=34]="kSlicePPS",a[a.kSliceAUD=35]="kSliceAUD"})(ke||(ke={}));var wt=function(){},Ct=function(a){var i=a.data.byteLength;this.type=a.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(a.data,4)},Dt=function(){function a(i){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not find H265 startcode until payload end!")}return a.prototype.findNextStartCodeOffset=function(i){for(var t=i,e=this.data_;;){if(t+3>=e.byteLength)return this.eof_flag_=!0,e.byteLength;var n=e[t+0]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],s=e[t+0]<<16|e[t+1]<<8|e[t+2];if(n===1||s===1)return t;t++}},a.prototype.readNextNaluPayload=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_startcode_offset_,n=i[e+=(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])===1?4:3]>>1&63,s=(128&i[e])>>>7,r=this.findNextStartCodeOffset(e);if(this.current_startcode_offset_=r,s===0){var o=i.subarray(e,r);(t=new wt).type=n,t.data=o}}return t},a}(),Ot=function(){function a(i,t,e,n){var s=23+(5+i.byteLength)+(5+t.byteLength)+(5+e.byteLength),r=this.data=new Uint8Array(s);r[0]=1,r[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,r[2]=n.general_profile_compatibility_flags_1,r[3]=n.general_profile_compatibility_flags_2,r[4]=n.general_profile_compatibility_flags_3,r[5]=n.general_profile_compatibility_flags_4,r[6]=n.general_constraint_indicator_flags_1,r[7]=n.general_constraint_indicator_flags_2,r[8]=n.general_constraint_indicator_flags_3,r[9]=n.general_constraint_indicator_flags_4,r[10]=n.general_constraint_indicator_flags_5,r[11]=n.general_constraint_indicator_flags_6,r[12]=n.general_level_idc,r[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,r[14]=255&n.min_spatial_segmentation_idc,r[15]=252|3&n.parallelismType,r[16]=252|3&n.chroma_format_idc,r[17]=248|7&n.bit_depth_luma_minus8,r[18]=248|7&n.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|ke.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&i.byteLength)>>8,r[27]=(255&i.byteLength)>>0,r.set(i,28),r[23+(5+i.byteLength)+0]=128|ke.kSliceSPS,r[23+(5+i.byteLength)+1]=0,r[23+(5+i.byteLength)+2]=1,r[23+(5+i.byteLength)+3]=(65280&t.byteLength)>>8,r[23+(5+i.byteLength)+4]=(255&t.byteLength)>>0,r.set(t,23+(5+i.byteLength)+5),r[23+(5+i.byteLength+5+t.byteLength)+0]=128|ke.kSlicePPS,r[23+(5+i.byteLength+5+t.byteLength)+1]=0,r[23+(5+i.byteLength+5+t.byteLength)+2]=1,r[23+(5+i.byteLength+5+t.byteLength)+3]=(65280&e.byteLength)>>8,r[23+(5+i.byteLength+5+t.byteLength)+4]=(255&e.byteLength)>>0,r.set(e,23+(5+i.byteLength+5+t.byteLength)+5)}return a.prototype.getData=function(){return this.data},a}(),Bt=function(){},It=function(){},Pt=function(){},xt=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],Ut=function(){function a(i){this.TAG="AC3Parser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return a.prototype.findNextSyncwordOffset=function(i){for(var t=i,e=this.data_;;){if(t+7>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[t+0]<<8|e[t+1]<<0)===2935)return t;t++}},a.prototype.readNextAC3Frame=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_syncword_offset_,n=i[e+4]>>6,s=[48e3,44200,33e3][n],r=63&i[e+4],o=2*xt[n][r];if(isNaN(o)||e+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var h=this.findNextSyncwordOffset(e+o);this.current_syncword_offset_=h;var l=i[e+5]>>3,m=7&i[e+5],A=i[e+6]>>5,y=0;1&A&&A!==1&&(y+=2),4&A&&(y+=2),A===2&&(y+=2);var R=(i[e+6]<<8|i[e+7]<<0)>>12-y&1,I=[2,1,2,3,3,4,4,5][A]+R;(t=new Pt).sampling_frequency=s,t.channel_count=I,t.channel_mode=A,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=R,t.bit_stream_mode=m,t.frame_size_code=r,t.data=i.subarray(e,e+o)}return t},a.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},a.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},a}(),Nt=function(a){var i;i=[a.sampling_rate_code<<6|a.bit_stream_identification<<1|a.bit_stream_mode>>2,(3&a.bit_stream_mode)<<6|a.channel_mode<<3|a.low_frequency_effects_channel_on<<2|a.frame_size_code>>4,a.frame_size_code<<4&224],this.config=i,this.sampling_rate=a.sampling_frequency,this.bit_stream_identification=a.bit_stream_identification,this.bit_stream_mode=a.bit_stream_mode,this.low_frequency_effects_channel_on=a.low_frequency_effects_channel_on,this.channel_count=a.channel_count,this.channel_mode=a.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},Vt=function(){},Ft=function(){function a(i){this.TAG="EAC3Parser",this.data_=i,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return a.prototype.findNextSyncwordOffset=function(i){for(var t=i,e=this.data_;;){if(t+7>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[t+0]<<8|e[t+1]<<0)===2935)return t;t++}},a.prototype.readNextEAC3Frame=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_syncword_offset_,n=new U(i.subarray(e+2)),s=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),r=n.readBits(2),o=null,h=null;r===3?(o=[24e3,22060,16e3][r=n.readBits(2)],h=3):(o=[48e3,44100,32e3][r],h=n.readBits(2));var l=n.readBits(3),m=n.readBits(1),A=n.readBits(5);if(e+s>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var y=this.findNextSyncwordOffset(e+s);this.current_syncword_offset_=y;var R=[2,1,2,3,3,4,4,5][l]+m;n.destroy(),(t=new Vt).sampling_frequency=o,t.channel_count=R,t.channel_mode=l,t.bit_stream_identification=A,t.low_frequency_effects_channel_on=m,t.frame_size=s,t.num_blks=[1,2,3,6][h],t.data=i.subarray(e,e+s)}return t},a.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},a.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},a}(),Gt=function(a){var i,t=Math.floor(a.frame_size*a.sampling_frequency/(16*a.num_blks));i=[255&t,248&t,a.sampling_rate_code<<6|a.bit_stream_identification<<1|0,0|a.channel_mode<<1|a.low_frequency_effects_channel_on<<0,0],this.config=i,this.sampling_rate=a.sampling_frequency,this.bit_stream_identification=a.bit_stream_identification,this.num_blks=a.num_blks,this.low_frequency_effects_channel_on=a.low_frequency_effects_channel_on,this.channel_count=a.channel_count,this.channel_mode=a.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},jt=function(){},zt=function(){function a(i){this.TAG="AV1OBUInMpegTsParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=i,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&p.a.e(this.TAG,"Could not find AV1 startcode until payload end!")}return a._ebsp2rbsp=function(i){for(var t=i,e=t.byteLength,n=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&t[r]===3&&t[r-1]===0&&t[r-2]===0||(n[s]=t[r],s++);return new Uint8Array(n.buffer,0,s)},a.prototype.findNextStartCodeOffset=function(i){for(var t=i,e=this.data_;;){if(t+2>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[t+0]<<16|e[t+1]<<8|e[t+2])===1)return t;t++}},a.prototype.readNextOBUPayload=function(){for(var i=this.data_,t=null;t==null&&!this.eof_flag_;){var e=this.current_startcode_offset_+3,n=this.findNextStartCodeOffset(e);this.current_startcode_offset_=n,t=a._ebsp2rbsp(i.subarray(e,n))}return t},a}(),Ht=function(){var a=function(i,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])})(i,t)};return function(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=i}a(i,t),i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ge=function(){return(Ge=Object.assign||function(a){for(var i,t=1,e=arguments.length;t<e;t++)for(var n in i=arguments[t])Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=i[n]);return a}).apply(this,arguments)},nt=function(a){function i(t,e){var n=a.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new S.a,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,av1c:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.last_pcr_base_=NaN,n.timestamp_offset_=0,n.audio_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=e,n}return Ht(i,a),i.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,a.prototype.destroy.call(this)},i.probe=function(t){var e=new Uint8Array(t),n=-1,s=188;if(e.byteLength<=3*s)return{needMoreData:!0};for(;n===-1;){for(var r=Math.min(1e3,e.byteLength-3*s),o=0;o<r;){if(e[o]===71&&e[o+s]===71&&e[o+2*s]===71){n=o;break}o++}if(n===-1)if(s===188)s=192;else{if(s!==192)break;s=204}}return n===-1?{match:!1}:(s===192&&n>=4?(p.a.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),n-=4):s===204&&p.a.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:s,sync_offset:n})},i.prototype.bindDataSource=function(t){return t.onDataArrival=this.parseChunks.bind(this),this},i.prototype.resetMediaInfo=function(){this.media_info_=new S.a},i.prototype.parseChunks=function(t,e){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new L.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0;for(this.first_parse_&&(this.first_parse_=!1,n=this.sync_offset_);n+this.ts_packet_size_<=t.byteLength;){var s=e+n;this.ts_packet_size_===192&&(n+=4);var r=new Uint8Array(t,n,188),o=r[0];if(o!==71){p.a.e(this.TAG,"sync_byte = ".concat(o,", not 0x47"));break}var h=(64&r[1])>>>6,l=(r[1],(31&r[1])<<8|r[2]),m=(48&r[3])>>>4,A=15&r[3],y=!(!this.pmt_||this.pmt_.pcr_pid!==l),R={},I=4;if(m==2||m==3){var H=r[4];if(H>0&&(y||m==3)&&(R.discontinuity_indicator=(128&r[5])>>>7,R.random_access_indicator=(64&r[5])>>>6,R.elementary_stream_priority_indicator=(32&r[5])>>>5,(16&r[5])>>>4)){var x=300*this.getPcrBase(r)+((1&r[10])<<8|r[11]);this.last_pcr_=x}if(m==2||5+H===188){n+=188,this.ts_packet_size_===204&&(n+=16);continue}I=5+H}if(m==1||m==3){if(l===0||l===this.current_pmt_pid_||this.pmt_!=null&&this.pmt_.pid_stream_type[l]===d.kSCTE35){var ee=188-I;this.handleSectionSlice(t,n+I,ee,{pid:l,file_position:s,payload_unit_start_indicator:h,continuity_conunter:A,random_access_indicator:R.random_access_indicator})}else if(this.pmt_!=null&&this.pmt_.pid_stream_type[l]!=null){ee=188-I;var Z=this.pmt_.pid_stream_type[l];l!==this.pmt_.common_pids.h264&&l!==this.pmt_.common_pids.h265&&l!==this.pmt_.common_pids.av1&&l!==this.pmt_.common_pids.adts_aac&&l!==this.pmt_.common_pids.loas_aac&&l!==this.pmt_.common_pids.ac3&&l!==this.pmt_.common_pids.eac3&&l!==this.pmt_.common_pids.opus&&l!==this.pmt_.common_pids.mp3&&this.pmt_.pes_private_data_pids[l]!==!0&&this.pmt_.timed_id3_pids[l]!==!0&&this.pmt_.synchronous_klv_pids[l]!==!0&&this.pmt_.asynchronous_klv_pids[l]!==!0||this.handlePESSlice(t,n+I,ee,{pid:l,stream_type:Z,file_position:s,payload_unit_start_indicator:h,continuity_conunter:A,random_access_indicator:R.random_access_indicator})}}n+=188,this.ts_packet_size_===204&&(n+=16)}return this.dispatchAudioVideoMediaSegment(),n},i.prototype.handleSectionSlice=function(t,e,n,s){var r=new Uint8Array(t,e,n),o=this.section_slice_queues_[s.pid];if(s.payload_unit_start_indicator){var h=r[0];if(o!=null&&o.total_length!==0){var l=new Uint8Array(t,e+1,Math.min(n,h));o.slices.push(l),o.total_length+=l.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):this.clearSlices(o,s)}for(var m=1+h;m<r.byteLength&&r[m+0]!==255;){var A=(15&r[m+1])<<8|r[m+2];this.section_slice_queues_[s.pid]=new _e,(o=this.section_slice_queues_[s.pid]).expected_length=A+3,o.file_position=s.file_position,o.random_access_indicator=s.random_access_indicator,l=new Uint8Array(t,e+m,Math.min(n-m,o.expected_length-o.total_length)),o.slices.push(l),o.total_length+=l.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):o.total_length>=o.expected_length&&this.clearSlices(o,s),m+=l.byteLength}}else o!=null&&o.total_length!==0&&(l=new Uint8Array(t,e,Math.min(n,o.expected_length-o.total_length)),o.slices.push(l),o.total_length+=l.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):o.total_length>=o.expected_length&&this.clearSlices(o,s))},i.prototype.handlePESSlice=function(t,e,n,s){var r=new Uint8Array(t,e,n),o=r[0]<<16|r[1]<<8|r[2],h=(r[3],r[4]<<8|r[5]);if(s.payload_unit_start_indicator){if(o!==1)return void p.a.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(o));var l=this.pes_slice_queues_[s.pid];l&&(l.expected_length===0||l.expected_length===l.total_length?this.emitPESSlices(l,s):this.clearSlices(l,s)),this.pes_slice_queues_[s.pid]=new _e,this.pes_slice_queues_[s.pid].file_position=s.file_position,this.pes_slice_queues_[s.pid].random_access_indicator=s.random_access_indicator}if(this.pes_slice_queues_[s.pid]!=null){var m=this.pes_slice_queues_[s.pid];m.slices.push(r),s.payload_unit_start_indicator&&(m.expected_length=h===0?0:h+6),m.total_length+=r.byteLength,m.expected_length>0&&m.expected_length===m.total_length?this.emitPESSlices(m,s):m.expected_length>0&&m.expected_length<m.total_length&&this.clearSlices(m,s)}},i.prototype.emitSectionSlices=function(t,e){for(var n=new Uint8Array(t.total_length),s=0,r=0;s<t.slices.length;s++){var o=t.slices[s];n.set(o,r),r+=o.byteLength}t.slices=[],t.expected_length=-1,t.total_length=0;var h=new Ee;h.pid=e.pid,h.data=n,h.file_position=t.file_position,h.random_access_indicator=t.random_access_indicator,this.parseSection(h)},i.prototype.emitPESSlices=function(t,e){for(var n=new Uint8Array(t.total_length),s=0,r=0;s<t.slices.length;s++){var o=t.slices[s];n.set(o,r),r+=o.byteLength}t.slices=[],t.expected_length=-1,t.total_length=0;var h=new oe;h.pid=e.pid,h.data=n,h.stream_type=e.stream_type,h.file_position=t.file_position,h.random_access_indicator=t.random_access_indicator,this.parsePES(h)},i.prototype.clearSlices=function(t,e){t.slices=[],t.expected_length=-1,t.total_length=0},i.prototype.parseSection=function(t){var e=t.data,n=t.pid;n===0?this.parsePAT(e):n===this.current_pmt_pid_?this.parsePMT(e):this.pmt_!=null&&this.pmt_.scte_35_pids[n]&&this.parseSCTE35(e)},i.prototype.parsePES=function(t){var e=t.data,n=e[0]<<16|e[1]<<8|e[2],s=e[3],r=e[4]<<8|e[5];if(n===1)if(s!==188&&s!==190&&s!==191&&s!==240&&s!==241&&s!==255&&s!==242&&s!==248){e[6];var o=(192&e[7])>>>6,h=e[8],l=void 0,m=void 0;o!==2&&o!==3||(l=this.getTimestamp(e,9),m=o===3?this.getTimestamp(e,14):l);var A=9+h,y=void 0;if(r!==0){if(r<3+h)return void p.a.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");y=r-3-h}else y=e.byteLength-A;var R=e.subarray(A,A+y);switch(t.stream_type){case d.kMPEG1Audio:case d.kMPEG2Audio:this.parseMP3Payload(R,l);break;case d.kPESPrivateData:this.pmt_.common_pids.av1===t.pid?this.parseAV1Payload(R,l,m,t.file_position,t.random_access_indicator):this.pmt_.common_pids.opus===t.pid?this.parseOpusPayload(R,l):this.pmt_.common_pids.ac3===t.pid?this.parseAC3Payload(R,l):this.pmt_.common_pids.eac3===t.pid?this.parseEAC3Payload(R,l):this.pmt_.asynchronous_klv_pids[t.pid]?this.parseAsynchronousKLVMetadataPayload(R,t.pid,s):this.pmt_.smpte2038_pids[t.pid]?this.parseSMPTE2038MetadataPayload(R,l,m,t.pid,s):this.parsePESPrivateDataPayload(R,l,m,t.pid,s);break;case d.kADTSAAC:this.parseADTSAACPayload(R,l);break;case d.kLOASAAC:this.parseLOASAACPayload(R,l);break;case d.kAC3:this.parseAC3Payload(R,l);break;case d.kEAC3:this.parseEAC3Payload(R,l);break;case d.kMetadata:this.pmt_.timed_id3_pids[t.pid]?this.parseTimedID3MetadataPayload(R,l,m,t.pid,s):this.pmt_.synchronous_klv_pids[t.pid]&&this.parseSynchronousKLVMetadataPayload(R,l,m,t.pid,s);break;case d.kH264:this.parseH264Payload(R,l,m,t.file_position,t.random_access_indicator);break;case d.kH265:this.parseH265Payload(R,l,m,t.file_position,t.random_access_indicator)}}else(s===188||s===191||s===240||s===241||s===255||s===242||s===248)&&t.stream_type===d.kPESPrivateData&&(A=6,y=void 0,y=r!==0?r:e.byteLength-A,R=e.subarray(A,A+y),this.parsePESPrivateDataPayload(R,void 0,void 0,t.pid,s));else p.a.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(n))},i.prototype.parsePAT=function(t){var e=t[0];if(e===0){var n=(15&t[1])<<8|t[2],s=(t[3],t[4],(62&t[5])>>>1),r=1&t[5],o=t[6],h=(t[7],null);if(r===1&&o===0)(h=new J).version_number=s;else if((h=this.pat_)==null)return;for(var l=n-5-4,m=-1,A=-1,y=8;y<8+l;y+=4){var R=t[y]<<8|t[y+1],I=(31&t[y+2])<<8|t[y+3];R===0?h.network_pid=I:(h.program_pmt_pid[R]=I,m===-1&&(m=R),A===-1&&(A=I))}r===1&&o===0&&(this.pat_==null&&p.a.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(h))),this.pat_=h,this.current_program_=m,this.current_pmt_pid_=A)}else p.a.e(this.TAG,"parsePAT: table_id ".concat(e," is not corresponded to PAT!"))},i.prototype.parsePMT=function(t){var e=t[0];if(e===2){var n=(15&t[1])<<8|t[2],s=t[3]<<8|t[4],r=(62&t[5])>>>1,o=1&t[5],h=t[6],l=(t[7],null);if(o===1&&h===0)(l=new K).program_number=s,l.version_number=r,this.program_pmt_map_[s]=l;else if((l=this.program_pmt_map_[s])==null)return;l.pcr_pid=(31&t[8])<<8|t[9];for(var m=(15&t[10])<<8|t[11],A=12+m,y=n-9-m-4,R=A;R<A+y;){var I=t[R],H=(31&t[R+1])<<8|t[R+2],x=(15&t[R+3])<<8|t[R+4];l.pid_stream_type[H]=I;var ee=l.common_pids.h264||l.common_pids.h265,Z=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(I!==d.kH264||ee)if(I!==d.kH265||ee)if(I!==d.kADTSAAC||Z)if(I!==d.kLOASAAC||Z)if(I!==d.kAC3||Z)if(I!==d.kEAC3||Z)if(I!==d.kMPEG1Audio&&I!==d.kMPEG2Audio||Z)if(I===d.kPESPrivateData){if(l.pes_private_data_pids[H]=!0,x>0){for(var Y=R+5;Y<R+5+x;){var re=t[Y+0],fe=t[Y+1];if(re===5){var $=String.fromCharCode.apply(String,Array.from(t.subarray(Y+2,Y+2+fe)));$==="VANC"?l.smpte2038_pids[H]=!0:$==="AV01"?l.common_pids.av1=H:$==="Opus"?l.common_pids.opus=H:$==="KLVA"&&(l.asynchronous_klv_pids[H]=!0)}else if(re===127){if(H===l.common_pids.opus){var ae=null;if(t[Y+2]===128&&(ae=t[Y+3]),ae==null){p.a.e(this.TAG,"Not Supported Opus channel count.");continue}var pe={codec:"opus",channel_count:15&ae?15&ae:2,channel_config_code:ae,sample_rate:48e3},se={codec:"opus",meta:pe};this.audio_init_segment_dispatched_==0?(this.audio_metadata_=pe,this.dispatchAudioInitSegment(se)):this.detectAudioMetadataChange(se)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(se))}}else re===128&&H===l.common_pids.av1&&(this.video_metadata_.av1c=t.subarray(Y+2,Y+2+fe));Y+=2+fe}var ce=t.subarray(R+5,R+5+x);this.dispatchPESPrivateDataDescriptor(H,I,ce)}}else if(I===d.kMetadata){if(x>0)for(Y=R+5;Y<R+5+x;){re=t[Y+0];var Se=t[Y+1];if(re===38){var Ae=t[Y+2]<<8|t[Y+3]<<0,he=null;Ae===65535&&(he=String.fromCharCode.apply(String,Array.from(t.subarray(Y+4,Y+4+4))));var me=null;if(t[Y+4+(Ae===65535?4:0)]===255){var Re=4+(Ae===65535?4:0)+1;me=String.fromCharCode.apply(String,Array.from(t.subarray(Y+Re,Y+Re+4)))}he==="ID3 "&&me==="ID3 "?l.timed_id3_pids[H]=!0:me==="KLVA"&&(l.synchronous_klv_pids[H]=!0)}Y+=2+Se}}else I===d.kSCTE35&&(l.scte_35_pids[H]=!0);else l.common_pids.mp3=H;else l.common_pids.eac3=H;else l.common_pids.ac3=H;else l.common_pids.loas_aac=H;else l.common_pids.adts_aac=H;else l.common_pids.h265=H;else l.common_pids.h264=H;R+=5+x}s===this.current_program_&&(this.pmt_==null&&p.a.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(l))),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265||l.common_pids.av1)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}else p.a.e(this.TAG,"parsePMT: table_id ".concat(e," is not corresponded to PMT!"))},i.prototype.parseSCTE35=function(t){var e=Mt(t);if(e.pts!=null){var n=Math.floor(e.pts/this.timescale_);e.pts=n}else e.nearest_pts=this.getNearestTimestampMilliseconds();this.onSCTE35Metadata&&this.onSCTE35Metadata(e)},i.prototype.parseAV1Payload=function(t,e,n,s,r){for(var o=new zt(t),h=null,l=[],m=0,A=!1,y=null;(h=o.readNextOBUPayload())!=null;){if((y=_.parseOBUs(h,this.video_metadata_.details))&&y.keyframe===!0)if(this.video_init_segment_dispatched_){if(this.detectVideoMetadataChange(null,y)===!0){var R;this.video_metadata_changed_=!0,this.dispatchVideoMediaSegment(),(R=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+y.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),R.set(y.sequence_header_data,this.video_metadata_.av1c.byteLength),y.av1c=R,this.dispatchVideoInitSegment()}}else(R=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+y.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),R.set(y.sequence_header_data,this.video_metadata_.av1c.byteLength),y.av1c=R,this.video_metadata_.details=y,this.dispatchVideoInitSegment();this.video_metadata_.details=y,A||(A=y.keyframe),l.push({data:h}),m+=h.byteLength}var I=Math.floor(e/this.timescale_),H=Math.floor(n/this.timescale_);if(l.length){var x=this.video_track_,ee={units:l,length:m,isKeyframe:A,dts:H,pts:I,cts:I-H,file_position:s};x.samples.push(ee),x.length+=m}},i.prototype.parseH264Payload=function(t,e,n,s,r){for(var o=new ne(t),h=null,l=[],m=0,A=!1;(h=o.readNextNaluPayload())!=null;){var y=new z(h);if(y.type===F.kSliceSPS){var R=N.parseSPS(h.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(y,R)===!0&&(p.a.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:y,pps:void 0,av1c:void 0,details:R}):(this.video_metadata_.sps=y,this.video_metadata_.details=R)}else y.type===F.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_.pps=y,this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(y.type===F.kSliceIDR||y.type===F.kSliceNonIDR&&r===1)&&(A=!0);this.video_init_segment_dispatched_&&(l.push(y),m+=y.data.byteLength)}var I=Math.floor(e/this.timescale_),H=Math.floor(n/this.timescale_);if(l.length){var x=this.video_track_,ee={units:l,length:m,isKeyframe:A,dts:H,pts:I,cts:I-H,file_position:s};x.samples.push(ee),x.length+=m}},i.prototype.parseH265Payload=function(t,e,n,s,r){for(var o=new Dt(t),h=null,l=[],m=0,A=!1;(h=o.readNextNaluPayload())!=null;){var y=new Ct(h);if(y.type===ke.kSliceVPS){if(!this.video_init_segment_dispatched_){var R=X.parseVPS(h.data);this.video_metadata_.vps=y,this.video_metadata_.details=Ge(Ge({},this.video_metadata_.details),R)}}else y.type===ke.kSliceSPS?(R=X.parseSPS(h.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(y,R)===!0&&(p.a.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:y,pps:void 0,av1c:void 0,details:R}):(this.video_metadata_.sps=y,this.video_metadata_.details=Ge(Ge({},this.video_metadata_.details),R))):y.type===ke.kSlicePPS?(!this.video_init_segment_dispatched_||this.video_metadata_changed_)&&(R=X.parsePPS(h.data),this.video_metadata_.pps=y,this.video_metadata_.details=Ge(Ge({},this.video_metadata_.details),R),this.video_metadata_.vps&&this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):y.type!==ke.kSliceIDR_W_RADL&&y.type!==ke.kSliceIDR_N_LP&&y.type!==ke.kSliceCRA_NUT||(A=!0);this.video_init_segment_dispatched_&&(l.push(y),m+=y.data.byteLength)}var I=Math.floor(e/this.timescale_),H=Math.floor(n/this.timescale_);if(l.length){var x=this.video_track_,ee={units:l,length:m,isKeyframe:A,dts:H,pts:I,cts:I-H,file_position:s};x.samples.push(ee),x.length+=m}},i.prototype.detectVideoMetadataChange=function(t,e){if(e.codec_mimetype!==this.video_metadata_.details.codec_mimetype)return p.a.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(this.video_metadata_.details.codec_mimetype," to ").concat(e.codec_mimetype)),!0;if(e.codec_size.width!==this.video_metadata_.details.codec_size.width||e.codec_size.height!==this.video_metadata_.details.codec_size.height){var n=this.video_metadata_.details.codec_size,s=e.codec_size;return p.a.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(n.width,"x").concat(n.height," to ").concat(s.width,"x").concat(s.height)),!0}return e.present_size.width!==this.video_metadata_.details.present_size.width&&(p.a.v(this.TAG,"Video: Present resolution width changed from "+"".concat(this.video_metadata_.details.present_size.width," to ").concat(e.present_size.width)),!0)},i.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},i.prototype.dispatchVideoInitSegment=function(){var t=this.video_metadata_.details,e={type:"video"};e.id=this.video_track_.id,e.timescale=1e3,e.duration=this.duration_,e.codecWidth=t.codec_size.width,e.codecHeight=t.codec_size.height,e.presentWidth=t.present_size.width,e.presentHeight=t.present_size.height,e.profile=t.profile_string,e.level=t.level_string,e.bitDepth=t.bit_depth,e.chromaFormat=t.chroma_format,e.sarRatio=t.sar_ratio,e.frameRate=t.frame_rate;var n=e.frameRate.fps_den,s=e.frameRate.fps_num;if(e.refSampleDuration=n/s*1e3,e.codec=t.codec_mimetype,this.video_metadata_.av1c)e.av1c=this.video_metadata_.av1c,this.video_init_segment_dispatched_==0&&p.a.v(this.TAG,"Generated first AV1 for mimeType: ".concat(e.codec));else if(this.video_metadata_.vps){var r=this.video_metadata_.vps.data.subarray(4),o=this.video_metadata_.sps.data.subarray(4),h=this.video_metadata_.pps.data.subarray(4),l=new Ot(r,o,h,t);e.hvcc=l.getData(),this.video_init_segment_dispatched_==0&&p.a.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(e.codec))}else{o=this.video_metadata_.sps.data.subarray(4),h=this.video_metadata_.pps.data.subarray(4);var m=new de(o,h,t);e.avcc=m.getData(),this.video_init_segment_dispatched_==0&&p.a.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(e.codec))}this.onTrackMetadata("video",e),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var A=this.media_info_;A.hasVideo=!0,A.width=e.codecWidth,A.height=e.codecHeight,A.fps=e.frameRate.fps,A.profile=e.profile,A.level=e.level,A.refFrames=t.ref_frames,A.chromaFormat=t.chroma_format_string,A.sarNum=e.sarRatio.width,A.sarDen=e.sarRatio.height,A.videoCodec=e.codec,A.hasAudio&&A.audioCodec?A.mimeType='video/mp2t; codecs="'.concat(A.videoCodec,",").concat(A.audioCodec,'"'):A.mimeType='video/mp2t;
1 codecs="'.concat(A.videoCodec,'"'),A.isComplete()&&this.onMediaInfo(A)},i.prototype.dispatchVideoMediaSegment=function(){this.isInitSegmentDispatched()&&this.video_track_.length&&this.onDataAvailable(null,this.video_track_)},i.prototype.dispatchAudioMediaSegment=function(){this.isInitSegmentDispatched()&&this.audio_track_.length&&this.onDataAvailable(this.audio_track_,null)},i.prototype.dispatchAudioVideoMediaSegment=function(){this.isInitSegmentDispatched()&&(this.audio_track_.length||this.video_track_.length)&&this.onDataAvailable(this.audio_track_,this.video_track_)},i.prototype.parseADTSAACPayload=function(t,e){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var n=new Uint8Array(t.byteLength+this.aac_last_incomplete_data_.byteLength);n.set(this.aac_last_incomplete_data_,0),n.set(t,this.aac_last_incomplete_data_.byteLength),t=n}var s,r;if(e!=null&&(r=e/this.timescale_),this.audio_metadata_.codec==="aac"){if(e==null&&this.audio_last_sample_pts_!=null)s=1024/this.audio_metadata_.sampling_frequency*1e3,r=this.audio_last_sample_pts_+s;else if(e==null)return void p.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var o=this.audio_last_sample_pts_+s;Math.abs(o-r)>1&&(p.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(o,"ms, PES pts: ").concat(r,"ms")),r=o)}}for(var h,l=new le(t),m=null,A=r;(m=l.readNextAACFrame())!=null;){s=1024/m.sampling_frequency*1e3;var y={codec:"aac",data:m};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:m.audio_object_type,sampling_freq_index:m.sampling_freq_index,sampling_frequency:m.sampling_frequency,channel_config:m.channel_config},this.dispatchAudioInitSegment(y)):this.detectAudioMetadataChange(y)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(y)),h=A;var R=Math.floor(A),I={unit:m.data,length:m.data.byteLength,pts:R,dts:R};this.audio_track_.samples.push(I),this.audio_track_.length+=m.data.byteLength,A+=s}l.hasIncompleteData()&&(this.aac_last_incomplete_data_=l.getIncompleteData()),h&&(this.audio_last_sample_pts_=h)}},i.prototype.parseLOASAACPayload=function(t,e){var n;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var s=new Uint8Array(t.byteLength+this.aac_last_incomplete_data_.byteLength);s.set(this.aac_last_incomplete_data_,0),s.set(t,this.aac_last_incomplete_data_.byteLength),t=s}var r,o;if(e!=null&&(o=e/this.timescale_),this.audio_metadata_.codec==="aac"){if(e==null&&this.audio_last_sample_pts_!=null)r=1024/this.audio_metadata_.sampling_frequency*1e3,o=this.audio_last_sample_pts_+r;else if(e==null)return void p.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var h=this.audio_last_sample_pts_+r;Math.abs(h-o)>1&&(p.a.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(h,"ms, PES pts: ").concat(o,"ms")),o=h)}}for(var l,m=new ve(t),A=null,y=o;(A=m.readNextAACFrame((n=this.loas_previous_frame)!==null&&n!==void 0?n:void 0))!=null;){this.loas_previous_frame=A,r=1024/A.sampling_frequency*1e3;var R={codec:"aac",data:A};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:A.audio_object_type,sampling_freq_index:A.sampling_freq_index,sampling_frequency:A.sampling_frequency,channel_config:A.channel_config},this.dispatchAudioInitSegment(R)):this.detectAudioMetadataChange(R)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(R)),l=y;var I=Math.floor(y),H={unit:A.data,length:A.data.byteLength,pts:I,dts:I};this.audio_track_.samples.push(H),this.audio_track_.length+=A.data.byteLength,y+=r}m.hasIncompleteData()&&(this.aac_last_incomplete_data_=m.getIncompleteData()),l&&(this.audio_last_sample_pts_=l)}},i.prototype.parseAC3Payload=function(t,e){if(!this.has_video_||this.video_init_segment_dispatched_){var n,s;if(e!=null&&(s=e/this.timescale_),this.audio_metadata_.codec==="ac-3"){if(e==null&&this.audio_last_sample_pts_!=null)n=1536/this.audio_metadata_.sampling_frequency*1e3,s=this.audio_last_sample_pts_+n;else if(e==null)return void p.a.w(this.TAG,"AC3: Unknown pts")}
vendor: 107,740 bytes, lines 1-9
1for(var r,o=new Ut(t),h=null,l=s;(h=o.readNextAC3Frame())!=null;){n=1536/h.sampling_frequency*1e3;var m={codec:"ac-3",data:h};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ac-3",sampling_frequency:h.sampling_frequency,bit_stream_identification:h.bit_stream_identification,bit_stream_mode:h.bit_stream_mode,low_frequency_effects_channel_on:h.low_frequency_effects_channel_on,channel_mode:h.channel_mode},this.dispatchAudioInitSegment(m)):this.detectAudioMetadataChange(m)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(m)),r=l;var A=Math.floor(l),y={unit:h.data,length:h.data.byteLength,pts:A,dts:A};this.audio_track_.samples.push(y),this.audio_track_.length+=h.data.byteLength,l+=n}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseEAC3Payload=function(t,e){if(!this.has_video_||this.video_init_segment_dispatched_){var n,s;if(e!=null&&(s=e/this.timescale_),this.audio_metadata_.codec==="ec-3"){if(e==null&&this.audio_last_sample_pts_!=null)n=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,s=this.audio_last_sample_pts_+n;else if(e==null)return void p.a.w(this.TAG,"EAC3: Unknown pts")}for(var r,o=new Ft(t),h=null,l=s;(h=o.readNextEAC3Frame())!=null;){n=1536/h.sampling_frequency*1e3;var m={codec:"ec-3",data:h};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ec-3",sampling_frequency:h.sampling_frequency,bit_stream_identification:h.bit_stream_identification,low_frequency_effects_channel_on:h.low_frequency_effects_channel_on,num_blks:h.num_blks,channel_mode:h.channel_mode},this.dispatchAudioInitSegment(m)):this.detectAudioMetadataChange(m)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(m)),r=l;var A=Math.floor(l),y={unit:h.data,length:h.data.byteLength,pts:A,dts:A};this.audio_track_.samples.push(y),this.audio_track_.length+=h.data.byteLength,l+=n}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseOpusPayload=function(t,e){if(!this.has_video_||this.video_init_segment_dispatched_){var n,s;if(e!=null&&(s=e/this.timescale_),this.audio_metadata_.codec==="opus"){if(e==null&&this.audio_last_sample_pts_!=null)n=20,s=this.audio_last_sample_pts_+n;else if(e==null)return void p.a.w(this.TAG,"Opus: Unknown pts")}for(var r,o=s,h=0;h<t.length;){n=20;for(var l=(16&t[h+1])!=0,m=(8&t[h+1])!=0,A=h+2,y=0;t[A]===255;)y+=255,A+=1;y+=t[A],A+=1,A+=l?2:0,A+=m?2:0,r=o;var R=Math.floor(o),I=t.slice(A,A+y),H={unit:I,length:I.byteLength,pts:R,dts:R};this.audio_track_.samples.push(H),this.audio_track_.length+=I.byteLength,o+=n,h=A+y}r&&(this.audio_last_sample_pts_=r)}},i.prototype.parseMP3Payload=function(t,e){if(!this.has_video_||this.video_init_segment_dispatched_){var n=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],s=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],r=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],o=t[1]>>>3&3,h=(6&t[1])>>1,l=(240&t[2])>>>4,m=(12&t[2])>>>2,A=(t[3]>>>6&3)!==3?2:1,y=0,R=34;switch(o){case 0:y=[11025,12e3,8e3,0][m];break;case 2:y=[22050,24e3,16e3,0][m];break;case 3:y=[44100,48e3,32e3,0][m]}switch(h){case 1:R=34,l<r.length&&r[l];break;case 2:R=33,l<s.length&&s[l];break;case 3:R=32,l<n.length&&n[l]}var I=new It;I.object_type=R,I.sample_rate=y,I.channel_count=A,I.data=t;var H={codec:"mp3",data:I};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"mp3",object_type:R,sample_rate:y,channel_count:A},this.dispatchAudioInitSegment(H)):this.detectAudioMetadataChange(H)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(H));var x={unit:t,length:t.byteLength,pts:e/this.timescale_,dts:e/this.timescale_};this.audio_track_.samples.push(x),this.audio_track_.length+=t.byteLength}},i.prototype.detectAudioMetadataChange=function(t){if(t.codec!==this.audio_metadata_.codec)return p.a.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(this.audio_metadata_.codec," to ").concat(t.codec)),!0;if(t.codec==="aac"&&this.audio_metadata_.codec==="aac"){if((e=t.data).audio_object_type!==this.audio_metadata_.audio_object_type)return p.a.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(e.audio_object_type)),!0;if(e.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return p.a.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(e.sampling_freq_index)),!0;if(e.channel_config!==this.audio_metadata_.channel_config)return p.a.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(this.audio_metadata_.channel_config," to ").concat(e.channel_config)),!0}else if(t.codec==="ac-3"&&this.audio_metadata_.codec==="ac-3"){var e;if((e=t.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return p.a.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(this.audio_metadata_.sampling_frequency," to ").concat(e.sampling_frequency)),!0;if(e.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return p.a.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(e.bit_stream_identification)),!0;if(e.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return p.a.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(e.bit_stream_mode)),!0;if(e.channel_mode!==this.audio_metadata_.channel_mode)return p.a.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(e.channel_mode)),!0;if(e.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return p.a.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(e.low_frequency_effects_channel_on)),!0}else if(t.codec==="opus"&&this.audio_metadata_.codec==="opus"){if((n=t.meta).sample_rate!==this.audio_metadata_.sample_rate)return p.a.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(n.sample_rate)),!0;if(n.channel_count!==this.audio_metadata_.channel_count)return p.a.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(n.channel_count)),!0}else if(t.codec==="mp3"&&this.audio_metadata_.codec==="mp3"){var n;if((n=t.data).object_type!==this.audio_metadata_.object_type)return p.a.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(n.object_type)),!0;if(n.sample_rate!==this.audio_metadata_.sample_rate)return p.a.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(n.sample_rate)),!0;if(n.channel_count!==this.audio_metadata_.channel_count)return p.a.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(n.channel_count)),!0}return!1},i.prototype.dispatchAudioInitSegment=function(t){var e={type:"audio"};if(e.id=this.audio_track_.id,e.timescale=1e3,e.duration=this.duration_,this.audio_metadata_.codec==="aac"){var n=t.codec==="aac"?t.data:null,s=new we(n);e.audioSampleRate=s.sampling_rate,e.channelCount=s.channel_count,e.codec=s.codec_mimetype,e.originalCodec=s.original_codec_mimetype,e.config=s.config,e.refSampleDuration=1024/e.audioSampleRate*e.timescale}else if(this.audio_metadata_.codec==="ac-3"){var r=t.codec==="ac-3"?t.data:null,o=new Nt(r);e.audioSampleRate=o.sampling_rate,e.channelCount=o.channel_count,e.codec=o.codec_mimetype,e.originalCodec=o.original_codec_mimetype,e.config=o.config,e.refSampleDuration=1536/e.audioSampleRate*e.timescale}else if(this.audio_metadata_.codec==="ec-3"){var h=t.codec==="ec-3"?t.data:null,l=new Gt(h);e.audioSampleRate=l.sampling_rate,e.channelCount=l.channel_count,e.codec=l.codec_mimetype,e.originalCodec=l.original_codec_mimetype,e.config=l.config,e.refSampleDuration=256*l.num_blks/e.audioSampleRate*e.timescale}else this.audio_metadata_.codec==="opus"?(e.audioSampleRate=this.audio_metadata_.sample_rate,e.channelCount=this.audio_metadata_.channel_count,e.channelConfigCode=this.audio_metadata_.channel_config_code,e.codec="opus",e.originalCodec="opus",e.config=void 0,e.refSampleDuration=20):this.audio_metadata_.codec==="mp3"&&(e.audioSampleRate=this.audio_metadata_.sample_rate,e.channelCount=this.audio_metadata_.channel_count,e.codec="mp3",e.originalCodec="mp3",e.config=void 0);this.audio_init_segment_dispatched_==0&&p.a.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(e.codec)),this.onTrackMetadata("audio",e),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var m=this.media_info_;m.hasAudio=!0,m.audioCodec=e.originalCodec,m.audioSampleRate=e.audioSampleRate,m.audioChannelCount=e.channelCount,m.hasVideo&&m.videoCodec?m.mimeType='video/mp2t; codecs="'.concat(m.videoCodec,",").concat(m.audioCodec,'"'):m.mimeType='video/mp2t; codecs="'.concat(m.audioCodec,'"'),m.isComplete()&&this.onMediaInfo(m)},i.prototype.dispatchPESPrivateDataDescriptor=function(t,e,n){var s=new Ue;s.pid=t,s.stream_type=e,s.descriptor=n,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(s)},i.prototype.parsePESPrivateDataPayload=function(t,e,n,s,r){var o=new Ce;if(o.pid=s,o.stream_id=r,o.len=t.byteLength,o.data=t,e!=null){var h=Math.floor(e/this.timescale_);o.pts=h}else o.nearest_pts=this.getNearestTimestampMilliseconds();if(n!=null){var l=Math.floor(n/this.timescale_);o.dts=l}this.onPESPrivateData&&this.onPESPrivateData(o)},i.prototype.parseTimedID3MetadataPayload=function(t,e,n,s,r){var o=new Ce;if(o.pid=s,o.stream_id=r,o.len=t.byteLength,o.data=t,e!=null){var h=Math.floor(e/this.timescale_);o.pts=h}if(n!=null){var l=Math.floor(n/this.timescale_);o.dts=l}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},i.prototype.parseSynchronousKLVMetadataPayload=function(t,e,n,s,r){var o=new jt;if(o.pid=s,o.stream_id=r,o.len=t.byteLength,o.data=t,e!=null){var h=Math.floor(e/this.timescale_);o.pts=h}if(n!=null){var l=Math.floor(n/this.timescale_);o.dts=l}o.access_units=function(m){for(var A=[],y=0;y+5<m.byteLength;){var R=m[y+0],I=m[y+1],H=m[y+2],x=m[y+3]<<8|m[y+4]<<0,ee=m.slice(y+5,y+5+x);A.push({service_id:R,sequence_number:I,flags:H,data:ee}),y+=5+x}return A}(t),this.onSynchronousKLVMetadata&&this.onSynchronousKLVMetadata(o)},i.prototype.parseAsynchronousKLVMetadataPayload=function(t,e,n){var s=new Ce;s.pid=e,s.stream_id=n,s.len=t.byteLength,s.data=t,this.onAsynchronousKLVMetadata&&this.onAsynchronousKLVMetadata(s)},i.prototype.parseSMPTE2038MetadataPayload=function(t,e,n,s,r){var o=new Bt;if(o.pid=s,o.stream_id=r,o.len=t.byteLength,o.data=t,e!=null){var h=Math.floor(e/this.timescale_);o.pts=h}if(o.nearest_pts=this.getNearestTimestampMilliseconds(),n!=null){var l=Math.floor(n/this.timescale_);o.dts=l}o.ancillaries=function(m){for(var A=new U(m),y=0,R=[];y+=6,A.readBits(6)===0;){var I=A.readBool();y+=1;var H=A.readBits(11);y+=11;var x=A.readBits(12);y+=12;var ee=255&A.readBits(10);y+=10;var Z=255&A.readBits(10);y+=10;var Y=255&A.readBits(10);y+=10;for(var re=new Uint8Array(Y),fe=0;fe<Y;fe++){var $=255&A.readBits(10);y+=10,re[fe]=$}A.readBits(10),y+=10;var ae="User Defined";ee===65?Z===7&&(ae="SCTE-104"):ee===95?Z===220?ae="ARIB STD-B37 (1SEG)":Z===221?ae="ARIB STD-B37 (ANALOG)":Z===222?ae="ARIB STD-B37 (SD)":Z===223&&(ae="ARIB STD-B37 (HD)"):ee===97&&(Z===1?ae="EIA-708":Z===2&&(ae="EIA-608")),R.push({yc_indicator:I,line_number:H,horizontal_offset:x,did:ee,sdid:Z,user_data:re,description:ae,information:{}}),A.readBits(8-(y-Math.floor(y/8))%8),y+=(8-(y-Math.floor(y/8)))%8}return A.destroy(),A=null,R}(t),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},i.prototype.getNearestTimestampMilliseconds=function(){return this.audio_last_sample_pts_!=null?Math.floor(this.audio_last_sample_pts_):this.last_pcr_!=null?Math.floor(this.last_pcr_/300/this.timescale_):void 0},i.prototype.getPcrBase=function(t){var e=33554432*t[6]+131072*t[7]+512*t[8]+2*t[9]+(128&t[10])/128+this.timestamp_offset_;return e+4294967296<this.last_pcr_base_&&(e+=8589934592,this.timestamp_offset_+=8589934592),this.last_pcr_base_=e,e},i.prototype.getTimestamp=function(t,e){var n=536870912*(14&t[e])+4194304*(255&t[e+1])+16384*(254&t[e+2])+128*(255&t[e+3])+(254&t[e+4])/2+this.timestamp_offset_;return n+4294967296<this.last_pcr_base_&&(n+=8589934592),n},i}(V),rt=function(a,i,t){for(var e,n=0,s=i.length;n<s;n++)!e&&n in i||(e||(e=Array.prototype.slice.call(i,0,n)),e[n]=i[n]);return a.concat(e||Array.prototype.slice.call(i))},st=function(){function a(){}return a.init=function(){for(var i in a.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],Opus:[],dOps:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[],fLaC:[],dfLa:[]},a.types)a.types.hasOwnProperty(i)&&(a.types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]);var t=a.constants={};t.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),t.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),t.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSC=t.STCO=t.STTS,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),t.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),t.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},a.box=function(i){for(var t=8,e=null,n=Array.prototype.slice.call(arguments,1),s=n.length,r=0;r<s;r++)t+=n[r].byteLength;(e=new Uint8Array(t))[0]=t>>>24&255,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=255&t,e.set(i,4);var o=8;for(r=0;r<s;r++)e.set(n[r],o),o+=n[r].byteLength;return e},a.generateInitSegment=function(i){var t=a.box(a.types.ftyp,a.constants.FTYP),e=a.moov(i),n=new Uint8Array(t.byteLength+e.byteLength);return n.set(t,0),n.set(e,t.byteLength),n},a.moov=function(i){var t=a.mvhd(i.timescale,i.duration),e=a.trak(i),n=a.mvex(i);return a.box(a.types.moov,t,e,n)},a.mvhd=function(i,t){return a.box(a.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},a.trak=function(i){return a.box(a.types.trak,a.tkhd(i),a.mdia(i))},a.tkhd=function(i){var t=i.id,e=i.duration,n=i.presentWidth,s=i.presentHeight;return a.box(a.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,s>>>8&255,255&s,0,0]))},a.mdia=function(i){return a.box(a.types.mdia,a.mdhd(i),a.hdlr(i),a.minf(i))},a.mdhd=function(i){var t=i.timescale,e=i.duration;return a.box(a.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,85,196,0,0]))},a.hdlr=function(i){var t=null;return t=i.type==="audio"?a.constants.HDLR_AUDIO:a.constants.HDLR_VIDEO,a.box(a.types.hdlr,t)},a.minf=function(i){var t=null;return t=i.type==="audio"?a.box(a.types.smhd,a.constants.SMHD):a.box(a.types.vmhd,a.constants.VMHD),a.box(a.types.minf,t,a.dinf(),a.stbl(i))},a.dinf=function(){return a.box(a.types.dinf,a.box(a.types.dref,a.constants.DREF))},a.stbl=function(i){return a.box(a.types.stbl,a.stsd(i),a.box(a.types.stts,a.constants.STTS),a.box(a.types.stsc,a.constants.STSC),a.box(a.types.stsz,a.constants.STSZ),a.box(a.types.stco,a.constants.STCO))},a.stsd=function(i){return i.type==="audio"?i.codec==="mp3"?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.mp3(i)):i.codec==="ac-3"?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.ac3(i)):i.codec==="ec-3"?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.ec3(i)):i.codec==="opus"?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.Opus(i)):i.codec=="flac"?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.fLaC(i)):a.box(a.types.stsd,a.constants.STSD_PREFIX,a.mp4a(i)):i.type==="video"&&i.codec.startsWith("hvc1")?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.hvc1(i)):i.type==="video"&&i.codec.startsWith("av01")?a.box(a.types.stsd,a.constants.STSD_PREFIX,a.av01(i)):a.box(a.types.stsd,a.constants.STSD_PREFIX,a.avc1(i))},a.mp3=function(i){var t=i.channelCount,e=i.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types[".mp3"],n)},a.mp4a=function(i){var t=i.channelCount,e=i.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types.mp4a,n,a.esds(i))},a.ac3=function(i){var t=i.channelCount,e=i.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types["ac-3"],n,a.box(a.types.dac3,new Uint8Array(i.config)))},a.ec3=function(i){var t=i.channelCount,e=i.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types["ec-3"],n,a.box(a.types.dec3,new Uint8Array(i.config)))},a.esds=function(i){var t=i.config||[],e=t.length,n=new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t).concat([6,1,2]));return a.box(a.types.esds,n)},a.Opus=function(i){var t=i.channelCount,e=i.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types.Opus,n,a.dOps(i))},a.dOps=function(i){var t=i.channelCount,e=i.channelConfigCode,n=i.audioSampleRate;if(i.config)return a.box(a.types.dOps,i.config);var s=[];switch(e){case 1:case 2:s=[0];break;case 0:s=[255,1,1,0,1];break;case 128:s=[255,2,0,0,1];break;case 3:s=[1,2,1,0,2,1];break;case 4:s=[1,2,2,0,1,2,3];break;case 5:s=[1,3,2,0,4,1,2,3];break;case 6:s=[1,4,2,0,4,1,2,3,5];break;case 7:s=[1,4,2,0,4,1,2,3,5,6];break;case 8:s=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:s=[1,1,2,0,1];break;case 131:s=[1,1,3,0,1,2];break;case 132:s=[1,1,4,0,1,2,3];break;case 133:s=[1,1,5,0,1,2,3,4];break;case 134:s=[1,1,6,0,1,2,3,4,5];break;case 135:s=[1,1,7,0,1,2,3,4,5,6];break;case 136:s=[1,1,8,0,1,2,3,4,5,6,7]}var r=new Uint8Array(rt([0,t,0,0,n>>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],s));return a.box(a.types.dOps,r)},a.fLaC=function(i){var t=i.channelCount,e=Math.min(i.audioSampleRate,65535),n=i.sampleSize,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,n,0,0,0,0,e>>>8&255,255&e,0,0]);return a.box(a.types.fLaC,s,a.dfLa(i))},a.dfLa=function(i){var t=new Uint8Array(rt([0,0,0,0],i.config));return a.box(a.types.dfLa,t)},a.avc1=function(i){var t=i.avcc,e=i.codecWidth,n=i.codecHeight,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e>>>8&255,255&e,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return a.box(a.types.avc1,s,a.box(a.types.avcC,t))},a.hvc1=function(i){var t=i.hvcc,e=i.codecWidth,n=i.codecHeight,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e>>>8&255,255&e,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return a.box(a.types.hvc1,s,a.box(a.types.hvcC,t))},a.av01=function(i){var t=i.av1c,e=i.codecWidth||192,n=i.codecHeight||108,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e>>>8&255,255&e,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return a.box(a.types.av01,s,a.box(a.types.av1C,t))},a.mvex=function(i){return a.box(a.types.mvex,a.trex(i))},a.trex=function(i){var t=i.id,e=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return a.box(a.types.trex,e)},a.moof=function(i,t){return a.box(a.types.moof,a.mfhd(i.sequenceNumber),a.traf(i,t))},a.mfhd=function(i){var t=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]);return a.box(a.types.mfhd,t)},a.traf=function(i,t){var e=i.id,n=a.box(a.types.tfhd,new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])),s=a.box(a.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),r=a.sdtp(i),o=a.trun(i,r.byteLength+16+16+8+16+8+8);return a.box(a.types.traf,n,s,o,r)},a.sdtp=function(i){for(var t=i.samples||[],e=t.length,n=new Uint8Array(4+e),s=0;s<e;s++){var r=t[s].flags;n[s+4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy}return a.box(a.types.sdtp,n)},a.trun=function(i,t){var e=i.samples||[],n=e.length,s=12+16*n,r=new Uint8Array(s);t+=8+s,r.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(var o=0;o<n;o++){var h=e[o].duration,l=e[o].size,m=e[o].flags,A=e[o].cts;r.set([h>>>24&255,h>>>16&255,h>>>8&255,255&h,l>>>24&255,l>>>16&255,l>>>8&255,255&l,m.isLeading<<2|m.dependsOn,m.isDependedOn<<6|m.hasRedundancy<<4|m.isNonSync,0,0,A>>>24&255,A>>>16&255,A>>>8&255,255&A],12+16*o)}return a.box(a.types.trun,r)},a.mdat=function(i){return a.box(a.types.mdat,i)},a}();st.init();var je=st,ot=function(){function a(){}return a.getSilentFrame=function(i,t){if(i==="mp4a.40.2"){if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},a}(),Ne=B(11),dt=function(){function a(i){this.TAG="MP4Remuxer",this._config=i,this._isLive=i.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ne.c("audio"),this._videoSegmentInfoList=new Ne.c("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!v.a.chrome||!(v.a.version.major<50||v.a.version.major===50&&v.a.version.build<2661)),this._fillSilentAfterSeek=v.a.msedge||v.a.msie,this._mp3UseMpegAudio=!v.a.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return a.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},a.prototype.bindDataSource=function(i){return i.onDataAvailable=this.remux.bind(this),i.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(a.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(i){this._onInitSegment=i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(i){this._onMediaSegment=i},enumerable:!1,configurable:!0}),a.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},a.prototype.seek=function(i){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},a.prototype.remux=function(i,t){if(!this._onMediaSegment)throw new L.a("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(i,t),t&&this._remuxVideo(t),i&&this._remuxAudio(i)},a.prototype._onTrackMetadataReceived=function(i,t){var e=null,n="mp4",s=t.codec;if(i==="audio")this._audioMeta=t,t.codec==="mp3"&&this._mp3UseMpegAudio?(n="mpeg",s="",e=new Uint8Array):e=je.generateInitSegment(t);else{if(i!=="video")return;this._videoMeta=t,e=je.generateInitSegment(t)}if(!this._onInitSegment)throw new L.a("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(i,{type:i,data:e.buffer,codec:s,container:"".concat(i,"/").concat(n),mediaDuration:t.duration})},a.prototype._calculateDtsBase=function(i,t){this._dtsBaseInited||(i&&i.samples&&i.samples.length&&(this._audioDtsBase=i.samples[0].dts),t&&t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},a.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},a.prototype.flushStashedSamples=function(){var i=this._videoStashedLastSample,t=this._audioStashedLastSample,e={type:"video",id:1,sequenceNumber:0,samples:[],length:0};i!=null&&(e.samples.push(i),e.length=i.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};t!=null&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(e,!0),this._remuxAudio(n,!0)},a.prototype._remuxAudio=function(i,t){if(this._audioMeta!=null){var e,n=i,s=n.samples,r=void 0,o=-1,h=this._audioMeta.refSampleDuration,l=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,m=this._dtsBaseInited&&this._audioNextDts===void 0,A=!1;if(s&&s.length!==0&&(s.length!==1||t)){var y=0,R=null,I=0;l?(y=0,I=n.length):(y=8,I=8+n.length);var H=null;if(s.length>1&&(I-=(H=s.pop()).length),this._audioStashedLastSample!=null){var x=this._audioStashedLastSample;this._audioStashedLastSample=null,s.unshift(x),I+=x.length}H!=null&&(this._audioStashedLastSample=H);var ee=s[0].dts-this._dtsBase;if(this._audioNextDts)r=ee-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())r=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(A=!0);else{var Z=this._audioSegmentInfoList.getLastSampleBefore(ee);if(Z!=null){var Y=ee-(Z.originalDts+Z.duration);Y<=3&&(Y=0),r=ee-(Z.dts+Z.duration+Y)}else r=0}if(A){var re=ee-r,fe=this._videoSegmentInfoList.getLastSegmentBefore(ee);if(fe!=null&&fe.beginDts<re){if(Le=ot.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount)){var $=fe.beginDts,ae=re-fe.beginDts;p.a.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat($,", duration: ").concat(ae)),s.unshift({unit:Le,dts:$,pts:$}),I+=Le.byteLength}}else A=!1}for(var pe=[],se=0;se<s.length;se++){var ce=(x=s[se]).unit,Se=x.dts-this._dtsBase,Ae=($=Se,!1),he=null,me=0;if(!(Se<-.001)){if(this._audioMeta.codec!=="mp3"&&h!=null){var Re=Se;if(this._audioNextDts&&(Re=this._audioNextDts),(r=Se-Re)<=-3*h){p.a.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(Se," ms ,curRefDts: ").concat(Re," ms) due to dtsCorrection: ").concat(r," ms overlap."));continue}if(r>=3*h&&this._fillAudioTimestampGap&&!v.a.safari){Ae=!0;var Le,xe=Math.floor(r/h);p.a.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. 2`+"originalDts: ".concat(Se," ms, curRefDts: ").concat(Re," ms, ")+"dtsCorrection: ".concat(Math.round(r)," ms, generate: ").concat(xe," frames")),$=Math.floor(Re),me=Math.floor(Re+h)-$,(Le=ot.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))==null&&(p.a.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Le=ce),he=[];for(var De=0;De<xe;De++){Re+=h;var Pe=Math.floor(Re),Be=Math.floor(Re+h)-Pe,Oe={dts:Pe,pts:Pe,cts:0,unit:Le,size:Le.byteLength,duration:Be,originalDts:Se,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};he.push(Oe),I+=Oe.size}this._audioNextDts=Re+h}else $=Math.floor(Re),me=Math.floor(Re+h)-$,this._audioNextDts=Re+h}else $=Se-r,se!==s.length-1?me=s[se+1].dts-this._dtsBase-r-$:H!=null?me=H.dts-this._dtsBase-r-$:me=pe.length>=1?pe[pe.length-1].duration:Math.floor(h),this._audioNextDts=$+me;o===-1&&(o=$),pe.push({dts:$,pts:$,cts:0,unit:x.unit,size:x.unit.byteLength,duration:me,originalDts:Se,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ae&&pe.push.apply(pe,he)}}if(pe.length===0)return n.samples=[],void(n.length=0);for(l?R=new Uint8Array(I):((R=new Uint8Array(I))[0]=I>>>24&255,R[1]=I>>>16&255,R[2]=I>>>8&255,R[3]=255&I,R.set(je.types.mdat,4)),se=0;se<pe.length;se++)ce=pe[se].unit,R.set(ce,y),y+=ce.byteLength;var Ie=pe[pe.length-1];e=Ie.dts+Ie.duration;var be=new Ne.b;be.beginDts=o,be.endDts=e,be.beginPts=o,be.endPts=e,be.originalBeginDts=pe[0].originalDts,be.originalEndDts=Ie.originalDts+Ie.duration,be.firstSample=new Ne.d(pe[0].dts,pe[0].pts,pe[0].duration,pe[0].originalDts,!1),be.lastSample=new Ne.d(Ie.dts,Ie.pts,Ie.duration,Ie.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(be),n.samples=pe,n.sequenceNumber++;var Ve=null;Ve=l?new Uint8Array:je.moof(n,o),n.samples=[],n.length=0;var Fe={type:"audio",data:this._mergeBoxes(Ve,R).buffer,sampleCount:pe.length,info:be};l&&m&&(Fe.timestampOffset=o),this._onMediaSegment("audio",Fe)}}},a.prototype._remuxVideo=function(i,t){if(this._videoMeta!=null){var e,n,s=i,r=s.samples,o=void 0,h=-1,l=-1;if(r&&r.length!==0&&(r.length!==1||t)){var m=8,A=null,y=8+i.length,R=null;if(r.length>1&&(y-=(R=r.pop()).length),this._videoStashedLastSample!=null){var I=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(I),y+=I.length}R!=null&&(this._videoStashedLastSample=R);var H=r[0].dts-this._dtsBase;if(this._videoNextDts)o=H-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var x=this._videoSegmentInfoList.getLastSampleBefore(H);if(x!=null){var ee=H-(x.originalDts+x.duration);ee<=3&&(ee=0),o=H-(x.dts+x.duration+ee)}else o=0}for(var Z=new Ne.b,Y=[],re=0;re<r.length;re++){var fe=(I=r[re]).dts-this._dtsBase,$=I.isKeyframe,ae=fe-o,pe=I.cts,se=ae+pe;h===-1&&(h=ae,l=se);var ce=0;if(re!==r.length-1?ce=r[re+1].dts-this._dtsBase-o-ae:R!=null?ce=R.dts-this._dtsBase-o-ae:ce=Y.length>=1?Y[Y.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),$){var Se=new Ne.d(ae,se,ce,I.dts,!0);Se.fileposition=I.fileposition,Z.appendSyncPoint(Se)}Y.push({dts:ae,pts:se,cts:pe,units:I.units,size:I.length,isKeyframe:$,duration:ce,originalDts:fe,flags:{isLeading:0,dependsOn:$?2:1,isDependedOn:$?1:0,hasRedundancy:0,isNonSync:$?0:1}})}for((A=new Uint8Array(y))[0]=y>>>24&255,A[1]=y>>>16&255,A[2]=y>>>8&255,A[3]=255&y,A.set(je.types.mdat,4),re=0;re<Y.length;re++)for(var Ae=Y[re].units;Ae.length;){var he=Ae.shift().data;A.set(he,m),m+=he.byteLength}var me=Y[Y.length-1];if(e=me.dts+me.duration,n=me.pts+me.duration,this._videoNextDts=e,Z.beginDts=h,Z.endDts=e,Z.beginPts=l,Z.endPts=n,Z.originalBeginDts=Y[0].originalDts,Z.originalEndDts=me.originalDts+me.duration,Z.firstSample=new Ne.d(Y[0].dts,Y[0].pts,Y[0].duration,Y[0].originalDts,Y[0].isKeyframe),Z.lastSample=new Ne.d(me.dts,me.pts,me.duration,me.originalDts,me.isKeyframe),this._isLive||this._videoSegmentInfoList.append(Z),s.samples=Y,s.sequenceNumber++,this._forceFirstIDR){var Re=Y[0].flags;Re.dependsOn=2,Re.isNonSync=0}var Le=je.moof(s,h);s.samples=[],s.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Le,A).buffer,sampleCount:Y.length,info:Z})}}},a.prototype._mergeBoxes=function(i,t){var e=new Uint8Array(i.byteLength+t.byteLength);return e.set(i,0),e.set(t,i.byteLength),e},a}(),qt=B(14),Me=B(1),Kt=(B(2),function(){function a(i,t){this.TAG="TransmuxingController",this._emitter=new w.a,this._config=t,i.segments||(i.segments=[{duration:i.duration,filesize:i.filesize,url:i.url}]),typeof i.cors!="boolean"&&(i.cors=!0),typeof i.withCredentials!="boolean"&&(i.withCredentials=!1),this._mediaDataSource=i,this._currentSegmentIndex=0;var e=0;this._mediaDataSource.segments.forEach(function(n){n.timestampBase=e,e+=n.duration,n.cors=i.cors,n.withCredentials=i.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)}),isNaN(e)||this._mediaDataSource.duration===e||(this._mediaDataSource.duration=e),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return a.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},a.prototype.on=function(i,t){this._emitter.addListener(i,t)},a.prototype.off=function(i,t){this._emitter.removeListener(i,t)},a.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},a.prototype._loadSegment=function(i,t){this._currentSegmentIndex=i;var e=this._mediaDataSource.segments[i],n=this._ioctl=new qt.a(e,this._config,i);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)},a.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},a.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},a.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},a.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},a.prototype.seek=function(i){if(this._mediaInfo!=null&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(i);if(t===this._currentSegmentIndex){var e=this._mediaInfo.segments[t];if(e==null)this._pendingSeekTime=i;else{var n=e.getNearestKeyframe(i);this._remuxer.seek(n.milliseconds),this._ioctl.seek(n.fileposition),this._pendingResolveSeekPoint=n.milliseconds}}else{var s=this._mediaInfo.segments[t];s==null?(this._pendingSeekTime=i,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t)):(n=s.getNearestKeyframe(i),this._internalAbort(),this._remuxer.seek(i),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t))}this._enableStatisticsReporter()}},a.prototype._searchSegmentIndexContains=function(i){for(var t=this._mediaDataSource.segments,e=t.length-1,n=0;n<t.length;n++)if(i<t[n].timestampBase){e=n-1;break}return e},a.prototype._onInitChunkArrival=function(i,t){var e=this,n=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(i,t);else{var s=null;(s=f.probe(i)).match&&(this._setupFLVDemuxerRemuxer(s),n=this._demuxer.parseChunks(i,t)),s.match||s.needMoreData||(s=nt.probe(i)).match&&(this._setupTSDemuxerRemuxer(s),n=this._demuxer.parseChunks(i,t)),s.match||s.needMoreData||(s=null,p.a.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){e._internalAbort()}),this._emitter.emit(Me.a.DEMUX_ERROR,P.a.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return n},a.prototype._setupFLVDemuxerRemuxer=function(i){this._demuxer=new f(i,this._config),this._remuxer||(this._remuxer=new dt(this._config));var t=this._mediaDataSource;t.duration==null||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),typeof t.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=t.hasAudio),typeof t.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=t.hasVideo),this._demuxer.timestampBase=t.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},a.prototype._setupTSDemuxerRemuxer=function(i){var t=this._demuxer=new nt(i,this._config);this._remuxer||(this._remuxer=new dt(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),t.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},a.prototype._onMediaInfo=function(i){var t=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},i),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,S.a.prototype));var e=Object.assign({},i);Object.setPrototypeOf(e,S.a.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=e,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var n=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(n)})},a.prototype._onMetaDataArrived=function(i){this._emitter.emit(Me.a.METADATA_ARRIVED,i)},a.prototype._onScriptDataArrived=function(i){this._emitter.emit(Me.a.SCRIPTDATA_ARRIVED,i)},a.prototype._onTimedID3Metadata=function(i){var t=this._remuxer.getTimestampBase();t!=null&&(i.pts!=null&&(i.pts-=t),i.dts!=null&&(i.dts-=t),this._emitter.emit(Me.a.TIMED_ID3_METADATA_ARRIVED,i))},a.prototype._onSynchronousKLVMetadata=function(i){var t=this._remuxer.getTimestampBase();t!=null&&(i.pts!=null&&(i.pts-=t),i.dts!=null&&(i.dts-=t),this._emitter.emit(Me.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,i))},a.prototype._onAsynchronousKLVMetadata=function(i){this._emitter.emit(Me.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,i)},a.prototype._onSMPTE2038Metadata=function(i){var t=this._remuxer.getTimestampBase();t!=null&&(i.pts!=null&&(i.pts-=t),i.dts!=null&&(i.dts-=t),i.nearest_pts!=null&&(i.nearest_pts-=t),this._emitter.emit(Me.a.SMPTE2038_METADATA_ARRIVED,i))},a.prototype._onSCTE35Metadata=function(i){var t=this._remuxer.getTimestampBase();t!=null&&(i.pts!=null&&(i.pts-=t),i.nearest_pts!=null&&(i.nearest_pts-=t),this._emitter.emit(Me.a.SCTE35_METADATA_ARRIVED,i))},a.prototype._onPESPrivateDataDescriptor=function(i){this._emitter.emit(Me.a.PES_PRIVATE_DATA_DESCRIPTOR,i)},a.prototype._onPESPrivateData=function(i){var t=this._remuxer.getTimestampBase();t!=null&&(i.pts!=null&&(i.pts-=t),i.nearest_pts!=null&&(i.nearest_pts-=t),i.dts!=null&&(i.dts-=t),this._emitter.emit(Me.a.PES_PRIVATE_DATA_ARRIVED,i))},a.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},a.prototype._onIOComplete=function(i){var t=i+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Me.a.LOADING_COMPLETE),this._disableStatisticsReporter())},a.prototype._onIORedirect=function(i){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=i},a.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Me.a.RECOVERED_EARLY_EOF)},a.prototype._onIOException=function(i,t){p.a.e(this.TAG,"IOException: type = ".concat(i,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(Me.a.IO_ERROR,i,t),this._disableStatisticsReporter()},a.prototype._onDemuxException=function(i,t){p.a.e(this.TAG,"DemuxException: type = ".concat(i,", info = ").concat(t)),this._emitter.emit(Me.a.DEMUX_ERROR,i,t)},a.prototype._onRemuxerInitSegmentArrival=function(i,t){this._emitter.emit(Me.a.INIT_SEGMENT,i,t)},a.prototype._onRemuxerMediaSegmentArrival=function(i,t){if(this._pendingSeekTime==null&&(this._emitter.emit(Me.a.MEDIA_SEGMENT,i,t),this._pendingResolveSeekPoint!=null&&i==="video")){var e=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,v.a.safari&&e.length>0&&e[0].originalDts===n&&(n=e[0].pts),this._emitter.emit(Me.a.RECOMMEND_SEEKPOINT,n)}},a.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},a.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},a.prototype._reportSegmentMediaInfo=function(i){var t=this._mediaInfo.segments[i],e=Object.assign({},t);e.duration=this._mediaInfo.duration,e.segmentCount=this._mediaInfo.segmentCount,delete e.segments,delete e.keyframesIndex,this._emitter.emit(Me.a.MEDIA_INFO,e)},a.prototype._reportStatisticsInfo=function(){var i={};i.url=this._ioctl.currentURL,i.hasRedirect=this._ioctl.hasRedirect,i.hasRedirect&&(i.redirectedURL=this._ioctl.currentRedirectedURL),i.speed=this._ioctl.currentSpeed,i.loaderType=this._ioctl.loaderType,i.currentSegmentIndex=this._currentSegmentIndex,i.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Me.a.STATISTICS_INFO,i)},a}());te.a=Kt},function(ge,te,B){var G,w=B(0),p=function(){function D(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return D.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},D.prototype.addBytes=function(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())},Object.defineProperty(D.prototype,"currentKBps",{get:function(){this.addBytes(0);var c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"averageKBps",{get:function(){var c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024},enumerable:!1,configurable:!0}),D}(),v=B(2),S=B(5),g=B(3),T=(G=function(D,c){return(G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,d){_.__proto__=d}||function(_,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(_[f]=d[f])})(D,c)},function(D,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function _(){this.constructor=D}G(D,c),D.prototype=c===null?Object.create(c):(_.prototype=c.prototype,new _)}),E=function(D){function c(_,d){var f=D.call(this,"fetch-stream-loader")||this;return f.TAG="FetchStreamLoader",f._seekHandler=_,f._config=d,f._needStash=!0,f._requestAbort=!1,f._abortController=null,f._contentLength=null,f._receivedLength=0,f}return T(c,D),c.isSupported=function(){try{var _=S.a.msedge&&S.a.version.minor>=15048,d=!S.a.msedge||_;return self.fetch&&self.ReadableStream&&d}catch{return!1}},c.prototype.destroy=function(){this.isWorking()&&this.abort(),D.prototype.destroy.call(this)},c.prototype.open=function(_,d){var f=this;this._dataSource=_,this._range=d;var V=_.url;this._config.reuseRedirectedURL&&_.redirectedURL!=null&&(V=_.redirectedURL);var J=this._seekHandler.getConfig(V,d),F=new self.Headers;if(typeof J.headers=="object"){var K=J.headers;for(var oe in K)K.hasOwnProperty(oe)&&F.append(oe,K[oe])}var Ee={method:"GET",headers:F,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var oe in this._config.headers)F.append(oe,this._config.headers[oe]);_.cors===!1&&(Ee.mode="same-origin"),_.withCredentials&&(Ee.credentials="include"),_.referrerPolicy&&(Ee.referrerPolicy=_.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,Ee.signal=this._abortController.signal),this._status=v.c.kConnecting,self.fetch(J.url,Ee).then(function(_e){if(f._requestAbort)return f._status=v.c.kIdle,void _e.body.cancel();if(_e.ok&&_e.status>=200&&_e.status<=299){if(_e.url!==J.url&&f._onURLRedirect){var b=f._seekHandler.removeURLParameters(_e.url);f._onURLRedirect(b)}var u=_e.headers.get("Content-Length");return u!=null&&(f._contentLength=parseInt(u),f._contentLength!==0&&f._onContentLengthKnown&&f._onContentLengthKnown(f._contentLength)),f._pump.call(f,_e.body.getReader())}if(f._status=v.c.kError,!f._onError)throw new g.d("FetchStreamLoader: Http code invalid, "+_e.status+" "+_e.statusText);f._onError(v.b.HTTP_STATUS_CODE_INVALID,{code:_e.status,msg:_e.statusText})}).catch(function(_e){if(!f._abortController||!f._abortController.signal.aborted){if(f._status=v.c.kError,!f._onError)throw _e;f._onError(v.b.EXCEPTION,{code:-1,msg:_e.message})}})},c.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==v.c.kBuffering||!S.a.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},c.prototype._pump=function(_){var d=this;return _.read().then(function(f){if(f.done)if(d._contentLength!==null&&d._receivedLength<d._contentLength){d._status=v.c.kError;var V=v.b.EARLY_EOF,J={code:-1,msg:"Fetch stream meet Early-EOF"};if(!d._onError)throw new g.d(J.msg);d._onError(V,J)}else d._status=v.c.kComplete,d._onComplete&&d._onComplete(d._range.from,d._range.from+d._receivedLength-1);else{if(d._abortController&&d._abortController.signal.aborted)return void(d._status=v.c.kComplete);if(d._requestAbort===!0)return d._status=v.c.kComplete,_.cancel();d._status=v.c.kBuffering;var F=f.value.buffer,K=d._range.from+d._receivedLength;d._receivedLength+=F.byteLength,d._onDataArrival&&d._onDataArrival(F,K,d._receivedLength),d._pump(_)}}).catch(function(f){if(d._abortController&&d._abortController.signal.aborted)d._status=v.c.kComplete;else if(f.code!==11||!S.a.msedge){d._status=v.c.kError;var V=0,J=null;if(f.code!==19&&f.message!=="network error"||!(d._contentLength===null||d._contentLength!==null&&d._receivedLength<d._contentLength)?(V=v.b.EXCEPTION,J={code:f.code,msg:f.message}):(V=v.b.EARLY_EOF,J={code:f.code,msg:"Fetch stream meet Early-EOF"}),!d._onError)throw new g.d(J.msg);d._onError(V,J)}})},c}(v.a),L=function(){var D=function(c,_){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var V in f)Object.prototype.hasOwnProperty.call(f,V)&&(d[V]=f[V])})(c,_)};return function(c,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function d(){this.constructor=c}D(c,_),c.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)}}(),O=function(D){function c(_,d){var f=D.call(this,"xhr-moz-chunked-loader")||this;return f.TAG="MozChunkedLoader",f._seekHandler=_,f._config=d,f._needStash=!0,f._xhr=null,f._requestAbort=!1,f._contentLength=null,f._receivedLength=0,f}return L(c,D),c.isSupported=function(){try{var _=new XMLHttpRequest;return _.open("GET","https://example.com",!0),_.responseType="moz-chunked-arraybuffer",_.responseType==="moz-chunked-arraybuffer"}catch(d){return w.a.w("MozChunkedLoader",d.message),!1}},c.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),D.prototype.destroy.call(this)},c.prototype.open=function(_,d){this._dataSource=_,this._range=d;var f=_.url;this._config.reuseRedirectedURL&&_.redirectedURL!=null&&(f=_.redirectedURL);var V=this._seekHandler.getConfig(f,d);this._requestURL=V.url;var J=this._xhr=new XMLHttpRequest;if(J.open("GET",V.url,!0),J.responseType="moz-chunked-arraybuffer",J.onreadystatechange=this._onReadyStateChange.bind(this),J.onprogress=this._onProgress.bind(this),J.onloadend=this._onLoadEnd.bind(this),J.onerror=this._onXhrError.bind(this),_.withCredentials&&(J.withCredentials=!0),typeof V.headers=="object"){var F=V.headers;for(var K in F)F.hasOwnProperty(K)&&J.setRequestHeader(K,F[K])}if(typeof this._config.headers=="object"){F=this._config.headers;for(var K in F)F.hasOwnProperty(K)&&J.setRequestHeader(K,F[K])}this._status=v.c.kConnecting,J.send()},c.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=v.c.kComplete},c.prototype._onReadyStateChange=function(_){var d=_.target;if(d.readyState===2){if(d.responseURL!=null&&d.responseURL!==this._requestURL&&this._onURLRedirect){var f=this._seekHandler.removeURLParameters(d.responseURL);this._onURLRedirect(f)}if(d.status!==0&&(d.status<200||d.status>299)){if(this._status=v.c.kError,!this._onError)throw new g.d("MozChunkedLoader: Http code invalid, "+d.status+" "+d.statusText);this._onError(v.b.HTTP_STATUS_CODE_INVALID,{code:d.status,msg:d.statusText})}else this._status=v.c.kBuffering}},c.prototype._onProgress=function(_){if(this._status!==v.c.kError){this._contentLength===null&&_.total!==null&&_.total!==0&&(this._contentLength=_.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var d=_.target.response,f=this._range.from+this._receivedLength;this._receivedLength+=d.byteLength,this._onDataArrival&&this._onDataArrival(d,f,this._receivedLength)}},c.prototype._onLoadEnd=function(_){this._requestAbort!==!0?this._status!==v.c.kError&&(this._status=v.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},c.prototype._onXhrError=function(_){this._status=v.c.kError;var d=0,f=null;if(this._contentLength&&_.loaded<this._contentLength?(d=v.b.EARLY_EOF,f={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(d=v.b.EXCEPTION,f={code:-1,msg:_.constructor.name+" "+_.type}),!this._onError)throw new g.d(f.msg);this._onError(d,f)},c}(v.a),M=function(){var D=function(c,_){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var V in f)Object.prototype.hasOwnProperty.call(f,V)&&(d[V]=f[V])})(c,_)};return function(c,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function d(){this.constructor=c}D(c,_),c.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)}}(),U=(function(D){function c(_,d){var f=D.call(this,"xhr-msstream-loader")||this;return f.TAG="MSStreamLoader",f._seekHandler=_,f._config=d,f._needStash=!0,f._xhr=null,f._reader=null,f._totalRange=null,f._currentRange=null,f._currentRequestURL=null,f._currentRedirectedURL=null,f._contentLength=null,f._receivedLength=0,f._bufferLimit=16777216,f._lastTimeBufferSize=0,f._isReconnecting=!1,f}M(c,D),c.isSupported=function(){try{if(self.MSStream===void 0||self.MSStreamReader===void 0)return!1;var _=new XMLHttpRequest;return _.open("GET","https://example.com",!0),_.responseType="ms-stream",_.responseType==="ms-stream"}catch(d){return w.a.w("MSStreamLoader",d.message),!1}},c.prototype.destroy=function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),D.prototype.destroy.call(this)},c.prototype.open=function(_,d){this._internalOpen(_,d,!1)},c.prototype._internalOpen=function(_,d,f){this._dataSource=_,f?this._currentRange=d:this._totalRange=d;var V=_.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?V=this._currentRedirectedURL:_.redirectedURL!=null&&(V=_.redirectedURL));var J=this._seekHandler.getConfig(V,d);this._currentRequestURL=J.url;var F=this._reader=new self.MSStreamReader;F.onprogress=this._msrOnProgress.bind(this),F.onload=this._msrOnLoad.bind(this),F.onerror=this._msrOnError.bind(this);var K=this._xhr=new XMLHttpRequest;if(K.open("GET",J.url,!0),K.responseType="ms-stream",K.onreadystatechange=this._xhrOnReadyStateChange.bind(this),K.onerror=this._xhrOnError.bind(this),_.withCredentials&&(K.withCredentials=!0),typeof J.headers=="object"){var oe=J.headers;for(var Ee in oe)oe.hasOwnProperty(Ee)&&K.setRequestHeader(Ee,oe[Ee])}if(typeof this._config.headers=="object"){oe=this._config.headers;for(var Ee in oe)oe.hasOwnProperty(Ee)&&K.setRequestHeader(Ee,oe[Ee])}this._isReconnecting?this._isReconnecting=!1:this._status=v.c.kConnecting,K.send()},c.prototype.abort=function(){this._internalAbort(),this._status=v.c.kComplete},c.prototype._internalAbort=function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)},c.prototype._xhrOnReadyStateChange=function(_){var d=_.target;if(d.readyState===2)if(d.status>=200&&d.status<=299){if(this._status=v.c.kBuffering,d.responseURL!=null){var f=this._seekHandler.removeURLParameters(d.responseURL);d.responseURL!==this._currentRequestURL&&f!==this._currentRedirectedURL&&(this._currentRedirectedURL=f,this._onURLRedirect&&this._onURLRedirect(f))}var V=d.getResponseHeader("Content-Length");if(V!=null&&this._contentLength==null){var J=parseInt(V);J>0&&(this._contentLength=J,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=v.c.kError,!this._onError)throw new g.d("MSStreamLoader: Http code invalid, "+d.status+" "+d.statusText);this._onError(v.b.HTTP_STATUS_CODE_INVALID,{code:d.status,msg:d.statusText})}else if(d.readyState===3&&d.status>=200&&d.status<=299){this._status=v.c.kBuffering;var F=d.response;this._reader.readAsArrayBuffer(F)}},c.prototype._xhrOnError=function(_){this._status=v.c.kError;var d=v.b.EXCEPTION,f={code:-1,msg:_.constructor.name+" "+_.type};if(!this._onError)throw new g.d(f.msg);this._onError(d,f)},c.prototype._msrOnProgress=function(_){var d=_.target.result;if(d!=null){var f=d.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=d.byteLength;var V=this._totalRange.from+this._receivedLength;this._receivedLength+=f.byteLength,this._onDataArrival&&this._onDataArrival(f,V,this._receivedLength),d.byteLength>=this._bufferLimit&&(w.a.v(this.TAG,"MSStream buffer exceeded max size near ".concat(V+f.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()},c.prototype._doReconnectIfNeeded=function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var _={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,_,!0)}},c.prototype._msrOnLoad=function(_){this._status=v.c.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)},c.prototype._msrOnError=function(_){this._status=v.c.kError;var d=0,f=null;if(this._contentLength&&this._receivedLength<this._contentLength?(d=v.b.EARLY_EOF,f={code:-1,msg:"MSStream meet Early-Eof"}):(d=v.b.EARLY_EOF,f={code:-1,msg:_.constructor.name+" "+_.type}),!this._onError)throw new g.d(f.msg);this._onError(d,f)}}(v.a),function(){var D=function(c,_){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var V in f)Object.prototype.hasOwnProperty.call(f,V)&&(d[V]=f[V])})(c,_)};return function(c,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function d(){this.constructor=c}D(c,_),c.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)}}()),N=function(D){function c(_,d){var f=D.call(this,"xhr-range-loader")||this;return f.TAG="RangeLoader",f._seekHandler=_,f._config=d,f._needStash=!1,f._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],f._currentChunkSizeKB=384,f._currentSpeedNormalized=0,f._zeroSpeedChunkCount=0,f._xhr=null,f._speedSampler=new p,f._requestAbort=!1,f._waitForTotalLength=!1,f._totalLengthReceived=!1,f._currentRequestURL=null,f._currentRedirectedURL=null,f._currentRequestRange=null,f._totalLength=null,f._contentLength=null,f._receivedLength=0,f._lastTimeLoaded=0,f}return U(c,D),c.isSupported=function(){try{var _=new XMLHttpRequest;return _.open("GET","https://example.com",!0),_.responseType="arraybuffer",_.responseType==="arraybuffer"}catch(d){return w.a.w("RangeLoader",d.message),!1}},c.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),D.prototype.destroy.call(this)},Object.defineProperty(c.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),c.prototype.open=function(_,d){this._dataSource=_,this._range=d,this._status=v.c.kConnecting;var f=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(f=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||f?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},c.prototype._openSubRange=function(){var _=1024*this._currentChunkSizeKB,d=this._range.from+this._receivedLength,f=d+_;this._contentLength!=null&&f-this._range.from>=this._contentLength&&(f=this._range.from+this._contentLength-1),this._currentRequestRange={from:d,to:f},this._internalOpen(this._dataSource,this._currentRequestRange)},c.prototype._internalOpen=function(_,d){this._lastTimeLoaded=0;var f=_.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?f=this._currentRedirectedURL:_.redirectedURL!=null&&(f=_.redirectedURL));var V=this._seekHandler.getConfig(f,d);this._currentRequestURL=V.url;var J=this._xhr=new XMLHttpRequest;if(J.open("GET",V.url,!0),J.responseType="arraybuffer",J.onreadystatechange=this._onReadyStateChange.bind(this),J.onprogress=this._onProgress.bind(this),J.onload=this._onLoad.bind(this),J.onerror=this._onXhrError.bind(this),_.withCredentials&&(J.withCredentials=!0),typeof V.headers=="object"){var F=V.headers;for(var K in F)F.hasOwnProperty(K)&&J.setRequestHeader(K,F[K])}if(typeof this._config.headers=="object"){F=this._config.headers;for(var K in F)F.hasOwnProperty(K)&&J.setRequestHeader(K,F[K])}J.send()},c.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=v.c.kComplete},c.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},c.prototype._onReadyStateChange=function(_){var d=_.target;if(d.readyState===2){if(d.responseURL!=null){var f=this._seekHandler.removeURLParameters(d.responseURL);d.responseURL!==this._currentRequestURL&&f!==this._currentRedirectedURL&&(this._currentRedirectedURL=f,this._onURLRedirect&&this._onURLRedirect(f))}if(d.status>=200&&d.status<=299){if(this._waitForTotalLength)return;this._status=v.c.kBuffering}else{if(this._status=v.c.kError,!this._onError)throw new g.d("RangeLoader: Http code invalid, "+d.status+" "+d.statusText);this._onError(v.b.HTTP_STATUS_CODE_INVALID,{code:d.status,msg:d.statusText})}}},c.prototype._onProgress=function(_){if(this._status!==v.c.kError){if(this._contentLength===null){var d=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,d=!0;var f=_.total;this._internalAbort(),f!=null&f!==0&&(this._totalLength=f)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,d)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var V=_.loaded-this._lastTimeLoaded;this._lastTimeLoaded=_.loaded,this._speedSampler.addBytes(V)}},c.prototype._normalizeSpeed=function(_){var d=this._chunkSizeKBList,f=d.length-1,V=0,J=0,F=f;if(_<d[0])return d[0];for(;J<=F;){if((V=J+Math.floor((F-J)/2))===f||_>=d[V]&&_<d[V+1])return d[V];d[V]<_?J=V+1:F=V-1}},c.prototype._onLoad=function(_){if(this._status!==v.c.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var d=this._speedSampler.lastSecondKBps;if(d===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(d=this._speedSampler.currentKBps)),d!==0){var f=this._normalizeSpeed(d);this._currentSpeedNormalized!==f&&(this._currentSpeedNormalized=f,this._currentChunkSizeKB=f)}var V=_.target.response,J=this._range.from+this._receivedLength;this._receivedLength+=V.byteLength;var F=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():F=!0,this._onDataArrival&&this._onDataArrival(V,J,this._receivedLength),F&&(this._status=v.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},c.prototype._onXhrError=function(_){this._status=v.c.kError;var d=0,f=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(d=v.b.EARLY_EOF,f={code:-1,msg:"RangeLoader meet Early-Eof"}):(d=v.b.EXCEPTION,f={code:-1,msg:_.constructor.name+" "+_.type}),!this._onError)throw new g.d(f.msg);this._onError(d,f)},c}(v.a),P=function(){var D=function(c,_){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var V in f)Object.prototype.hasOwnProperty.call(f,V)&&(d[V]=f[V])})(c,_)};return function(c,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function d(){this.constructor=c}D(c,_),c.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)}}(),X=function(D){function c(){var _=D.call(this,"websocket-loader")||this;return _.TAG="WebSocketLoader",_._needStash=!0,_._ws=null,_._requestAbort=!1,_._receivedLength=0,_}return P(c,D),c.isSupported=function(){try{return self.WebSocket!==void 0}catch{return!1}},c.prototype.destroy=function(){this._ws&&this.abort(),D.prototype.destroy.call(this)},c.prototype.open=function(_){try{var d=this._ws=new self.WebSocket(_.url);d.binaryType="arraybuffer",d.onopen=this._onWebSocketOpen.bind(this),d.onclose=this._onWebSocketClose.bind(this),d.onmessage=this._onWebSocketMessage.bind(this),d.onerror=this._onWebSocketError.bind(this),this._status=v.c.kConnecting}catch(V){this._status=v.c.kError;var f={code:V.code,msg:V.message};if(!this._onError)throw new g.d(f.msg);this._onError(v.b.EXCEPTION,f)}},c.prototype.abort=function(){var _=this._ws;!_||_.readyState!==0&&_.readyState!==1||(this._requestAbort=!0,_.close()),this._ws=null,this._status=v.c.kComplete},c.prototype._onWebSocketOpen=function(_){this._status=v.c.kBuffering},c.prototype._onWebSocketClose=function(_){this._requestAbort!==!0?(this._status=v.c.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},c.prototype._onWebSocketMessage=function(_){var d=this;if(_.data instanceof ArrayBuffer)this._dispatchArrayBuffer(_.data);else if(_.data instanceof Blob){var f=new FileReader;f.onload=function(){d._dispatchArrayBuffer(f.result)},f.readAsArrayBuffer(_.data)}else{this._status=v.c.kError;var V={code:-1,msg:"Unsupported WebSocket message type: "+_.data.constructor.name};if(!this._onError)throw new g.d(V.msg);this._onError(v.b.EXCEPTION,V)}},c.prototype._dispatchArrayBuffer=function(_){var d=_,f=this._receivedLength;this._receivedLength+=d.byteLength,this._onDataArrival&&this._onDataArrival(d,f,this._receivedLength)},c.prototype._onWebSocketError=function(_){this._status=v.c.kError;var d={code:_.code,msg:_.message};if(!this._onError)throw new g.d(d.msg);this._onError(v.b.EXCEPTION,d)},c}(v.a),k=function(){function D(c){this._zeroStart=c||!1}return D.prototype.getConfig=function(c,_){var d={};if(_.from!==0||_.to!==-1){var f=void 0;f=_.to!==-1?"bytes=".concat(_.from.toString(),"-").concat(_.to.toString()):"bytes=".concat(_.from.toString(),"-"),d.Range=f}else this._zeroStart&&(d.Range="bytes=0-");return{url:c,headers:d}},D.prototype.removeURLParameters=function(c){return c},D}(),q=function(){function D(c,_){this._startName=c,this._endName=_}return D.prototype.getConfig=function(c,_){var d=c;if(_.from!==0||_.to!==-1){var f=!0;d.indexOf("?")===-1&&(d+="?",f=!1),f&&(d+="&"),d+="".concat(this._startName,"=").concat(_.from.toString()),_.to!==-1&&(d+="&".concat(this._endName,"=").concat(_.to.toString()))}return{url:d,headers:{}}},D.prototype.removeURLParameters=function(c){var _=c.split("?")[0],d=void 0,f=c.indexOf("?");f!==-1&&(d=c.substring(f+1));var V="";if(d!=null&&d.length>0)for(var J=d.split("&"),F=0;F<J.length;F++){var K=J[F].split("="),oe=F>0;K[0]!==this._startName&&K[0]!==this._endName&&(oe&&(V+="&"),V+=J[F])}return V.length===0?_:_+"?"+V},D}(),Q=function(){function D(c,_,d){this.TAG="IOController",this._config=_,this._extraData=d,this._stashInitialSize=65536,_.stashInitialSize!=null&&_.stashInitialSize>0&&(this._stashInitialSize=_.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,_.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return D.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},D.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},D.prototype.isPaused=function(){return this._paused},Object.defineProperty(D.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"extraData",{get:function(){return this._extraData},set:function(c){this._extraData=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(c){this._onDataArrival=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(c){this._onSeeked=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onError",{get:function(){return this._onError},set:function(c){this._onError=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onComplete",{get:function(){return this._onComplete},set:function(c){this._onComplete=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(c){this._onRedirect=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(c){this._onRecoveredEarlyEof=c},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"currentSpeed",{get:function(){return this._loaderClass===N?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),D.prototype._selectSeekHandler=function(){var c=this._config;if(c.seekType==="range")this._seekHandler=new k(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){var _=c.seekParamStart||"bstart",d=c.seekParamEnd||"bend";this._seekHandler=new q(_,d)}else{if(c.seekType!=="custom")throw new g.b("Invalid seekType in config: ".concat(c.seekType));if(typeof c.customSeekHandler!="function")throw new g.b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}},D.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=X;else if(E.isSupported())this._loaderClass=E;else if(O.isSupported())this._loaderClass=O;else{if(!N.isSupported())throw new g.d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=N}},D.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},D.prototype.open=function(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},D.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},D.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},D.prototype.resume=function(){if(this._paused){this._paused=!1;var c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}},D.prototype.seek=function(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)},D.prototype._internalSeek=function(c,_){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(_),this._loader.destroy(),this._loader=null;var d={from:c,to:-1};this._currentRange={from:d.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,d),this._onSeeked&&this._onSeeked()},D.prototype.updateUrl=function(c){if(!c||typeof c!="string"||c.length===0)throw new g.b("Url must be a non-empty string!");this._dataSource.url=c},D.prototype._expandBuffer=function(c){for(var _=this._stashSize;_+1048576<c;)_*=2;if((_+=1048576)!==this._bufferSize){var d=new ArrayBuffer(_);if(this._stashUsed>0){var f=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(d,0,_).set(f,0)}this._stashBuffer=d,this._bufferSize=_}},D.prototype._normalizeSpeed=function(c){var _=this._speedNormalizeList,d=_.length-1,f=0,V=0,J=d;if(c<_[0])return _[0];for(;V<=J;){if((f=V+Math.floor((J-V)/2))===d||c>=_[f]&&c<_[f+1])return _[f];_[f]<c?V=f+1:J=f-1}},D.prototype._adjustStashSize=function(c){var _=0;(_=this._config.isLive?c/8:c<512?c:c>=512&&c<=1024?Math.floor(1.5*c):2*c)>8192&&(_=8192);var d=1024*_+1048576;this._bufferSize<d&&this._expandBuffer(d),this._stashSize=1024*_},D.prototype._dispatchChunks=function(c,_){return this._currentRange.to=_+c.byteLength-1,this._onDataArrival(c,_)},D.prototype._onURLRedirect=function(c){this._redirectedURL=c,this._onRedirect&&this._onRedirect(c)},D.prototype._onContentLengthKnown=function(c){c&&this._fullRequestFlag&&(this._totalLength=c,this._fullRequestFlag=!1)},D.prototype._onLoaderChunkArrival=function(c,_,d){if(!this._onDataArrival)throw new g.a("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(c.byteLength);var f=this._speedSampler.lastSecondKBps;if(f!==0){var V=this._normalizeSpeed(f);this._speedNormalized!==V&&(this._speedNormalized=V,this._adjustStashSize(V))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=_),this._stashUsed+c.byteLength<=this._stashSize)(K=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;else if(K=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var J=this._stashBuffer.slice(0,this._stashUsed);(oe=this._dispatchChunks(J,this._stashByteStart))<J.byteLength?oe>0&&(Ee=new Uint8Array(J,oe),K.set(Ee,0),this._stashUsed=Ee.byteLength,this._stashByteStart+=oe):(this._stashUsed=0,this._stashByteStart+=oe),this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),K=new Uint8Array(this._stashBuffer,0,this._bufferSize)),K.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else(oe=this._dispatchChunks(c,_))<c.byteLength&&((F=c.byteLength-oe)>this._bufferSize&&(this._expandBuffer(F),K=new Uint8Array(this._stashBuffer,0,this._bufferSize)),K.set(new Uint8Array(c,oe),0),this._stashUsed+=F,this._stashByteStart=_+oe);else if(this._stashUsed===0){var F;(oe=this._dispatchChunks(c,_))<c.byteLength&&((F=c.byteLength-oe)>this._bufferSize&&this._expandBuffer(F),(K=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(c,oe),0),this._stashUsed+=F,this._stashByteStart=_+oe)}else{var K,oe;if(this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength),(K=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength,(oe=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&oe>0){var Ee=new Uint8Array(this._stashBuffer,oe);K.set(Ee,0)}this._stashUsed-=oe,this._stashByteStart+=oe}}},D.prototype._flushStashBuffer=function(c){if(this._stashUsed>0){var _=this._stashBuffer.slice(0,this._stashUsed),d=this._dispatchChunks(_,this._stashByteStart),f=_.byteLength-d;if(d<_.byteLength){if(!c){if(d>0){var V=new Uint8Array(this._stashBuffer,0,this._bufferSize),J=new Uint8Array(_,d);V.set(J,0),this._stashUsed=J.byteLength,this._stashByteStart+=d}return 0}w.a.w(this.TAG,"".concat(f," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,f}return 0},D.prototype._onLoaderComplete=function(c,_){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},D.prototype._onLoaderError=function(c,_){switch(w.a.e(this.TAG,"Loader error, code = ".concat(_.code,", msg = ").concat(_.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=v.b.UNRECOVERABLE_EARLY_EOF),c){case v.b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var d=this._currentRange.to+1;return void(d<this._totalLength&&(w.a.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(d,!1)))}c=v.b.UNRECOVERABLE_EARLY_EOF;break;case v.b.UNRECOVERABLE_EARLY_EOF:case v.b.CONNECTING_TIMEOUT:case v.b.HTTP_STATUS_CODE_INVALID:case v.b.EXCEPTION:}if(!this._onError)throw new g.d("IOException: "+_.msg);this._onError(c,_)},D}();te.a=Q},function(ge,te,B){var G=function(){function w(){}return w.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(p,v){return p.__proto__=v,p},Object.assign=Object.assign||function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(p),S=1;S<arguments.length;S++){var g=arguments[S];if(g!=null)for(var T in g)g.hasOwnProperty(T)&&(v[T]=g[T])}return v},String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(p,v){var S=v>0?0|v:0;return this.substring(S,S+p.length)===p}}),typeof self.Promise!="function"&&B(21).polyfill()},w}();G.install(),te.a=G},function(ge,te,B){var G=B(9),w=B.n(G),p=B(0),v=B(5),S=B(7),g=B(3),T=function(){function E(L){this.TAG="MSEController",this._config=L,this._emitter=new w.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return E.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},E.prototype.on=function(L,O){this._emitter.addListener(L,O)},E.prototype.off=function(L,O){this._emitter.removeListener(L,O)},E.prototype.initialize=function(L){if(this._mediaSource)throw new g.a("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&p.a.v(this.TAG,"Using ManagedMediaSource");var O=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;O.addEventListener("sourceopen",this.e.onSourceOpen),O.addEventListener("sourceended",this.e.onSourceEnded),O.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(O.addEventListener("startstreaming",this.e.onStartStreaming),O.addEventListener("endstreaming",this.e.onEndStreaming),O.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=L},E.prototype.shutdown=function(){if(this._mediaSource){var L=this._mediaSource;for(var O in this._sourceBuffers){var M=this._pendingSegments[O];M.splice(0,M.length),this._pendingSegments[O]=null,this._pendingRemoveRanges[O]=null,this._lastInitSegments[O]=null;var U=this._sourceBuffers[O];if(U){if(L.readyState!=="closed"){try{L.removeSourceBuffer(U)}catch(N){p.a.e(this.TAG,N.message)}U.removeEventListener("error",this.e.onSourceBufferError),U.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[O]=null,this._sourceBuffers[O]=null}}if(L.readyState==="open")try{L.endOfStream()}catch(N){p.a.e(this.TAG,N.message)}this._mediaElementProxy=null,L.removeEventListener("sourceopen",this.e.onSourceOpen),L.removeEventListener("sourceended",this.e.onSourceEnded),L.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(L.removeEventListener("startstreaming",this.e.onStartStreaming),L.removeEventListener("endstreaming",this.e.onEndStreaming),L.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},E.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},E.prototype.getObject=function(){if(!this._mediaSource)throw new g.a("MediaSource has not been initialized yet!");return this._mediaSource},E.prototype.getHandle=function(){if(!this._mediaSource)throw new g.a("MediaSource has not been initialized yet!");return this._mediaSource.handle},E.prototype.getObjectURL=function(){if(!this._mediaSource)throw new g.a("MediaSource has not been initialized yet!");return this._mediaSourceObjectURL==null&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL},E.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},E.prototype.appendInitSegment=function(L,O){if(O===void 0&&(O=void 0),!this._mediaSource||this._mediaSource.readyState!=="open"||this._mediaSource.streaming===!1)return this._pendingSourceBufferInit.push(L),void this._pendingSegments[L.type].push(L);var M=L,U="".concat(M.container);M.codec&&M.codec.length>0&&(M.codec==="opus"&&v.a.safari&&(M.codec="Opus"),U+=";codecs=".concat(M.codec));var N=!1;if(p.a.v(this.TAG,"Received Initialization Segment, mimeType: "+U),this._lastInitSegments[M.type]=M,U!==this._mimeTypes[M.type]){if(this._mimeTypes[M.type])p.a.v(this.TAG,"Notice: ".concat(M.type," mimeType changed, origin: ").concat(this._mimeTypes[M.type],", target: ").concat(U));else{N=!0;try{var P=this._sourceBuffers[M.type]=this._mediaSource.addSourceBuffer(U);P.addEventListener("error",this.e.onSourceBufferError),P.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(X){return p.a.e(this.TAG,X.message),void this._emitter.emit(S.a.ERROR,{code:X.code,msg:X.message})}}this._mimeTypes[M.type]=U}O||this._pendingSegments[M.type].push(M),N||this._sourceBuffers[M.type]&&!this._sourceBuffers[M.type].updating&&this._doAppendSegments(),v.a.safari&&M.container==="audio/mpeg"&&M.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=M.mediaDuration/1e3,this._updateMediaSourceDuration())},E.prototype.appendMediaSegment=function(L){var O=L;this._pendingSegments[O.type].push(O),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var M=this._sourceBuffers[O.type];!M||M.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},E.prototype.flush=function(){for(var L in this._sourceBuffers)if(this._sourceBuffers[L]){var O=this._sourceBuffers[L];if(this._mediaSource.readyState==="open")try{O.abort()}catch(k){p.a.e(this.TAG,k.message)}var M=this._pendingSegments[L];if(M.splice(0,M.length),this._mediaSource.readyState!=="closed"){for(var U=0;U<O.buffered.length;U++){var N=O.buffered.start(U),P=O.buffered.end(U);this._pendingRemoveRanges[L].push({start:N,end:P})}if(O.updating||this._doRemoveRanges(),v.a.safari){var X=this._lastInitSegments[L];X&&(this._pendingSegments[L].push(X),O.updating||this._doAppendSegments())}}}},E.prototype.endOfStream=function(){var L=this._mediaSource,O=this._sourceBuffers;L&&L.readyState==="open"?O.video&&O.video.updating||O.audio&&O.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,L.endOfStream()):L&&L.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},E.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var L=this._mediaElementProxy.getCurrentTime();for(var O in this._sourceBuffers){var M=this._sourceBuffers[O];if(M){var U=M.buffered;if(U.length>=1&&L-U.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},E.prototype._doCleanupSourceBuffer=function(){var L=this._mediaElementProxy.getCurrentTime();for(var O in this._sourceBuffers){var M=this._sourceBuffers[O];if(M){for(var U=M.buffered,N=!1,P=0;P<U.length;P++){var X=U.start(P),k=U.end(P);if(X<=L&&L<k+3){if(L-X>=this._config.autoCleanupMaxBackwardDuration){N=!0;var q=L-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[O].push({start:X,end:q})}}else k<L&&(N=!0,this._pendingRemoveRanges[O].push({start:X,end:k}))}N&&!M.updating&&this._doRemoveRanges()}}},E.prototype._updateMediaSourceDuration=function(){var L=this._sourceBuffers;if(this._mediaElementProxy.getReadyState()!==0&&this._mediaSource.readyState==="open"&&!(L.video&&L.video.updating||L.audio&&L.audio.updating)){var O=this._mediaSource.duration,M=this._pendingMediaDuration;M>0&&(isNaN(O)||M>O)&&(p.a.v(this.TAG,"Update MediaSource duration from ".concat(O," to ").concat(M)),this._mediaSource.duration=M),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},E.prototype._doRemoveRanges=function(){for(var L in this._pendingRemoveRanges)if(this._sourceBuffers[L]&&!this._sourceBuffers[L].updating)for(var O=this._sourceBuffers[L],M=this._pendingRemoveRanges[L];M.length&&!O.updating;){var U=M.shift();O.remove(U.start,U.end)}},E.prototype._doAppendSegments=function(){var L=this._pendingSegments;for(var O in L)if(this._sourceBuffers[O]&&!this._sourceBuffers[O].updating&&this._mediaSource.streaming!==!1&&L[O].length>0){var M=L[O].shift();if(typeof M.timestampOffset=="number"&&isFinite(M.timestampOffset)){var U=this._sourceBuffers[O].timestampOffset,N=M.timestampOffset/1e3;Math.abs(U-N)>.1&&(p.a.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(U," to ").concat(N)),this._sourceBuffers[O].timestampOffset=N),delete M.timestampOffset}if(!M.data||M.data.byteLength===0)continue;try{this._sourceBuffers[O].appendBuffer(M.data),this._isBufferFull=!1}catch(P){this._pendingSegments[O].unshift(M),P.code===22?(this._isBufferFull||this._emitter.emit(S.a.BUFFER_FULL),this._isBufferFull=!0):(p.a.e(this.TAG,P.message),this._emitter.emit(S.a.ERROR,{code:P.code,msg:P.message}))}}},E.prototype._onSourceOpen=function(){if(p.a.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var L=this._pendingSourceBufferInit;L.length;){var O=L.shift();this.appendInitSegment(O,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(S.a.SOURCE_OPEN)},E.prototype._onStartStreaming=function(){p.a.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(S.a.START_STREAMING)},E.prototype._onEndStreaming=function(){p.a.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(S.a.END_STREAMING)},E.prototype._onQualityChange=function(){p.a.v(this.TAG,"ManagedMediaSource onQualityChange")},E.prototype._onSourceEnded=function(){p.a.v(this.TAG,"MediaSource onSourceEnded")},E.prototype._onSourceClose=function(){p.a.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstreaming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},E.prototype._hasPendingSegments=function(){var L=this._pendingSegments;return L.video.length>0||L.audio.length>0},E.prototype._hasPendingRemoveRanges=function(){var L=this._pendingRemoveRanges;return L.video.length>0||L.audio.length>0},E.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(S.a.UPDATE_END)},E.prototype._onSourceBufferError=function(L){p.a.e(this.TAG,"SourceBuffer Error: ".concat(L))},E}();te.a=T},function(ge,te,B){var G=B(9),w=B.n(G),p=B(18),v=B.n(p),S=B(0),g=B(8),T=B(13),E=B(1),L=(B(19),B(12)),O=function(){function M(U,N){if(this.TAG="Transmuxer",this._emitter=new w.a,N.enableWorker&&typeof Worker<"u")try{this._worker=v()(19),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[U,N]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},g.a.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:g.a.getConfig()})}catch{S.a.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new T.a(U,N)}else this._controller=new T.a(U,N);if(this._controller){var P=this._controller;P.on(E.a.IO_ERROR,this._onIOError.bind(this)),P.on(E.a.DEMUX_ERROR,this._onDemuxError.bind(this)),P.on(E.a.INIT_SEGMENT,this._onInitSegment.bind(this)),P.on(E.a.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),P.on(E.a.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),P.on(E.a.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),P.on(E.a.MEDIA_INFO,this._onMediaInfo.bind(this)),P.on(E.a.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),P.on(E.a.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),P.on(E.a.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),P.on(E.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),P.on(E.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),P.on(E.a.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),P.on(E.a.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),P.on(E.a.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),P.on(E.a.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),P.on(E.a.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),P.on(E.a.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return M.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),g.a.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},M.prototype.on=function(U,N){this._emitter.addListener(U,N)},M.prototype.off=function(U,N){this._emitter.removeListener(U,N)},M.prototype.hasWorker=function(){return this._worker!=null},M.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},M.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},M.prototype.seek=function(U){this._worker?this._worker.postMessage({cmd:"seek",param:U}):this._controller.seek(U)},M.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},M.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},M.prototype._onInitSegment=function(U,N){var P=this;Promise.resolve().then(function(){P._emitter.emit(E.a.INIT_SEGMENT,U,N)})},M.prototype._onMediaSegment=function(U,N){var P=this;Promise.resolve().then(function(){P._emitter.emit(E.a.MEDIA_SEGMENT,U,N)})},M.prototype._onLoadingComplete=function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(E.a.LOADING_COMPLETE)})},M.prototype._onRecoveredEarlyEof=function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(E.a.RECOVERED_EARLY_EOF)})},M.prototype._onMediaInfo=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.MEDIA_INFO,U)})},M.prototype._onMetaDataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.METADATA_ARRIVED,U)})},M.prototype._onScriptDataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.SCRIPTDATA_ARRIVED,U)})},M.prototype._onTimedID3MetadataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.TIMED_ID3_METADATA_ARRIVED,U)})},M.prototype._onSynchronousKLVMetadataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,U)})},M.prototype._onAsynchronousKLVMetadataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,U)})},M.prototype._onSMPTE2038MetadataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.SMPTE2038_METADATA_ARRIVED,U)})},M.prototype._onSCTE35MetadataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.SCTE35_METADATA_ARRIVED,U)})},M.prototype._onPESPrivateDataDescriptor=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.PES_PRIVATE_DATA_DESCRIPTOR,U)})},M.prototype._onPESPrivateDataArrived=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.PES_PRIVATE_DATA_ARRIVED,U)})},M.prototype._onStatisticsInfo=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.STATISTICS_INFO,U)})},M.prototype._onIOError=function(U,N){var P=this;Promise.resolve().then(function(){P._emitter.emit(E.a.IO_ERROR,U,N)})},M.prototype._onDemuxError=function(U,N){var P=this;Promise.resolve().then(function(){P._emitter.emit(E.a.DEMUX_ERROR,U,N)})},M.prototype._onRecommendSeekpoint=function(U){var N=this;Promise.resolve().then(function(){N._emitter.emit(E.a.RECOMMEND_SEEKPOINT,U)})},M.prototype._onLoggingConfigChanged=function(U){this._worker&&this._worker.postMessage({cmd:"logging_config",param:U})},M.prototype._onWorkerMessage=function(U){var N=U.data,P=N.data;if(N.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(N.msg){case E.a.INIT_SEGMENT:case E.a.MEDIA_SEGMENT:this._emitter.emit(N.msg,P.type,P.data);break;case E.a.LOADING_COMPLETE:case E.a.RECOVERED_EARLY_EOF:this._emitter.emit(N.msg);break;case E.a.MEDIA_INFO:Object.setPrototypeOf(P,L.a.prototype),this._emitter.emit(N.msg,P);break;case E.a.METADATA_ARRIVED:case E.a.SCRIPTDATA_ARRIVED:case E.a.TIMED_ID3_METADATA_ARRIVED:case E.a.SYNCHRONOUS_KLV_METADATA_ARRIVED:case E.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case E.a.SMPTE2038_METADATA_ARRIVED:case E.a.SCTE35_METADATA_ARRIVED:case E.a.PES_PRIVATE_DATA_DESCRIPTOR:case E.a.PES_PRIVATE_DATA_ARRIVED:case E.a.STATISTICS_INFO:this._emitter.emit(N.msg,P);break;case E.a.IO_ERROR:case E.a.DEMUX_ERROR:this._emitter.emit(N.msg,P.type,P.info);break;case E.a.RECOMMEND_SEEKPOINT:this._emitter.emit(N.msg,P);break;case"logcat_callback":S.a.emitter.emit("log",P.type,P.logcat)}},M}();te.a=O},function(ge,te,B){function G(S){var g={};function T(L){if(g[L])return g[L].exports;var O=g[L]={i:L,l:!1,exports:{}};return S[L].call(O.exports,O,O.exports,T),O.l=!0,O.exports}T.m=S,T.c=g,T.i=function(L){return L},T.d=function(L,O,M){T.o(L,O)||Object.defineProperty(L,O,{configurable:!1,enumerable:!0,get:M})},T.r=function(L){Object.defineProperty(L,"__esModule",{value:!0})},T.n=function(L){var O=L&&L.__esModule?function(){return L.default}:function(){return L};return T.d(O,"a",O),O},T.o=function(L,O){return Object.prototype.hasOwnProperty.call(L,O)},T.p="/",T.oe=function(L){throw console.error(L),L};var E=T(T.s=ENTRY_MODULE);return E.default||E}function w(S){return(S+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function p(S,g,T){var E={};E[T]=[];var L=g.toString(),O=L.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!O)return E;for(var M,U=O[1],N=new RegExp("(\\\\n|\\W)"+w(U)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");M=N.exec(L);)M[3]!=="dll-reference"&&E[T].push(M[3]);for(N=new RegExp("\\("+w(U)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");M=N.exec(L);)S[M[2]]||(E[T].push(M[1]),S[M[2]]=B(M[1]).m),E[M[2]]=E[M[2]]||[],E[M[2]].push(M[4]);for(var P,X=Object.keys(E),k=0;k<X.length;k++)for(var q=0;q<E[X[k]].length;q++)P=E[X[k]][q],isNaN(1*P)||(E[X[k]][q]=1*E[X[k]][q]);return E}function v(S){return Object.keys(S).reduce(function(g,T){return g||S[T].length>0},!1)}ge.exports=function(S,g){g=g||{};var T={main:B.m},E=g.all?{main:Object.keys(T.main)}:function(N,P){for(var X={main:[P]},k={main:[]},q={main:{}};v(X);)for(var Q=Object.keys(X),D=0;D<Q.length;D++){var c=Q[D],_=X[c].pop();if(q[c]=q[c]||{},!q[c][_]&&N[c][_]){q[c][_]=!0,k[c]=k[c]||[],k[c].push(_);for(var d=p(N,N[c][_],c),f=Object.keys(d),V=0;V<f.length;V++)X[f[V]]=X[f[V]]||[],X[f[V]]=X[f[V]].concat(d[f[V]])}}return k}(T,S),L="";Object.keys(E).filter(function(N){return N!=="main"}).forEach(function(N){for(var P=0;E[N][P];)P++;E[N].push(P),T[N][P]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",L=L+"var "+N+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(P))+")({"+E[N].map(function(X){return JSON.stringify(X)+": "+T[N][X].toString()}).join(",")+`}); 3`}),L=L+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+E.main.map(function(N){return JSON.stringify(N)+": "+T.main[N].toString()}).join(",")+"}))(self);";var O=new self.Blob([L],{type:"text/javascript"});if(g.bare)return O;var M=(self.URL||self.webkitURL||self.mozURL||self.msURL).createObjectURL(O),U=new self.Worker(M);return U.objectURL=M,U}},function(ge,te,B){B.r(te),B(0);var G=B(8),w=B(15),p=B(13),v=B(1);te.default=function(S){var g=null,T=(function(F,K){S.postMessage({msg:"logcat_callback",data:{type:F,logcat:K}})}).bind(this);function E(F,K){var oe={msg:v.a.INIT_SEGMENT,data:{type:F,data:K}};S.postMessage(oe,[K.data])}function L(F,K){var oe={msg:v.a.MEDIA_SEGMENT,data:{type:F,data:K}};S.postMessage(oe,[K.data])}function O(){var F={msg:v.a.LOADING_COMPLETE};S.postMessage(F)}function M(){var F={msg:v.a.RECOVERED_EARLY_EOF};S.postMessage(F)}function U(F){var K={msg:v.a.MEDIA_INFO,data:F};S.postMessage(K)}function N(F){var K={msg:v.a.METADATA_ARRIVED,data:F};S.postMessage(K)}function P(F){var K={msg:v.a.SCRIPTDATA_ARRIVED,data:F};S.postMessage(K)}function X(F){var K={msg:v.a.TIMED_ID3_METADATA_ARRIVED,data:F};S.postMessage(K)}function k(F){var K={msg:v.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,data:F};S.postMessage(K)}function q(F){var K={msg:v.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,data:F};S.postMessage(K)}function Q(F){var K={msg:v.a.SMPTE2038_METADATA_ARRIVED,data:F};S.postMessage(K)}function D(F){var K={msg:v.a.SCTE35_METADATA_ARRIVED,data:F};S.postMessage(K)}function c(F){var K={msg:v.a.PES_PRIVATE_DATA_DESCRIPTOR,data:F};S.postMessage(K)}function _(F){var K={msg:v.a.PES_PRIVATE_DATA_ARRIVED,data:F};S.postMessage(K)}function d(F){var K={msg:v.a.STATISTICS_INFO,data:F};S.postMessage(K)}function f(F,K){S.postMessage({msg:v.a.IO_ERROR,data:{type:F,info:K}})}function V(F,K){S.postMessage({msg:v.a.DEMUX_ERROR,data:{type:F,info:K}})}function J(F){S.postMessage({msg:v.a.RECOMMEND_SEEKPOINT,data:F})}w.a.install(),S.addEventListener("message",function(F){switch(F.data.cmd){case"init":(g=new p.a(F.data.param[0],F.data.param[1])).on(v.a.IO_ERROR,f.bind(this)),g.on(v.a.DEMUX_ERROR,V.bind(this)),g.on(v.a.INIT_SEGMENT,E.bind(this)),g.on(v.a.MEDIA_SEGMENT,L.bind(this)),g.on(v.a.LOADING_COMPLETE,O.bind(this)),g.on(v.a.RECOVERED_EARLY_EOF,M.bind(this)),g.on(v.a.MEDIA_INFO,U.bind(this)),g.on(v.a.METADATA_ARRIVED,N.bind(this)),g.on(v.a.SCRIPTDATA_ARRIVED,P.bind(this)),g.on(v.a.TIMED_ID3_METADATA_ARRIVED,X.bind(this)),g.on(v.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,k.bind(this)),g.on(v.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,q.bind(this)),g.on(v.a.SMPTE2038_METADATA_ARRIVED,Q.bind(this)),g.on(v.a.SCTE35_METADATA_ARRIVED,D.bind(this)),g.on(v.a.PES_PRIVATE_DATA_DESCRIPTOR,c.bind(this)),g.on(v.a.PES_PRIVATE_DATA_ARRIVED,_.bind(this)),g.on(v.a.STATISTICS_INFO,d.bind(this)),g.on(v.a.RECOMMEND_SEEKPOINT,J.bind(this));break;case"destroy":g&&(g.destroy(),g=null),S.postMessage({msg:"destroyed"});break;case"start":g.start();break;case"stop":g.stop();break;case"seek":g.seek(F.data.param);break;case"pause":g.pause();break;case"resume":g.resume();break;case"logging_config":var K=F.data.param;G.a.applyConfig(K),K.enableCallback===!0?G.a.addLogListener(T):G.a.removeLogListener(T)}})}},function(ge,te,B){ge.exports=B(25).default},function(ge,te,B){(function(G,w){/*! 4 * @overview es6-promise - a tiny implementation of Promises/A+. 5 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) 6 * @license Licensed under MIT license 7 * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE 8 * @version v4.2.8+1e68dce6 9 */var p;p=function(){function v(j){return typeof j=="function"}var S=Array.isArray?Array.isArray:function(j){return Object.prototype.toString.call(j)==="[object Array]"},g=0,T=void 0,E=void 0,L=function(j,W){k[g]=j,k[g+1]=W,(g+=2)===2&&(E?E(q):d())},O=typeof window<"u"?window:void 0,M=O||{},U=M.MutationObserver||M.WebKitMutationObserver,N=typeof self>"u"&&G!==void 0&&{}.toString.call(G)==="[object process]",P=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function X(){var j=setTimeout;return function(){return j(q,1)}}var k=new Array(1e3);function q(){for(var j=0;j<g;j+=2)(0,k[j])(k[j+1]),k[j]=void 0,k[j+1]=void 0;g=0}var Q,D,c,_,d=void 0;function f(j,W){var ie=this,ue=new this.constructor(F);ue[J]===void 0&&de(ue);var le=ie._state;if(le){var ve=arguments[le-1];L(function(){return z(le,ue,ve,ie._result)})}else u(ie,ue,j,W);return ue}function V(j){if(j&&typeof j=="object"&&j.constructor===this)return j;var W=new this(F);return oe(W,j),W}N?d=function(){return G.nextTick(q)}:U?(D=0,c=new U(q),_=document.createTextNode(""),c.observe(_,{characterData:!0}),d=function(){_.data=D=++D%2}):P?((Q=new MessageChannel).port1.onmessage=q,d=function(){return Q.port2.postMessage(0)}):d=O===void 0?function(){try{var j=Function("return this")().require("vertx");return(T=j.runOnLoop||j.runOnContext)!==void 0?function(){T(q)}:X()}catch{return X()}}():X();var J=Math.random().toString(36).substring(2);function F(){}function K(j,W,ie){W.constructor===j.constructor&&ie===f&&W.constructor.resolve===V?function(ue,le){le._state===1?_e(ue,le._result):le._state===2?b(ue,le._result):u(le,void 0,function(ve){return oe(ue,ve)},function(ve){return b(ue,ve)})}(j,W):ie===void 0?_e(j,W):v(ie)?function(ue,le,ve){L(function(we){var Ce=!1,Ue=function(ke,ze,We,Qe){try{ke.call(ze,We,Qe)}catch(Je){return Je}}(ve,le,function(ke){Ce||(Ce=!0,le!==ke?oe(we,ke):_e(we,ke))},function(ke){Ce||(Ce=!0,b(we,ke))},we._label);!Ce&&Ue&&(Ce=!0,b(we,Ue))},ue)}(j,W,ie):_e(j,W)}function oe(j,W){if(j===W)b(j,new TypeError("You cannot resolve a promise with itself"));else if(le=typeof(ue=W),ue===null||le!=="object"&&le!=="function")_e(j,W);else{var ie=void 0;try{ie=W.then}catch(ve){return void b(j,ve)}K(j,W,ie)}var ue,le}function Ee(j){j._onerror&&j._onerror(j._result),C(j)}function _e(j,W){j._state===void 0&&(j._result=W,j._state=1,j._subscribers.length!==0&&L(C,j))}function b(j,W){j._state===void 0&&(j._state=2,j._result=W,L(Ee,j))}function u(j,W,ie,ue){var le=j._subscribers,ve=le.length;j._onerror=null,le[ve]=W,le[ve+1]=ie,le[ve+2]=ue,ve===0&&j._state&&L(C,j)}function C(j){var W=j._subscribers,ie=j._state;if(W.length!==0){for(var ue=void 0,le=void 0,ve=j._result,we=0;we<W.length;we+=3)ue=W[we],le=W[we+ie],ue?z(ie,ue,le,ve):le(ve);j._subscribers.length=0}}function z(j,W,ie,ue){var le=v(ie),ve=void 0,we=void 0,Ce=!0;if(le){try{ve=ie(ue)}catch(Ue){Ce=!1,we=Ue}if(W===ve)return void b(W,new TypeError("A promises callback cannot return that same promise."))}else ve=ue;W._state!==void 0||(le&&Ce?oe(W,ve):Ce===!1?b(W,we):j===1?_e(W,ve):j===2&&b(W,ve))}var ne=0;function de(j){j[J]=ne++,j._state=void 0,j._result=void 0,j._subscribers=[]}var Te=function(){function j(W,ie){this._instanceConstructor=W,this.promise=new W(F),this.promise[J]||de(this.promise),S(ie)?(this.length=ie.length,this._remaining=ie.length,this._result=new Array(this.length),this.length===0?_e(this.promise,this._result):(this.length=this.length||0,this._enumerate(ie),this._remaining===0&&_e(this.promise,this._result))):b(this.promise,new Error("Array Methods must be provided an Array"))}return j.prototype._enumerate=function(W){for(var ie=0;this._state===void 0&&ie<W.length;ie++)this._eachEntry(W[ie],ie)},j.prototype._eachEntry=function(W,ie){var ue=this._instanceConstructor,le=ue.resolve;if(le===V){var ve=void 0,we=void 0,Ce=!1;try{ve=W.then}catch(ke){Ce=!0,we=ke}if(ve===f&&W._state!==void 0)this._settledAt(W._state,ie,W._result);else if(typeof ve!="function")this._remaining--,this._result[ie]=W;else if(ue===ye){var Ue=new ue(F);Ce?b(Ue,we):K(Ue,W,ve),this._willSettleAt(Ue,ie)}else this._willSettleAt(new ue(function(ke){return ke(W)}),ie)}else this._willSettleAt(le(W),ie)},j.prototype._settledAt=function(W,ie,ue){var le=this.promise;le._state===void 0&&(this._remaining--,W===2?b(le,ue):this._result[ie]=ue),this._remaining===0&&_e(le,this._result)},j.prototype._willSettleAt=function(W,ie){var ue=this;u(W,void 0,function(le){return ue._settledAt(1,ie,le)},function(le){return ue._settledAt(2,ie,le)})},j}(),ye=function(){function j(W){this[J]=ne++,this._result=this._state=void 0,this._subscribers=[],F!==W&&(typeof W!="function"&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof j?function(ie,ue){try{ue(function(le){oe(ie,le)},function(le){b(ie,le)})}catch(le){b(ie,le)}}(this,W):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
9onstructor cannot be called as a function.")}())}return j.prototype.catch=function(W){return this.then(null,W)},j.prototype.finally=function(W){var ie=this.constructor;return v(W)?this.then(function(ue){return ie.resolve(W()).then(function(){return ue})},function(ue){return ie.resolve(W()).then(function(){throw ue})}):this.then(W,W)},j}();return ye.prototype.then=f,ye.all=function(j){return new Te(this,j).promise},ye.race=function(j){var W=this;return S(j)?new W(function(ie,ue){for(var le=j.length,ve=0;ve<le;ve++)W.resolve(j[ve]).then(ie,ue)}):new W(function(ie,ue){return ue(new TypeError("You must pass an array to race."))})},ye.resolve=V,ye.reject=function(j){var W=new this(F);return b(W,j),W},ye._setScheduler=function(j){E=j},ye._setAsap=function(j){L=j},ye._asap=L,ye.polyfill=function(){var j=void 0;if(w!==void 0)j=w;else if(typeof self<"u")j=self;else try{j=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var W=j.Promise;if(W){var ie=null;try{ie=Object.prototype.toString.call(W.resolve())}catch{}if(ie==="[object Promise]"&&!W.cast)return}j.Promise=ye},ye.Promise=ye,ye},ge.exports=p()}).call(this,B(22),B(23))},function(ge,te){var B,G,w=ge.exports={};function p(){throw new Error("setTimeout has not been defined")}function v(){throw new Error("clearTimeout has not been defined")}function S(P){if(B===setTimeout)return setTimeout(P,0);if((B===p||!B)&&setTimeout)return B=setTimeout,setTimeout(P,0);try{return B(P,0)}catch{try{return B.call(null,P,0)}catch{return B.call(this,P,0)}}}(function(){try{B=typeof setTimeout=="function"?setTimeout:p}catch{B=p}try{G=typeof clearTimeout=="function"?clearTimeout:v}catch{G=v}})();var g,T=[],E=!1,L=-1;function O(){E&&g&&(E=!1,g.length?T=g.concat(T):L=-1,T.length&&M())}function M(){if(!E){var P=S(O);E=!0;for(var X=T.length;X;){for(g=T,T=[];++L<X;)g&&g[L].run();L=-1,X=T.length}g=null,E=!1,function(k){if(G===clearTimeout)return clearTimeout(k);if((G===v||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(k);try{G(k)}catch{try{return G.call(null,k)}catch{return G.call(this,k)}}}(P)}}function U(P,X){this.fun=P,this.array=X}function N(){}w.nextTick=function(P){var X=new Array(arguments.length-1);if(arguments.length>1)for(var k=1;k<arguments.length;k++)X[k-1]=arguments[k];T.push(new U(P,X)),T.length!==1||E||S(M)},U.prototype.run=function(){this.fun.apply(null,this.array)},w.title="browser",w.browser=!0,w.env={},w.argv=[],w.version="",w.versions={},w.on=N,w.addListener=N,w.once=N,w.off=N,w.removeListener=N,w.removeAllListeners=N,w.emit=N,w.prependListener=N,w.prependOnceListener=N,w.listeners=function(P){return[]},w.binding=function(P){throw new Error("process.binding is not supported")},w.cwd=function(){return"/"},w.chdir=function(P){throw new Error("process.chdir is not supported")},w.umask=function(){return 0}},function(ge,te){var B;B=function(){return this}();try{B=B||new Function("return this")()}catch{typeof window=="object"&&(B=window)}ge.exports=B},function(ge,te,B){B.r(te);var G=B(0),w=B(8),p=B(3),v=B(7),S=B(16),g=B(17),T=B(1),E=B(4),L=B(10);te.default=function(O){var M="PlayerEngineWorker",U=(function(b,u){O.postMessage({msg:"logcat_callback",type:b,logcat:u})}).bind(void 0),N=null,P=null,X=null,k=null,q=!1,Q=!1,D=0,c=0,_=!1;function d(){X&&(X.shutdown(),X.destroy(),X=null)}function f(){if(N==null||P==null)throw new p.a("Worker not initialized");if(k)throw new p.a("Transmuxer has been initialized");Q||(!P.deferLoadAfterSourceOpen||q?((k=new g.a(N,P)).on(T.a.INIT_SEGMENT,function(b,u){X.appendInitSegment(u)}),k.on(T.a.MEDIA_SEGMENT,function(b,u){X.appendMediaSegment(u),O.postMessage({msg:"buffered_position_changed",buffered_position_milliseconds:u.info.endDts})}),k.on(T.a.LOADING_COMPLETE,function(){X.endOfStream(),O.postMessage({msg:"player_event",event:E.a.LOADING_COMPLETE})}),k.on(T.a.RECOVERED_EARLY_EOF,function(){O.postMessage({msg:"player_event",event:E.a.RECOVERED_EARLY_EOF})}),k.on(T.a.IO_ERROR,function(b,u){O.postMessage({msg:"player_event",event:E.a.ERROR,error_type:L.b.NETWORK_ERROR,error_detail:b,info:u})}),k.on(T.a.DEMUX_ERROR,function(b,u){O.postMessage({msg:"player_event",event:E.a.ERROR,error_type:L.b.MEDIA_ERROR,error_detail:b,
vendor: 40,286 bytes, line 9
9info:u})}),k.on(T.a.MEDIA_INFO,function(b){Ee(T.a.MEDIA_INFO,b)}),k.on(T.a.STATISTICS_INFO,function(b){Ee(T.a.STATISTICS_INFO,b)}),k.on(T.a.RECOMMEND_SEEKPOINT,function(b){(function(u){O.postMessage({msg:"transmuxing_event",event:T.a.RECOMMEND_SEEKPOINT,milliseconds:u})})(b)}),k.on(T.a.METADATA_ARRIVED,function(b){_e(E.a.METADATA_ARRIVED,b)}),k.on(T.a.SCRIPTDATA_ARRIVED,function(b){_e(E.a.SCRIPTDATA_ARRIVED,b)}),k.on(T.a.TIMED_ID3_METADATA_ARRIVED,function(b){_e(E.a.TIMED_ID3_METADATA_ARRIVED,b)}),k.on(T.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(b){_e(E.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,b)}),k.on(T.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(b){_e(E.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,b)}),k.on(T.a.SMPTE2038_METADATA_ARRIVED,function(b){_e(E.a.SMPTE2038_METADATA_ARRIVED,b)}),k.on(T.a.SCTE35_METADATA_ARRIVED,function(b){_e(E.a.SCTE35_METADATA_ARRIVED,b)}),k.on(T.a.PES_PRIVATE_DATA_DESCRIPTOR,function(b){_e(E.a.PES_PRIVATE_DATA_DESCRIPTOR,b)}),k.on(T.a.PES_PRIVATE_DATA_ARRIVED,function(b){_e(E.a.PES_PRIVATE_DATA_ARRIVED,b)}),k.open()):Q=!0)}function V(){X&&X.flush(),k&&(k.close(),k.destroy(),k=null)}function J(){q=!0,Q&&(Q=!1,f())}function F(){O.postMessage({msg:"mse_event",event:v.a.UPDATE_END})}function K(){G.a.v(M,"MSE SourceBuffer is full, report to main thread"),O.postMessage({msg:"mse_event",event:v.a.BUFFER_FULL})}function oe(b){O.postMessage({msg:"player_event",event:E.a.ERROR,error_type:L.b.MEDIA_ERROR,error_detail:L.b.MEDIA_MSE_ERROR,info:b})}function Ee(b,u){O.postMessage({msg:"transmuxing_event",event:b,info:u})}function _e(b,u){O.postMessage({msg:"player_event",event:b,extraData:u})}O.addEventListener("message",function(b){if(!_){var u=b.data;switch(u.cmd){case"logging_config":var C=u;w.a.applyConfig(C.logging_config),C.logging_config.enableCallback===!0?w.a.addLogListener(U):w.a.removeLogListener(U);break;case"init":N=(C=u).media_data_source,P=C.config;break;case"destroy":(function(){k&&V(),X&&d(),_=!0,O.postMessage({msg:"destroyed"})})();break;case"initialize_mse":(function(){G.a.v(M,"Initializing MediaSource in DedicatedWorker"),(X=new S.a(P)).on(v.a.SOURCE_OPEN,J.bind(this)),X.on(v.a.UPDATE_END,F.bind(this)),X.on(v.a.BUFFER_FULL,K.bind(this)),X.on(v.a.ERROR,oe.bind(this)),X.initialize({getCurrentTime:function(){return D},getReadyState:function(){return c}});var z=X.getHandle();O.postMessage({msg:"mse_init",handle:z},[z])})();break;case"shutdown_mse":d();break;case"load":f();break;case"unload":V();break;case"unbuffered_seek":C=u,X.flush(),k.seek(C.milliseconds);break;case"timeupdate":D=(C=u).current_time;break;case"readystatechange":c=(C=u).ready_state;break;case"pause_transmuxer":k.pause();break;case"resume_transmuxer":k.resume()}}})}},function(ge,te,B){B.r(te);var G=B(15),w=B(14),p={enableWorker:!1,enableWorkerForMSE:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyChasingOnPaused:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,liveSync:!1,liveSyncMaxLatency:1.2,liveSyncTargetLatency:.8,liveSyncPlaybackRate:1.2,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function v(){return Object.assign({},p)}var S=function(){function b(){}return b.supportMSEH264Playback=function(){var u=self.MediaSource&&self.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),C=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');return u||C},b.supportMSEH265Playback=function(){var u=self.MediaSource&&self.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"'),C=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"');return u||C},b.supportNetworkStreamIO=function(){var u=new w.a({},v()),C=u.loaderType;return u.destroy(),C=="fetch-stream-loader"||C=="xhr-moz-chunked-loader"},b.getNetworkLoaderTypeName=function(){var u=new w.a({},v()),C=u.loaderType;return u.destroy(),C},b.supportNativeMediaPlayback=function(u){b.videoElement==null&&(b.videoElement=window.document.createElement("video"));var C=b.videoElement.canPlayType(u);return C==="probably"||C=="maybe"},b.getFeatureList=function(){var u={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return u.msePlayback=b.supportMSEH264Playback(),u.networkStreamIO=b.supportNetworkStreamIO(),u.networkLoaderName=b.getNetworkLoaderTypeName(),u.mseLivePlayback=u.msePlayback&&u.networkStreamIO,u.mseH265Playback=b.supportMSEH265Playback(),u.nativeMP4H264Playback=b.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),u.nativeMP4H265Playback=b.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),u.nativeWebmVP8Playback=b.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),u.nativeWebmVP9Playback=b.supportNativeMediaPlayback('video/webm; codecs="vp9"'),u},b}(),g=B(2),T=B(0),E=B(9),L=B.n(E),O=B(16),M=B(4),U=B(17),N=B(7),P=B(10),X=B(3),k=B(1),q=B(5),Q=B(11),D=function(){function b(u,C,z){this.TAG="SeekingHandler",this._config=null,this._media_element=null,this._always_seek_keyframe=!1,this._on_unbuffered_seek=null,this._request_set_current_time=!1,this._seek_request_record_clocktime=null,this._idr_sample_list=new Q.a,this.e=null,this._config=u,this._media_element=C,this._on_unbuffered_seek=z,this.e={onMediaSeeking:this._onMediaSeeking.bind(this)};var ne=q.a.chrome&&(q.a.version.major<50||q.a.version.major===50&&q.a.version.build<2661);this._always_seek_keyframe=!!(ne||q.a.msedge||q.a.msie),this._always_seek_keyframe&&(this._config.accurateSeek=!1),this._media_element.addEventListener("seeking",this.e.onMediaSeeking)}return b.prototype.destroy=function(){this._idr_sample_list.clear(),this._idr_sample_list=null,this._media_element.removeEventListener("seeking",this.e.onMediaSeeking),this._media_element=null,this._on_unbuffered_seek=null},b.prototype.seek=function(u){var C=this._isPositionBuffered(u),z=!1;if(u<1&&this._media_element.buffered.length>0){var ne=this._media_element.buffered.start(0);(ne<1&&u<ne||q.a.safari)&&(z=!0,u=q.a.safari?.1:ne)}if(z)this.directSeek(u);else if(C)if(this._always_seek_keyframe){var de=this._getNearestKeyframe(Math.floor(1e3*u));de!=null&&(u=de.dts/1e3),this.directSeek(u)}else this.directSeek(u);else this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*u)),this._config.accurateSeek&&this.directSeek(u)},b.prototype.directSeek=function(u){this._request_set_current_time=!0,this._media_element.currentTime=u},b.prototype.appendSyncPoints=function(u){this._idr_sample_list.appendArray(u)},b.prototype._onMediaSeeking=function(u){if(this._request_set_current_time)this._request_set_current_time=!1;else{var C=this._media_element.currentTime,z=this._media_element.buffered;if(C<1&&z.length>0){var ne=z.start(0);if(ne<1&&C<ne||q.a.safari){var de=q.a.safari?.1:ne;return void this.directSeek(de)}}if(this._isPositionBuffered(C)){if(this._always_seek_keyframe){var Te=this._getNearestKeyframe(Math.floor(1e3*C));Te!=null&&(C=Te.dts/1e3,this.directSeek(C))}}else this._seek_request_record_clocktime=b._getClockTime(),window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)}},b.prototype._pollAndApplyUnbufferedSeek=function(){if(this._seek_request_record_clocktime!=null)if(this._seek_request_record_clocktime<=b._getClockTime()-100){var u=this._media_element.currentTime;this._seek_request_record_clocktime=null,this._isPositionBuffered(u)||(this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*u)),this._config.accurateSeek&&this.directSeek(u))}else window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)},b.prototype._isPositionBuffered=function(u){for(var C=this._media_element.buffered,z=0;z<C.length;z++){var ne=C.start(z),de=C.end(z);if(u>=ne&&u<de)return!0}return!1},b.prototype._getNearestKeyframe=function(u){return this._idr_sample_list.getLastSyncPointBeforeDts(u)},b._getClockTime=function(){return self.performance&&self.performance.now?self.performance.now():Date.now()},b}(),c=function(){function b(u,C,z,ne){this.TAG="LoadingController",this._config=null,this._media_element=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null,this._paused=!1,this.e=null,this._config=u,this._media_element=C,this._on_pause_transmuxer=z,this._on_resume_transmuxer=ne,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)}}return b.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this.e=null,this._media_element=null,this._config=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null},b.prototype.notifyBufferedPositionChanged=function(u){!this._config.isLive&&this._config.lazyLoad&&(u==null?this._suspendTransmuxerIfNeeded():this._suspendTransmuxerIfBufferedPositionExceeded(u))},b.prototype._onMediaTimeUpdate=function(u){this._paused&&this._resumeTransmuxerIfNeeded()},b.prototype._suspendTransmuxerIfNeeded=function(){for(var u=this._media_element.buffered,C=this._media_element.currentTime,z=0,ne=0;ne<u.length;ne++){var de=u.start(ne),Te=u.end(ne);if(de<=C&&C<Te){z=Te;break}}z>0&&this._suspendTransmuxerIfBufferedPositionExceeded(z)},b.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(u){u>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(T.a.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},b.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},b.prototype._resumeTransmuxerIfNeeded=function(){for(var u=this._media_element.buffered,C=this._media_element.currentTime,z=this._config.lazyLoadRecoverDuration,ne=!1,de=0;de<u.length;de++){var Te=u.start(de),ye=u.end(de);if(C>=Te&&C<ye){C>=ye-z&&(ne=!0);break}}ne&&(T.a.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},b.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},b}(),_=function(){function b(u,C){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=u,this._on_direct_seek=C,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return b.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},b.prototype._onMediaCanPlay=function(u){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},b.prototype._onMediaStalled=function(u){this._detectAndFixStuckPlayback(!0)},b.prototype._onMediaProgress=function(u){this._detectAndFixStuckPlayback()},b.prototype._detectAndFixStuckPlayback=function(u){var C=this._media_element,z=C.buffered;u||!this._canplay_received||C.readyState<2?z.length>0&&C.currentTime<z.start(0)&&(T.a.w(this.TAG,"Playback seems stuck at ".concat(C.currentTime,", seek to ").concat(z.start(0))),this._on_direct_seek(z.start(0)),this._media_element.removeEventListener("progress",this.e.onMediaProgress)):this._media_element.removeEventListener("progress",this.e.onMediaProgress)},b}(),d=function(){function b(u,C,z){this._config=null,this._media_element=null,this._on_direct_seek=null,this._config=u,this._media_element=C,this._on_direct_seek=z}return b.prototype.destroy=function(){this._on_direct_seek=null,this._media_element=null,this._config=null},b.prototype.notifyBufferedRangeUpdate=function(){this._chaseLiveLatency()},b.prototype._chaseLiveLatency=function(){var u=this._media_element.buffered,C=this._media_element.currentTime,z=this._media_element.paused;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&u.length!=0&&(this._config.liveBufferLatencyChasingOnPaused||!z)){var ne=u.end(u.length-1);if(ne>this._config.liveBufferLatencyMaxLatency&&ne-C>this._config.liveBufferLatencyMaxLatency){var de=ne-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(de)}}},b}(),f=function(){function b(u,C){this._config=null,this._media_element=null,this.e=null,this._config=u,this._media_element=C,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return b.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},b.prototype._onMediaTimeUpdate=function(u){if(this._config.isLive&&this._config.liveSync){var C=this._getCurrentLatency();if(C>this._config.liveSyncMaxLatency){var z=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=z}else C>this._config.liveSyncTargetLatency||this._media_element.playbackRate!==1&&this._media_element.playbackRate!==0&&(this._media_element.playbackRate=1)}},b.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var u=this._media_element.buffered,C=this._media_element.currentTime;return u.length==0?0:u.end(u.length-1)-C},b}(),V=function(){function b(u,C){this.TAG="PlayerEngineMainThread",this._emitter=new E,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=u,this._config=v(),typeof C=="object"&&Object.assign(this._config,C),u.isLive===!0&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return b.prototype.destroy=function(){this._emitter.emit(M.a.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},b.prototype.on=function(u,C){var z=this;this._emitter.addListener(u,C),u===M.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return z._emitter.emit(M.a.MEDIA_INFO,z.mediaInfo)}):u==M.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return z._emitter.emit(M.a.STATISTICS_INFO,z.statisticsInfo)})},b.prototype.off=function(u,C){this._emitter.removeListener(u,C)},b.prototype.attachMediaElement=function(u){var C=this;this._media_element=u,u.src="",u.removeAttribute("src"),u.srcObject=null,u.load(),u.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new O.a(this._config),this._mse_controller.on(N.a.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(N.a.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(N.a.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(N.a.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(N.a.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(N.a.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return C._media_element.currentTime},getReadyState:function(){return C._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(u.disableRemotePlayback=!0,u.srcObject=this._mse_controller.getObject()):u.src=this._mse_controller.getObjectURL()},b.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},b.prototype.load=function(){var u=this;if(!this._media_element)throw new X.a("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new X.a("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new U.a(this._media_data_source,this._config),this._transmuxer.on(k.a.INIT_SEGMENT,function(C,z){u._mse_controller.appendInitSegment(z)}),this._transmuxer.on(k.a.MEDIA_SEGMENT,function(C,z){u._mse_controller.appendMediaSegment(z),!u._config.isLive&&C==="video"&&z.data&&z.data.byteLength>0&&"info"in z&&u._seeking_handler.appendSyncPoints(z.info.syncPoints),u._loading_controller.notifyBufferedPositionChanged(z.info.endDts/1e3)}),this._transmuxer.on(k.a.LOADING_COMPLETE,function(){u._mse_controller.endOfStream(),u._emitter.emit(M.a.LOADING_COMPLETE)}),this._transmuxer.on(k.a.RECOVERED_EARLY_EOF,function(){u._emitter.emit(M.a.RECOVERED_EARLY_EOF)}),this._transmuxer.on(k.a.IO_ERROR,function(C,z){u._emitter.emit(M.a.ERROR,P.b.NETWORK_ERROR,C,z)}),this._transmuxer.on(k.a.DEMUX_ERROR,function(C,z){u._emitter.emit(M.a.ERROR,P.b.MEDIA_ERROR,C,z)}),this._transmuxer.on(k.a.MEDIA_INFO,function(C){u._media_info=C,u._emitter.emit(M.a.MEDIA_INFO,Object.assign({},C))}),this._transmuxer.on(k.a.STATISTICS_INFO,function(C){u._statistics_info=u._fillStatisticsInfo(C),u._emitter.emit(M.a.STATISTICS_INFO,Object.assign({},C))}),this._transmuxer.on(k.a.RECOMMEND_SEEKPOINT,function(C){u._media_element&&!u._config.accurateSeek&&u._seeking_handler.directSeek(C/1e3)}),this._transmuxer.on(k.a.METADATA_ARRIVED,function(C){u._emitter.emit(M.a.METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.SCRIPTDATA_ARRIVED,function(C){u._emitter.emit(M.a.SCRIPTDATA_ARRIVED,C)}),this._transmuxer.on(k.a.TIMED_ID3_METADATA_ARRIVED,function(C){u._emitter.emit(M.a.TIMED_ID3_METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(C){u._emitter.emit(M.a.SYNCHRONOUS_KLV_METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(C){u._emitter.emit(M.a.ASYNCHRONOUS_KLV_METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.SMPTE2038_METADATA_ARRIVED,function(C){u._emitter.emit(M.a.SMPTE2038_METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.SCTE35_METADATA_ARRIVED,function(C){u._emitter.emit(M.a.SCTE35_METADATA_ARRIVED,C)}),this._transmuxer.on(k.a.PES_PRIVATE_DATA_DESCRIPTOR,function(C){u._emitter.emit(M.a.PES_PRIVATE_DATA_DESCRIPTOR,C)}),this._transmuxer.on(k.a.PES_PRIVATE_DATA_ARRIVED,function(C){u._emitter.emit(M.a.PES_PRIVATE_DATA_ARRIVED,C)}),this._seeking_handler=new D(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new c(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new _(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new d(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new f(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},b.prototype.unload=function(){var u,C,z,ne,de,Te,ye,j,W;(u=this._media_element)===null||u===void 0||u.pause(),(C=this._live_latency_synchronizer)===null||C===void 0||C.destroy(),this._live_latency_synchronizer=null,(z=this._live_latency_chaser)===null||z===void 0||z.destroy(),this._live_latency_chaser=null,(ne=this._startup_stall_jumper)===null||ne===void 0||ne.destroy(),this._startup_stall_jumper=null,(de=this._loading_controller)===null||de===void 0||de.destroy(),this._loading_controller=null,(Te=this._seeking_handler)===null||Te===void 0||Te.destroy(),this._seeking_handler=null,(ye=this._mse_controller)===null||ye===void 0||ye.flush(),(j=this._transmuxer)===null||j===void 0||j.close(),(W=this._transmuxer)===null||W===void 0||W.destroy(),this._transmuxer=null},b.prototype.play=function(){return this._media_element.play()},b.prototype.pause=function(){this._media_element.pause()},b.prototype.seek=function(u){this._media_element&&this._seeking_handler?this._seeking_handler.seek(u):this._pending_seek_time=u},Object.defineProperty(b.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),b.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},b.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},b.prototype._onMSEBufferFull=function(){T.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},b.prototype._onMSEError=function(u){this._emitter.emit(M.a.ERROR,P.b.MEDIA_ERROR,P.a.MEDIA_MSE_ERROR,u)},b.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(T.a.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},b.prototype._onMSEEndStreaming=function(){this._config.isLive||(T.a.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},b.prototype._onMediaLoadedMetadata=function(u){this._loaded_metadata_received=!0,this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},b.prototype._onRequestDirectSeek=function(u){this._seeking_handler.directSeek(u)},b.prototype._onRequiredUnbufferedSeek=function(u){this._mse_controller.flush(),this._transmuxer.seek(u)},b.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},b.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},b.prototype._fillStatisticsInfo=function(u){if(u.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return u;var C=!0,z=0,ne=0;if(this._media_element.getVideoPlaybackQuality){var de=this._media_element.getVideoPlaybackQuality();z=de.totalVideoFrames,ne=de.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(z=this._media_element.webkitDecodedFrameCount,ne=this._media_element.webkitDroppedFrameCount):C=!1;return C&&(u.decodedFrames=z,u.droppedFrames=ne),u},b}(),J=B(18),F=B(8),K=function(){function b(u,C){this.TAG="PlayerEngineDedicatedThread",this._emitter=new E,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=u,this._config=v(),typeof C=="object"&&Object.assign(this._config,C),u.isLive===!0&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},F.a.registerListener(this.e.onLoggingConfigChanged),this._worker=J(24,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:F.a.getConfig()})}return b.isSupported=function(){return!!self.Worker&&(!(!self.MediaSource||!("canConstructInDedicatedWorker"in self.MediaSource)||self.MediaSource.canConstructInDedicatedWorker!==!0)||!(!self.ManagedMediaSource||!("canConstructInDedicatedWorker"in self.ManagedMediaSource)||self.ManagedMediaSource.canConstructInDedicatedWorker!==!0))},b.prototype.destroy=function(){this._emitter.emit(M.a.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),F.a.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},b.prototype.on=function(u,C){var z=this;this._emitter.addListener(u,C),u===M.a.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return z._emitter.emit(M.a.MEDIA_INFO,z.mediaInfo)}):u==M.a.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return z._emitter.emit(M.a.STATISTICS_INFO,z.statisticsInfo)})},b.prototype.off=function(u,C){this._emitter.removeListener(u,C)},b.prototype.attachMediaElement=function(u){this._media_element=u,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},b.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},b.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new D(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new c(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new _(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new d(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new f(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},b.prototype.unload=function(){var u,C,z,ne,de,Te;(u=this._media_element)===null||u===void 0||u.pause(),this._worker.postMessage({cmd:"unload"}),(C=this._live_latency_synchronizer)===null||C===void 0||C.destroy(),this._live_latency_synchronizer=null,(z=this._live_latency_chaser)===null||z===void 0||z.destroy(),this._live_latency_chaser=null,(ne=this._startup_stall_jumper)===null||ne===void 0||ne.destroy(),this._startup_stall_jumper=null,(de=this._loading_controller)===null||de===void 0||de.destroy(),this._loading_controller=null,(Te=this._seeking_handler)===null||Te===void 0||Te.destroy(),this._seeking_handler=null},b.prototype.play=function(){return this._media_element.play()},b.prototype.pause=function(){this._media_element.pause()},b.prototype.seek=function(u){this._media_element&&this._seeking_handler?this._seeking_handler.seek(u):this._pending_seek_time=u},Object.defineProperty(b.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),b.prototype._onLoggingConfigChanged=function(u){var C;(C=this._worker)===null||C===void 0||C.postMessage({cmd:"logging_config",logging_config:u})},b.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},b.prototype._onMSEBufferFull=function(){T.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},b.prototype._onMediaLoadedMetadata=function(u){this._pending_seek_time!=null&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},b.prototype._onRequestDirectSeek=function(u){this._seeking_handler.directSeek(u)},b.prototype._onRequiredUnbufferedSeek=function(u){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:u})},b.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},b.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},b.prototype._onMediaTimeUpdate=function(u){this._worker.postMessage({cmd:"timeupdate",current_time:u.target.currentTime})},b.prototype._onMediaReadyStateChange=function(u){this._worker.postMessage({cmd:"readystatechange",ready_state:u.target.readyState})},b.prototype._onWorkerMessage=function(u){var C,z=u.data,ne=z.msg;if(ne=="destroyed"||this._worker_destroying)return this._worker_destroying=!1,(C=this._worker)===null||C===void 0||C.terminate(),void(this._worker=null);switch(ne){case"mse_init":var de=z;"ManagedMediaSource"in self&&!("MediaSource"in self)&&(this._media_element.disableRemotePlayback=!0),this._media_element.srcObject=de.handle;break;case"mse_event":(de=z).event==N.a.UPDATE_END?this._onMSEUpdateEnd():de.event==N.a.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((de=z).event==k.a.MEDIA_INFO){var Te=z;this._media_info=Te.info,this._emitter.emit(M.a.MEDIA_INFO,Object.assign({},Te.info))}else if(de.event==k.a.STATISTICS_INFO){var ye=z;this._statistics_info=this._fillStatisticsInfo(ye.info),this._emitter.emit(M.a.STATISTICS_INFO,Object.assign({},ye.info))}else if(de.event==k.a.RECOMMEND_SEEKPOINT){var j=z;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(j.milliseconds/1e3)}break;case"player_event":if((de=z).event==M.a.ERROR){var W=z;this._emitter.emit(M.a.ERROR,W.error_type,W.error_detail,W.info)}else if("extraData"in de){var ie=z;this._emitter.emit(ie.event,ie.extraData)}break;case"logcat_callback":de=z,T.a.emitter.emit("log",de.type,de.logcat);break;case"buffered_position_changed":de=z,this._loading_controller.notifyBufferedPositionChanged(de.buffered_position_milliseconds/1e3)}},b.prototype._fillStatisticsInfo=function(u){if(u.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return u;var C=!0,z=0,ne=0;if(this._media_element.getVideoPlaybackQuality){var de=this._media_element.getVideoPlaybackQuality();z=de.totalVideoFrames,ne=de.droppedVideoFrames}else this._media_element.webkitDecodedFrameCount!=null?(z=this._media_element.webkitDecodedFrameCount,ne=this._media_element.webkitDroppedFrameCount):C=!1;return C&&(u.decodedFrames=z,u.droppedFrames=ne),u},b}(),oe=function(){function b(u,C){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var z=u.type.toLowerCase();if(z!=="mse"&&z!=="mpegts"&&z!=="m2ts"&&z!=="flv")throw new X.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(C&&C.enableWorkerForMSE&&K.isSupported())try{this._player_engine=new K(u,C)}catch{T.a.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new V(u,C)}else this._player_engine=new V(u,C)}return b.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},b.prototype.on=function(u,C){this._player_engine.on(u,C)},b.prototype.off=function(u,C){this._player_engine.off(u,C)},b.prototype.attachMediaElement=function(u){this._media_element=u,this._player_engine.attachMediaElement(u)},b.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},b.prototype.load=function(){this._player_engine.load()},b.prototype.unload=function(){this._player_engine.unload()},b.prototype.play=function(){return this._player_engine.play()},b.prototype.pause=function(){this._player_engine.pause()},Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this._media_element.volume},set:function(u){this._media_element.volume=u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"muted",{get:function(){return this._media_element.muted},set:function(u){this._media_element.muted=u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(u){this._player_engine.seek(u)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),b}(),Ee=function(){function b(u,C){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new L.a,this._config=v(),typeof C=="object"&&Object.assign(this._config,C);var z=u.type.toLowerCase();if(z==="mse"||z==="mpegts"||z==="m2ts"||z==="flv")throw new X.b("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(u.hasOwnProperty("segments"))throw new X.b("NativePlayer(".concat(u.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=u,this._mediaElement=null}return b.prototype.destroy=function(){this._emitter.emit(M.a.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},b.prototype.on=function(u,C){var z=this;u===M.a.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){z._emitter.emit(M.a.MEDIA_INFO,z.mediaInfo)}):u===M.a.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){z._emitter.emit(M.a.STATISTICS_INFO,z.statisticsInfo)}),this._emitter.addListener(u,C)},b.prototype.off=function(u,C){this._emitter.removeListener(u,C)},b.prototype.attachMediaElement=function(u){if(this._mediaElement=u,u.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{u.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},b.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},b.prototype.load=function(){if(!this._mediaElement)throw new X.a("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},b.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},b.prototype.play=function(){return this._mediaElement.play()},b.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(u){this._mediaElement.volume=u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(u){this._mediaElement.muted=u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(u){this._mediaElement?this._mediaElement.currentTime=u:this._pendingSeekTime=u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"mediaInfo",{get:function(){var u={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(u.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(u.width=this._mediaElement.videoWidth,u.height=this._mediaElement.videoHeight)),u},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"statisticsInfo",{get:function(){var u={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return u;var C=!0,z=0,ne=0;if(this._mediaElement.getVideoPlaybackQuality){var de=this._mediaElement.getVideoPlaybackQuality();z=de.totalVideoFrames,ne=de.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(z=this._mediaElement.webkitDecodedFrameCount,ne=this._mediaElement.webkitDroppedFrameCount):C=!1;return C&&(u.decodedFrames=z,u.droppedFrames=ne),u},enumerable:!1,configurable:!0}),b.prototype._onvLoadedMetadata=function(u){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(M.a.MEDIA_INFO,this.mediaInfo)},b.prototype._reportStatisticsInfo=function(){this._emitter.emit(M.a.STATISTICS_INFO,this.statisticsInfo)},b}();G.a.install();var _e={createPlayer:function(b,u){var C=b;if(C==null||typeof C!="object")throw new X.b("MediaDataSource must be an javascript object!");if(!C.hasOwnProperty("type"))throw new X.b("MediaDataSource must has type field to indicate video file type!");switch(C.type){case"mse":case"mpegts":case"m2ts":case"flv":return new oe(C,u);default:return new Ee(C,u)}},isSupported:function(){return S.supportMSEH264Playback()},getFeatureList:function(){return S.getFeatureList()}};_e.BaseLoader=g.a,_e.LoaderStatus=g.c,_e.LoaderErrors=g.b,_e.Events=M.a,_e.ErrorTypes=P.b,_e.ErrorDetails=P.a,_e.MSEPlayer=oe,_e.NativePlayer=Ee,_e.LoggingControl=F.a,Object.defineProperty(_e,"version",{enumerable:!0,get:function(){return"1.8.0"}}),te.default=_e}])})}(at)),at.exports}var Jt=Qt();const Zt=Xt(Jt),ti=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"}));export{ti as m};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.