123456789 |
- import{p as zt}from"./index-DT8qTvyx.js";function Ht(ze,Ye){for(var pe=0;pe<Ye.length;pe++){const Z=Ye[pe];if(typeof Z!="string"&&!Array.isArray(Z)){for(const O in Z)if(O!=="default"&&!(O in ze)){const N=Object.getOwnPropertyDescriptor(Z,O);N&&Object.defineProperty(ze,O,N.get?N:{enumerable:!0,get:()=>Z[O]})}}}return Object.freeze(Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"}))}var vt={exports:{}};(function(ze,Ye){(function(pe,Z){ze.exports=Z()})(window,function(){return function(pe){var Z={};function O(N){if(Z[N])return Z[N].exports;var I=Z[N]={i:N,l:!1,exports:{}};return pe[N].call(I.exports,I,I.exports,O),I.l=!0,I.exports}return O.m=pe,O.c=Z,O.d=function(N,I,m){O.o(N,I)||Object.defineProperty(N,I,{enumerable:!0,get:m})},O.r=function(N){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},O.t=function(N,I){if(1&I&&(N=O(N)),8&I||4&I&&typeof N=="object"&&N&&N.__esModule)return N;var m=Object.create(null);if(O.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:N}),2&I&&typeof N!="string")for(var b in N)O.d(m,b,(function(v){return N[v]}).bind(null,b));return m},O.n=function(N){var I=N&&N.__esModule?function(){return N.default}:function(){return N};return O.d(I,"a",I),I},O.o=function(N,I){return Object.prototype.hasOwnProperty.call(N,I)},O.p="",O(O.s=14)}([function(pe,Z,O){var N=O(6),I=O.n(N),m=function(){function b(){}return b.e=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","error",k),b.ENABLE_ERROR&&(console.error?console.error(k):console.warn?console.warn(k):console.log(k))},b.i=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","info",k),b.ENABLE_INFO&&(console.info?console.info(k):console.log(k))},b.w=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","warn",k),b.ENABLE_WARN&&(console.warn?console.warn(k):console.log(k))},b.d=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","debug",k),b.ENABLE_DEBUG&&(console.debug?console.debug(k):console.log(k))},b.v=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","verbose",k),b.ENABLE_VERBOSE&&console.log(k)},b}();m.GLOBAL_TAG="mpegts.js",m.FORCE_GLOBAL_TAG=!1,m.ENABLE_ERROR=!0,m.ENABLE_INFO=!0,m.ENABLE_WARN=!0,m.ENABLE_DEBUG=!0,m.ENABLE_VERBOSE=!0,m.ENABLE_CALLBACK=!1,m.emitter=new I.a,Z.a=m},function(pe,Z,O){Z.a={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},function(pe,Z,O){O.d(Z,"c",function(){return I}),O.d(Z,"b",function(){return m}),O.d(Z,"a",function(){return b});var N=O(3),I={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},m={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},b=function(){function v(f){this._type=f||"undefined",this._status=I.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return v.prototype.destroy=function(){this._status=I.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},v.prototype.isWorking=function(){return this._status===I.kConnecting||this._status===I.kBuffering},Object.defineProperty(v.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(f){this._onContentLengthKnown=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(f){this._onURLRedirect=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(f){this._onDataArrival=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onError",{get:function(){return this._onError},set:function(f){this._onError=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onComplete",{get:function(){return this._onComplete},set:function(f){this._onComplete=f},enumerable:!1,configurable:!0}),v.prototype.open=function(f,k){throw new N.c("Unimplemented abstract function!")},v.prototype.abort=function(){throw new N.c("Unimplemented abstract function!")},v}()},function(pe,Z,O){O.d(Z,"d",function(){return m}),O.d(Z,"a",function(){return b}),O.d(Z,"b",function(){return v}),O.d(Z,"c",function(){return f});var N,I=(N=function(k,x){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,j){C.__proto__=j}||function(C,j){for(var H in j)j.hasOwnProperty(H)&&(C[H]=j[H])})(k,x)},function(k,x){function C(){this.constructor=k}N(k,x),k.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}),m=function(){function k(x){this._message=x}return Object.defineProperty(k.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),k.prototype.toString=function(){return this.name+": "+this.message},k}(),b=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),x}(m),v=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),x}(m),f=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),x}(m)},function(pe,Z,O){var N={};(function(){var I=self.navigator.userAgent.toLowerCase(),m=/(edge)\/([\w.]+)/.exec(I)||/(opr)[\/]([\w.]+)/.exec(I)||/(chrome)[ \/]([\w.]+)/.exec(I)||/(iemobile)[\/]([\w.]+)/.exec(I)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(I)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(I)||/(webkit)[ \/]([\w.]+)/.exec(I)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(I)||/(msie) ([\w.]+)/.exec(I)||I.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(I)||I.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(I)||[],b=/(ipad)/.exec(I)||/(ipod)/.exec(I)||/(windows phone)/.exec(I)||/(iphone)/.exec(I)||/(kindle)/.exec(I)||/(android)/.exec(I)||/(windows)/.exec(I)||/(mac)/.exec(I)||/(linux)/.exec(I)||/(cros)/.exec(I)||[],v={browser:m[5]||m[3]||m[1]||"",version:m[2]||m[4]||"0",majorVersion:m[4]||m[2]||"0",platform:b[0]||""},f={};if(v.browser){f[v.browser]=!0;var k=v.majorVersion.split(".");f.version={major:parseInt(v.majorVersion,10),string:v.version},k.length>1&&(f.version.minor=parseInt(k[1],10)),k.length>2&&(f.version.build=parseInt(k[2],10))}v.platform&&(f[v.platform]=!0),(f.chrome||f.opr||f.safari)&&(f.webkit=!0),(f.rv||f.iemobile)&&(f.rv&&delete f.rv,v.browser="msie",f.msie=!0),f.edge&&(delete f.edge,v.browser="msedge",f.msedge=!0),f.opr&&(v.browser="opera",f.opera=!0),f.safari&&f.android&&(v.browser="android",f.android=!0);for(var x in f.name=v.browser,f.platform=v.platform,N)N.hasOwnProperty(x)&&delete N[x];Object.assign(N,f)})(),Z.a=N},function(pe,Z,O){Z.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(pe,Z,O){var N,I=typeof Reflect=="object"?Reflect:null,m=I&&typeof I.apply=="function"?I.apply:function(y,G,w){return Function.prototype.apply.call(y,G,w)};N=I&&typeof I.ownKeys=="function"?I.ownKeys:Object.getOwnPropertySymbols?function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:function(y){return Object.getOwnPropertyNames(y)};var b=Number.isNaN||function(y){return y!=y};function v(){v.init.call(this)}pe.exports=v,pe.exports.once=function(y,G){return new Promise(function(w,h){function _(l){y.removeListener(G,c),h(l)}function c(){typeof y.removeListener=="function"&&y.removeListener("error",_),w([].slice.call(arguments))}re(y,G,c,{once:!0}),G!=="error"&&function(l,P,D){typeof l.on=="function"&&re(l,"error",P,D)}(y,_,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var f=10;function k(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}function x(y){return y._maxListeners===void 0?v.defaultMaxListeners:y._maxListeners}function C(y,G,w,h){var _,c,l,P;if(k(w),(c=y._events)===void 0?(c=y._events=Object.create(null),y._eventsCount=0):(c.newListener!==void 0&&(y.emit("newListener",G,w.listener?w.listener:w),c=y._events),l=c[G]),l===void 0)l=c[G]=w,++y._eventsCount;else if(typeof l=="function"?l=c[G]=h?[w,l]:[l,w]:h?l.unshift(w):l.push(w),(_=x(y))>0&&l.length>_&&!l.warned){l.warned=!0;var D=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(G)+" listeners added. Use emitter.setMaxListeners() to increase limit");D.name="MaxListenersExceededWarning",D.emitter=y,D.type=G,D.count=l.length,P=D,console&&console.warn&&console.warn(P)}return y}function j(){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 H(y,G,w){var h={fired:!1,wrapFn:void 0,target:y,type:G,listener:w},_=j.bind(h);return _.listener=w,h.wrapFn=_,_}function he(y,G,w){var h=y._events;if(h===void 0)return[];var _=h[G];return _===void 0?[]:typeof _=="function"?w?[_.listener||_]:[_]:w?function(c){for(var l=new Array(c.length),P=0;P<l.length;++P)l[P]=c[P].listener||c[P];return l}(_):J(_,_.length)}function de(y){var G=this._events;if(G!==void 0){var w=G[y];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}function J(y,G){for(var w=new Array(G),h=0;h<G;++h)w[h]=y[h];return w}function re(y,G,w,h){if(typeof y.on=="function")h.once?y.once(G,w):y.on(G,w);else{if(typeof y.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y);y.addEventListener(G,function _(c){h.once&&y.removeEventListener(G,_),w(c)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(y){if(typeof y!="number"||y<0||b(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");f=y}}),v.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},v.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||b(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this},v.prototype.getMaxListeners=function(){return x(this)},v.prototype.emit=function(y){for(var G=[],w=1;w<arguments.length;w++)G.push(arguments[w]);var h=y==="error",_=this._events;if(_!==void 0)h=h&&_.error===void 0;else if(!h)return!1;if(h){var c;if(G.length>0&&(c=G[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var P=_[y];if(P===void 0)return!1;if(typeof P=="function")m(P,this,G);else{var D=P.length,F=J(P,D);for(w=0;w<D;++w)m(F[w],this,G)}return!0},v.prototype.addListener=function(y,G){return C(this,y,G,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(y,G){return C(this,y,G,!0)},v.prototype.once=function(y,G){return k(G),this.on(y,H(this,y,G)),this},v.prototype.prependOnceListener=function(y,G){return k(G),this.prependListener(y,H(this,y,G)),this},v.prototype.removeListener=function(y,G){var w,h,_,c,l;if(k(G),(h=this._events)===void 0)return this;if((w=h[y])===void 0)return this;if(w===G||w.listener===G)--this._eventsCount==0?this._events=Object.create(null):(delete h[y],h.removeListener&&this.emit("removeListener",y,w.listener||G));else if(typeof w!="function"){for(_=-1,c=w.length-1;c>=0;c--)if(w[c]===G||w[c].listener===G){l=w[c].listener,_=c;break}if(_<0)return this;_===0?w.shift():function(P,D){for(;D+1<P.length;D++)P[D]=P[D+1];P.pop()}(w,_),w.length===1&&(h[y]=w[0]),h.removeListener!==void 0&&this.emit("removeListener",y,l||G)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(y){var G,w,h;if((w=this._events)===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[y]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete w[y]),this;if(arguments.length===0){var _,c=Object.keys(w);for(h=0;h<c.length;++h)(_=c[h])!=="removeListener"&&this.removeAllListeners(_);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(G=w[y])=="function")this.removeListener(y,G);else if(G!==void 0)for(h=G.length-1;h>=0;h--)this.removeListener(y,G[h]);return this},v.prototype.listeners=function(y){return he(this,y,!0)},v.prototype.rawListeners=function(y){return he(this,y,!1)},v.listenerCount=function(y,G){return typeof y.listenerCount=="function"?y.listenerCount(G):de.call(y,G)},v.prototype.listenerCount=de,v.prototype.eventNames=function(){return this._eventsCount>0?N(this._events):[]}},function(pe,Z,O){O.d(Z,"d",function(){return N}),O.d(Z,"b",function(){return I}),O.d(Z,"a",function(){return m}),O.d(Z,"c",function(){return b});var N=function(v,f,k,x,C){this.dts=v,this.pts=f,this.duration=k,this.originalDts=x,this.isSyncPoint=C,this.fileposition=null},I=function(){function v(){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 v.prototype.appendSyncPoint=function(f){f.isSyncPoint=!0,this.syncPoints.push(f)},v}(),m=function(){function v(){this._list=[]}return v.prototype.clear=function(){this._list=[]},v.prototype.appendArray=function(f){var k=this._list;f.length!==0&&(k.length>0&&f[0].originalDts<k[k.length-1].originalDts&&this.clear(),Array.prototype.push.apply(k,f))},v.prototype.getLastSyncPointBeforeDts=function(f){if(this._list.length==0)return null;var k=this._list,x=0,C=k.length-1,j=0,H=0,he=C;for(f<k[0].dts&&(x=0,H=he+1);H<=he;){if((j=H+Math.floor((he-H)/2))===C||f>=k[j].dts&&f<k[j+1].dts){x=j;break}k[j].dts<f?H=j+1:he=j-1}return this._list[x]},v}(),b=function(){function v(f){this._type=f,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(v.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),v.prototype.isEmpty=function(){return this._list.length===0},v.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},v.prototype._searchNearestSegmentBefore=function(f){var k=this._list;if(k.length===0)return-2;var x=k.length-1,C=0,j=0,H=x,he=0;if(f<k[0].originalBeginDts)return he=-1;for(;j<=H;){if((C=j+Math.floor((H-j)/2))===x||f>k[C].lastSample.originalDts&&f<k[C+1].originalBeginDts){he=C;break}k[C].originalBeginDts<f?j=C+1:H=C-1}return he},v.prototype._searchNearestSegmentAfter=function(f){return this._searchNearestSegmentBefore(f)+1},v.prototype.append=function(f){var k=this._list,x=f,C=this._lastAppendLocation,j=0;C!==-1&&C<k.length&&x.originalBeginDts>=k[C].lastSample.originalDts&&(C===k.length-1||C<k.length-1&&x.originalBeginDts<k[C+1].originalBeginDts)?j=C+1:k.length>0&&(j=this._searchNearestSegmentBefore(x.originalBeginDts)+1),this._lastAppendLocation=j,this._list.splice(j,0,x)},v.prototype.getLastSegmentBefore=function(f){var k=this._searchNearestSegmentBefore(f);return k>=0?this._list[k]:null},v.prototype.getLastSampleBefore=function(f){var k=this.getLastSegmentBefore(f);return k!=null?k.lastSample:null},v.prototype.getLastSyncPointBefore=function(f){for(var k=this._searchNearestSegmentBefore(f),x=this._list[k].syncPoints;x.length===0&&k>0;)k--,x=this._list[k].syncPoints;return x.length>0?x[x.length-1]:null},v}()},function(pe,Z,O){var N=function(){function I(){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 I.prototype.isComplete=function(){var m=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,b=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&&m&&b},I.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},I.prototype.getNearestKeyframe=function(m){if(this.keyframesIndex==null)return null;var b=this.keyframesIndex,v=this._search(b.times,m);return{index:v,milliseconds:b.times[v],fileposition:b.filepositions[v]}},I.prototype._search=function(m,b){var v=0,f=m.length-1,k=0,x=0,C=f;for(b<m[0]&&(v=0,x=C+1);x<=C;){if((k=x+Math.floor((C-x)/2))===f||b>=m[k]&&b<m[k+1]){v=k;break}m[k]<b?x=k+1:C=k-1}return v},I}();Z.a=N},function(pe,Z,O){var N=O(6),I=O.n(N),m=O(0),b=function(){function v(){}return Object.defineProperty(v,"forceGlobalTag",{get:function(){return m.a.FORCE_GLOBAL_TAG},set:function(f){m.a.FORCE_GLOBAL_TAG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"globalTag",{get:function(){return m.a.GLOBAL_TAG},set:function(f){m.a.GLOBAL_TAG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableAll",{get:function(){return m.a.ENABLE_VERBOSE&&m.a.ENABLE_DEBUG&&m.a.ENABLE_INFO&&m.a.ENABLE_WARN&&m.a.ENABLE_ERROR},set:function(f){m.a.ENABLE_VERBOSE=f,m.a.ENABLE_DEBUG=f,m.a.ENABLE_INFO=f,m.a.ENABLE_WARN=f,m.a.ENABLE_ERROR=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableDebug",{get:function(){return m.a.ENABLE_DEBUG},set:function(f){m.a.ENABLE_DEBUG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableVerbose",{get:function(){return m.a.ENABLE_VERBOSE},set:function(f){m.a.ENABLE_VERBOSE=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableInfo",{get:function(){return m.a.ENABLE_INFO},set:function(f){m.a.ENABLE_INFO=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableWarn",{get:function(){return m.a.ENABLE_WARN},set:function(f){m.a.ENABLE_WARN=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableError",{get:function(){return m.a.ENABLE_ERROR},set:function(f){m.a.ENABLE_ERROR=f,v._notifyChange()},enumerable:!1,configurable:!0}),v.getConfig=function(){return{globalTag:m.a.GLOBAL_TAG,forceGlobalTag:m.a.FORCE_GLOBAL_TAG,enableVerbose:m.a.ENABLE_VERBOSE,enableDebug:m.a.ENABLE_DEBUG,enableInfo:m.a.ENABLE_INFO,enableWarn:m.a.ENABLE_WARN,enableError:m.a.ENABLE_ERROR,enableCallback:m.a.ENABLE_CALLBACK}},v.applyConfig=function(f){m.a.GLOBAL_TAG=f.globalTag,m.a.FORCE_GLOBAL_TAG=f.forceGlobalTag,m.a.ENABLE_VERBOSE=f.enableVerbose,m.a.ENABLE_DEBUG=f.enableDebug,m.a.ENABLE_INFO=f.enableInfo,m.a.ENABLE_WARN=f.enableWarn,m.a.ENABLE_ERROR=f.enableError,m.a.ENABLE_CALLBACK=f.enableCallback},v._notifyChange=function(){var f=v.emitter;if(f.listenerCount("change")>0){var k=v.getConfig();f.emit("change",k)}},v.registerListener=function(f){v.emitter.addListener("change",f)},v.removeListener=function(f){v.emitter.removeListener("change",f)},v.addLogListener=function(f){m.a.emitter.addListener("log",f),m.a.emitter.listenerCount("log")>0&&(m.a.ENABLE_CALLBACK=!0,v._notifyChange())},v.removeLogListener=function(f){m.a.emitter.removeListener("log",f),m.a.emitter.listenerCount("log")===0&&(m.a.ENABLE_CALLBACK=!1,v._notifyChange())},v}();b.emitter=new I.a,Z.a=b},function(pe,Z,O){var N=O(6),I=O.n(N),m=O(0),b=O(4),v=O(8);function f(n,t,i){var e=n;if(t+i<e.length){for(;i--;)if((192&e[++t])!=128)return!1;return!0}return!1}var k,x=function(n){for(var t=[],i=n,e=0,a=n.length;e<a;)if(i[e]<128)t.push(String.fromCharCode(i[e])),++e;else{if(!(i[e]<192)){if(i[e]<224){if(f(i,e,1)&&(s=(31&i[e])<<6|63&i[e+1])>=128){t.push(String.fromCharCode(65535&s)),e+=2;continue}}else if(i[e]<240){if(f(i,e,2)&&(s=(15&i[e])<<12|(63&i[e+1])<<6|63&i[e+2])>=2048&&(63488&s)!=55296){t.push(String.fromCharCode(65535&s)),e+=3;continue}}else if(i[e]<248){var s;if(f(i,e,3)&&(s=(7&i[e])<<18|(63&i[e+1])<<12|(63&i[e+2])<<6|63&i[e+3])>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),e+=4;continue}}}t.push("�"),++e}return t.join("")},C=O(3),j=(k=new ArrayBuffer(2),new DataView(k).setInt16(0,256,!0),new Int16Array(k)[0]===256),H=function(){function n(){}return n.parseScriptData=function(t,i,e){var a={};try{var s=n.parseValue(t,i,e),r=n.parseValue(t,i+s.size,e-s.size);a[s.data]=r.data}catch(o){m.a.e("AMF",o.toString())}return a},n.parseObject=function(t,i,e){if(e<3)throw new C.a("Data not enough when parse ScriptDataObject");var a=n.parseString(t,i,e),s=n.parseValue(t,i+a.size,e-a.size),r=s.objectEnd;return{data:{name:a.data,value:s.data},size:a.size+s.size,objectEnd:r}},n.parseVariable=function(t,i,e){return n.parseObject(t,i,e)},n.parseString=function(t,i,e){if(e<2)throw new C.a("Data not enough when parse String");var a=new DataView(t,i,e).getUint16(0,!j);return{data:a>0?x(new Uint8Array(t,i+2,a)):"",size:2+a}},n.parseLongString=function(t,i,e){if(e<4)throw new C.a("Data not enough when parse LongString");var a=new DataView(t,i,e).getUint32(0,!j);return{data:a>0?x(new Uint8Array(t,i+4,a)):"",size:4+a}},n.parseDate=function(t,i,e){if(e<10)throw new C.a("Data size invalid when parse Date");var a=new DataView(t,i,e),s=a.getFloat64(0,!j),r=a.getInt16(8,!j);return{data:new Date(s+=60*r*1e3),size:10}},n.parseValue=function(t,i,e){if(e<1)throw new C.a("Data not enough when parse Value");var a,s=new DataView(t,i,e),r=1,o=s.getUint8(0),p=!1;try{switch(o){case 0:a=s.getFloat64(1,!j),r+=8;break;case 1:a=!!s.getUint8(1),r+=1;break;case 2:var g=n.parseString(t,i+1,e-1);a=g.data,r+=g.size;break;case 3:a={};var E=0;for((16777215&s.getUint32(e-4,!j))==9&&(E=3);r<e-4;){var A=n.parseObject(t,i+r,e-r-E);if(A.objectEnd)break;a[A.data.name]=A.data.value,r+=A.size}r<=e-3&&(16777215&s.getUint32(r-1,!j))===9&&(r+=3);break;case 8:for(a={},r+=4,E=0,(16777215&s.getUint32(e-4,!j))==9&&(E=3);r<e-8;){var S=n.parseVariable(t,i+r,e-r-E);if(S.objectEnd)break;a[S.data.name]=S.data.value,r+=S.size}r<=e-3&&(16777215&s.getUint32(r-1,!j))===9&&(r+=3);break;case 9:a=void 0,r=1,p=!0;break;case 10:a=[];var T=s.getUint32(1,!j);r+=4;for(var B=0;B<T;B++){var z=n.parseValue(t,i+r,e-r);a.push(z.data),r+=z.size}break;case 11:var U=n.parseDate(t,i+1,e-1);a=U.data,r+=U.size;break;case 12:var Y=n.parseString(t,i+1,e-1);a=Y.data,r+=Y.size;break;default:r=e,m.a.w("AMF","Unsupported AMF value type "+o)}}catch(W){m.a.e("AMF",W.toString())}return{data:a,size:r,objectEnd:p}},n}(),he=function(){function n(t){this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return n.prototype.destroy=function(){this._buffer=null},n.prototype._fillCurrentWord=function(){var t=this._total_bytes-this._buffer_index;if(t<=0)throw new C.a("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),e=new Uint8Array(4);e.set(this._buffer.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(e.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},n.prototype.readBits=function(t){if(t>32)throw new C.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(t<=this._current_word_bits_left){var i=this._current_word>>>32-t;return this._current_word<<=t,this._current_word_bits_left-=t,i}var e=this._current_word_bits_left?this._current_word:0;e>>>=32-this._current_word_bits_left;var a=t-this._current_word_bits_left;this._fillCurrentWord();var s=Math.min(a,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},n.prototype.readBool=function(){return this.readBits(1)===1},n.prototype.readByte=function(){return this.readBits(8)},n.prototype._skipLeadingZero=function(){var t;for(t=0;t<this._current_word_bits_left;t++)if(this._current_word&2147483648>>>t)return this._current_word<<=t,this._current_word_bits_left-=t,t;return this._fillCurrentWord(),t+this._skipLeadingZero()},n.prototype.readUEG=function(){var t=this._skipLeadingZero();return this.readBits(t+1)-1},n.prototype.readSEG=function(){var t=this.readUEG();return 1&t?t+1>>>1:-1*(t>>>1)},n}(),de=function(){function n(){}return n._ebsp2rbsp=function(t){for(var i=t,e=i.byteLength,a=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&i[r]===3&&i[r-1]===0&&i[r-2]===0||(a[s]=i[r],s++);return new Uint8Array(a.buffer,0,s)},n.parseSPS=function(t){for(var i=t.subarray(1,4),e="avc1.",a=0;a<3;a++){var s=i[a].toString(16);s.length<2&&(s="0"+s),e+=s}var r=n._ebsp2rbsp(t),o=new he(r);o.readByte();var p=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var E=n.getProfileString(p),A=n.getLevelString(g),S=1,T=420,B=8,z=8;if((p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128||p===138||p===144)&&((S=o.readUEG())===3&&o.readBits(1),S<=3&&(T=[0,420,422,444][S]),B=o.readUEG()+8,z=o.readUEG()+8,o.readBits(1),o.readBool()))for(var U=S!==3?8:12,Y=0;Y<U;Y++)o.readBool()&&(Y<6?n._skipScalingList(o,16):n._skipScalingList(o,64));o.readUEG();var W=o.readUEG();if(W===0)o.readUEG();else if(W===1){o.readBits(1),o.readSEG(),o.readSEG();var q=o.readUEG();for(Y=0;Y<q;Y++)o.readSEG()}var oe=o.readUEG();o.readBits(1);var ue=o.readUEG(),K=o.readUEG(),Q=o.readBits(1);Q===0&&o.readBits(1),o.readBits(1);var ce=0,te=0,ae=0,be=0;o.readBool()&&(ce=o.readUEG(),te=o.readUEG(),ae=o.readUEG(),be=o.readUEG());var Ae=1,_e=1,ye=0,Re=!0,ke=0,Ue=0;if(o.readBool()){if(o.readBool()){var Oe=o.readByte();Oe>0&&Oe<16?(Ae=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Oe-1],_e=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Oe-1]):Oe===255&&(Ae=o.readByte()<<8|o.readByte(),_e=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 Ne=o.readBits(32),Ve=o.readBits(32);Re=o.readBool(),ye=(ke=Ve)/(Ue=2*Ne)}}var Ge=1;Ae===1&&_e===1||(Ge=Ae/_e);var Ce=0,ge=0;S===0?(Ce=1,ge=2-Q):(Ce=S===3?1:2,ge=(S===1?2:1)*(2-Q));var Me=16*(ue+1),xe=16*(K+1)*(2-Q);Me-=(ce+te)*Ce,xe-=(ae+be)*ge;var We=Math.ceil(Me*Ge);return o.destroy(),o=null,{codec_mimetype:e,profile_idc:p,level_idc:g,profile_string:E,level_string:A,chroma_format_idc:S,bit_depth:B,bit_depth_luma:B,bit_depth_chroma:z,ref_frames:oe,chroma_format:T,chroma_format_string:n.getChromaFormatString(T),frame_rate:{fixed:Re,fps:ye,fps_den:Ue,fps_num:ke},sar_ratio:{width:Ae,height:_e},codec_size:{width:Me,height:xe},present_size:{width:We,height:xe}}},n._skipScalingList=function(t,i){for(var e=8,a=8,s=0;s<i;s++)a!==0&&(a=(e+t.readSEG()+256)%256),e=a===0?e:a},n.getProfileString=function(t){switch(t){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"}},n.getLevelString=function(t){return(t/10).toFixed(1)},n.getChromaFormatString=function(t){switch(t){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},n}(),J=O(5),re=function(){function n(){}return n._ebsp2rbsp=function(t){for(var i=t,e=i.byteLength,a=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&i[r]===3&&i[r-1]===0&&i[r-2]===0||(a[s]=i[r],s++);return new Uint8Array(a.buffer,0,s)},n.parseVPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);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()}},n.parseSPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);e.readByte(),e.readByte();for(var a=0,s=0,r=0,o=0,p=(e.readBits(4),e.readBits(3)),g=(e.readBool(),e.readBits(2)),E=e.readBool(),A=e.readBits(5),S=e.readByte(),T=e.readByte(),B=e.readByte(),z=e.readByte(),U=e.readByte(),Y=e.readByte(),W=e.readByte(),q=e.readByte(),oe=e.readByte(),ue=e.readByte(),K=e.readByte(),Q=[],ce=[],te=0;te<p;te++)Q.push(e.readBool()),ce.push(e.readBool());if(p>0)for(te=p;te<8;te++)e.readBits(2);for(te=0;te<p;te++)Q[te]&&(e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte()),ce[te]&&e.readByte();e.readUEG();var ae=e.readUEG();ae==3&&e.readBits(1);var be=e.readUEG(),Ae=e.readUEG();e.readBool()&&(a+=e.readUEG(),s+=e.readUEG(),r+=e.readUEG(),o+=e.readUEG());var _e=e.readUEG(),ye=e.readUEG(),Re=e.readUEG();for(te=e.readBool()?0:p;te<=p;te++)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 ke=0;ke<4;ke++)for(var Ue=0;Ue<(ke===3?2:6);Ue++)if(e.readBool()){var Oe=Math.min(64,1<<4+(ke<<1));for(ke>1&&e.readSEG(),te=0;te<Oe;te++)e.readSEG()}else e.readUEG();e.readBool(),e.readBool(),e.readBool()&&(e.readByte(),e.readUEG(),e.readUEG(),e.readBool());var Ne=e.readUEG(),Ve=0;for(te=0;te<Ne;te++){var Ge=!1;if(te!==0&&(Ge=e.readBool()),Ge){te===Ne&&e.readUEG(),e.readBool(),e.readUEG();for(var Ce=0,ge=0;ge<=Ve;ge++){var Me=e.readBool(),xe=!1;Me||(xe=e.readBool()),(Me||xe)&&Ce++}Ve=Ce}else{var We=e.readUEG(),_t=e.readUEG();for(Ve=We+_t,ge=0;ge<We;ge++)e.readUEG(),e.readBool();for(ge=0;ge<_t;ge++)e.readUEG(),e.readBool()}}if(e.readBool()){var Vt=e.readUEG();for(te=0;te<Vt;te++){for(ge=0;ge<Re+4;ge++)e.readBits(1);e.readBits(1)}}var ht=0,He=1,qe=1,ct=!1,et=1,tt=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()&&(et=e.readBits(32),tt=e.readBits(32),e.readBool()&&(e.readUEG(),e.readBool()))){var it=!1,nt=!1,Xe=!1;for(it=e.readBool(),nt=e.readBool(),(it||nt)&&((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)),te=0;te<=p;te++){var ut=e.readBool();ct=ut;var lt=!1,at=1;ut||(lt=e.readBool());var ft=!1;if(lt?e.readSEG():ft=e.readBool(),ft||(at=e.readUEG()+1),it)for(ge=0;ge<at;ge++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG());if(nt)for(ge=0;ge<at;ge++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG())}}e.readBool()&&(e.readBool(),e.readBool(),e.readBool(),ht=e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG())}e.readBool();var jt="hvc1."+A+".1.L"+K+".B0",pt=be-(a+s)*(ae===1||ae===2?2:1),mt=Ae-(r+o)*(ae===1?2:1),gt=1;return He!==1&&qe!==1&&(gt=He/qe),e.destroy(),e=null,{codec_mimetype:jt,level_string:n.getLevelString(K),profile_idc:A,bit_depth:_e+8,ref_frames:1,chroma_format:ae,chroma_format_string:n.getChromaFormatString(ae),general_level_idc:K,general_profile_space:g,general_tier_flag:E,general_profile_idc:A,general_profile_compatibility_flags_1:S,general_profile_compatibility_flags_2:T,general_profile_compatibility_flags_3:B,general_profile_compatibility_flags_4:z,general_constraint_indicator_flags_1:U,general_constraint_indicator_flags_2:Y,general_constraint_indicator_flags_3:W,general_constraint_indicator_flags_4:q,general_constraint_indicator_flags_5:oe,general_constraint_indicator_flags_6:ue,min_spatial_segmentation_idc:ht,constant_frame_rate:0,chroma_format_idc:ae,bit_depth_luma_minus8:_e,bit_depth_chroma_minus8:ye,frame_rate:{fixed:ct,fps:tt/et,fps_den:et,fps_num:tt},sar_ratio:{width:He,height:qe},codec_size:{width:pt,height:mt},present_size:{width:pt*gt,height:mt}}},n.parsePPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);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 a=e.readBool(),s=e.readBool(),r=1;return s&&a?r=0:s?r=3:a&&(r=2),{parallelismType:r}},n.getChromaFormatString=function(t){switch(t){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"}},n.getProfileString=function(t){switch(t){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},n.getLevelString=function(t){return(t/30).toFixed(1)},n}();function y(n){return n.byteOffset%2==0&&n.byteLength%2==0}function G(n){return n.byteOffset%4==0&&n.byteLength%4==0}function w(n,t){for(var i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}var h=function(n,t){return n.byteLength===t.byteLength&&(G(n)&&G(t)?function(i,e){return w(new Uint32Array(i.buffer,i.byteOffset,i.byteLength/4),new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4))}(n,t):y(n)&&y(t)?function(i,e){return w(new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2))}(n,t):function(i,e){return w(i,e)}(n,t))},_,c=function(){function n(t,i){this.TAG="FLVDemuxer",this._config=i,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new v.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 n.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},n.probe=function(t){var i=new Uint8Array(t);if(i.byteLength<9)return{needMoreData:!0};var e={match:!1};if(i[0]!==70||i[1]!==76||i[2]!==86||i[3]!==1)return e;var a,s,r=(4&i[4])>>>2!=0,o=(1&i[4])!=0,p=(a=i)[s=5]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3];return p<9?e:{match:!0,consumed:p,dataOffset:p,hasAudioTrack:r,hasVideoTrack:o}},n.prototype.bindDataSource=function(t){return t.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(n.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(t){this._onTrackMetadata=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(t){this._onMediaInfo=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(t){this._onMetaDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(t){this._onScriptDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onError",{get:function(){return this._onError},set:function(t){this._onError=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(t){this._onDataAvailable=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(t){this._timestampBase=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedDuration",{get:function(){return this._duration},set:function(t){this._durationOverrided=!0,this._duration=t,this._mediaInfo.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasAudio",{set:function(t){this._hasAudioFlagOverrided=!0,this._hasAudio=t,this._mediaInfo.hasAudio=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasVideo",{set:function(t){this._hasVideoFlagOverrided=!0,this._hasVideo=t,this._mediaInfo.hasVideo=t},enumerable:!1,configurable:!0}),n.prototype.resetMediaInfo=function(){this._mediaInfo=new v.a},n.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},n.prototype.parseChunks=function(t,i){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new C.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var e=0,a=this._littleEndian;if(i===0){if(!(t.byteLength>13))return 0;e=n.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,i+e!==this._dataOffset&&m.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(s=new DataView(t,e)).getUint32(0,!a)!==0&&m.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),e+=4);e<t.byteLength;){this._dispatch=!0;var s=new DataView(t,e);if(e+11+4>t.byteLength)break;var r=s.getUint8(0),o=16777215&s.getUint32(0,!a);if(e+11+o+4>t.byteLength)break;if(r===8||r===9||r===18){var p=s.getUint8(4),g=s.getUint8(5),E=s.getUint8(6)|g<<8|p<<16|s.getUint8(7)<<24;16777215&s.getUint32(7,!a)&&m.a.w(this.TAG,"Meet tag which has StreamID != 0!");var A=e+11;switch(r){case 8:this._parseAudioData(t,A,o,E);break;case 9:this._parseVideoData(t,A,o,E,i+e);break;case 18:this._parseScriptData(t,A,o)}var S=s.getUint32(11+o,!a);S!==11+o&&m.a.w(this.TAG,"Invalid PrevTagSize "+S),e+=11+o+4}else m.a.w(this.TAG,"Unsupported tag type "+r+", skipped"),e+=11+o+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),e},n.prototype._parseScriptData=function(t,i,e){var a=H.parseScriptData(t,i,e);if(a.hasOwnProperty("onMetaData")){if(a.onMetaData==null||typeof a.onMetaData!="object")return void m.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&m.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=a;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 p=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=p,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=p}}if(typeof s.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var g=s.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(g),s.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=s,m.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(a).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},a))},n.prototype._parseKeyframesIndex=function(t){for(var i=[],e=[],a=1;a<t.times.length;a++){var s=this._timestampBase+Math.floor(1e3*t.times[a]);i.push(s),e.push(t.filepositions[a])}return{times:i,filepositions:e}},n.prototype._parseAudioData=function(t,i,e,a){if(e<=1)m.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(t,i,e).getUint8(0),r=s>>>4;if(r===2||r===10){var o=0,p=(12&s)>>>2;if(p>=0&&p<=4){o=this._flvSoundRateTable[p];var g=1&s,E=this._audioMetadata,A=this._audioTrack;if(E||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(E=this._audioMetadata={}).type="audio",E.id=A.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=o,E.channelCount=g===0?1:2),r===10){var S=this._parseAACAudioData(t,i+1,e-1);if(S==null)return;if(S.packetType===0){if(E.config){if(h(S.data.config,E.config))return;m.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=S.data;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.config=T.config,E.refSampleDuration=1024/E.audioSampleRate*E.timescale,m.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",E),(U=this._mediaInfo).audioCodec=E.originalCodec,U.audioSampleRate=E.audioSampleRate,U.audioChannelCount=E.channelCount,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}else if(S.packetType===1){var B=this._timestampBase+a,z={unit:S.data,length:S.data.byteLength,dts:B,pts:B};A.samples.push(z),A.length+=S.data.length}else m.a.e(this.TAG,"Flv: Unsupported AAC data type "+S.packetType)}else if(r===2){if(!E.codec){var U;if((T=this._parseMP3AudioData(t,i+1,e-1,!0))==null)return;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.timescale,m.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",E),(U=this._mediaInfo).audioCodec=E.codec,U.audioSampleRate=E.audioSampleRate,U.audioChannelCount=E.channelCount,U.audioDataRate=T.bitRate,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}var Y=this._parseMP3AudioData(t,i+1,e-1,!1);if(Y==null)return;B=this._timestampBase+a;var W={unit:Y,length:Y.byteLength,dts:B,pts:B};A.samples.push(W),A.length+=Y.length}}else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+p)}else this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+r)}},n.prototype._parseAACAudioData=function(t,i,e){if(!(e<=1)){var a={},s=new Uint8Array(t,i,e);return a.packetType=s[0],s[0]===0?a.data=this._parseAACAudioSpecificConfig(t,i+1,e-1):a.data=s.subarray(1),a}m.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},n.prototype._parseAACAudioSpecificConfig=function(t,i,e){var a,s,r=new Uint8Array(t,i,e),o=null,p=0,g=null;if(p=a=r[0]>>>3,(s=(7&r[0])<<1|r[1]>>>7)<0||s>=this._mpegSamplingRates.length)this._onError(J.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var E=this._mpegSamplingRates[s],A=(120&r[1])>>>3;if(!(A<0||A>=8)){p===5&&(g=(7&r[1])<<1|r[2]>>>7,(124&r[2])>>>2);var S=self.navigator.userAgent.toLowerCase();return S.indexOf("firefox")!==-1?s>=6?(p=5,o=new Array(4),g=s-3):(p=2,o=new Array(2),g=s):S.indexOf("android")!==-1?(p=2,o=new Array(2),g=s):(p=5,g=s,o=new Array(4),s>=6?g=s-3:A===1&&(p=2,o=new Array(2),g=s)),o[0]=p<<3,o[0]|=(15&s)>>>1,o[1]=(15&s)<<7,o[1]|=(15&A)<<3,p===5&&(o[1]|=(15&g)>>>1,o[2]=(1&g)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:E,channelCount:A,codec:"mp4a.40."+p,originalCodec:"mp4a.40."+a}}this._onError(J.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},n.prototype._parseMP3AudioData=function(t,i,e,a){if(!(e<4)){this._littleEndian;var s=new Uint8Array(t,i,e),r=null;if(a){if(s[0]!==255)return;var o=s[1]>>>3&3,p=(6&s[1])>>1,g=(240&s[2])>>>4,E=(12&s[2])>>>2,A=(s[3]>>>6&3)!==3?2:1,S=0,T=0;switch(o){case 0:S=this._mpegAudioV25SampleRateTable[E];break;case 2:S=this._mpegAudioV20SampleRateTable[E];break;case 3:S=this._mpegAudioV10SampleRateTable[E]}switch(p){case 1:g<this._mpegAudioL3BitRateTable.length&&(T=this._mpegAudioL3BitRateTable[g]);break;case 2:g<this._mpegAudioL2BitRateTable.length&&(T=this._mpegAudioL2BitRateTable[g]);break;case 3:g<this._mpegAudioL1BitRateTable.length&&(T=this._mpegAudioL1BitRateTable[g])}r={bitRate:T,samplingRate:S,channelCount:A,codec:"mp3",originalCodec:"mp3"}}else r=s;return r}m.a.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},n.prototype._parseVideoData=function(t,i,e,a,s){if(e<=1)m.a.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(this._hasVideoFlagOverrided!==!0||this._hasVideo!==!1){var r=new Uint8Array(t,i,e)[0],o=(112&r)>>>4;if(128&r){var p=15&r,g=String.fromCharCode.apply(String,new Uint8Array(t,i,e).slice(1,5));if(g!=="hvc1")return void this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+g);this._parseEnhancedHEVCVideoPacket(t,i+5,e-5,a,s,o,p)}else{var E=15&r;if(E===7)this._parseAVCVideoPacket(t,i+1,e-1,a,s,o);else{if(E!==12)return void this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+E);this._parseHEVCVideoPacket(t,i+1,e-1,a,s,o)}}}},n.prototype._parseAVCVideoPacket=function(t,i,e,a,s,r){if(e<4)m.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var o=this._littleEndian,p=new DataView(t,i,e),g=p.getUint8(0),E=(16777215&p.getUint32(0,!o))<<8>>8;if(g===0)this._parseAVCDecoderConfigurationRecord(t,i+4,e-4);else if(g===1)this._parseAVCVideoData(t,i+4,e-4,a,s,r,E);else if(g!==2)return void this._onError(J.a.FORMAT_ERROR,"Flv: Invalid video packet type "+g)}},n.prototype._parseHEVCVideoPacket=function(t,i,e,a,s,r){if(e<4)m.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var o=this._littleEndian,p=new DataView(t,i,e),g=p.getUint8(0),E=(16777215&p.getUint32(0,!o))<<8>>8;if(g===0)this._parseHEVCDecoderConfigurationRecord(t,i+4,e-4);else if(g===1)this._parseHEVCVideoData(t,i+4,e-4,a,s,r,E);else if(g!==2)return void this._onError(J.a.FORMAT_ERROR,"Flv: Invalid video packet type "+g)}},n.prototype._parseEnhancedHEVCVideoPacket=function(t,i,e,a,s,r,o){if(e<4)m.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var p=this._littleEndian,g=new DataView(t,i,e);if(o===0)this._parseHEVCDecoderConfigurationRecord(t,i,e);else if(o===1){var E=(4294967040&g.getUint32(0,!p))>>8;this._parseHEVCVideoData(t,i+3,e-3,a,s,r,E)}else if(o===3)this._parseHEVCVideoData(t,i,e,a,s,r,0);else if(o!==2)return void this._onError(J.a.FORMAT_ERROR,"Flv: Invalid video packet type "+o)}},n.prototype._parseAVCDecoderConfigurationRecord=function(t,i,e){if(e<7)m.a.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var a=this._videoMetadata,s=this._videoTrack,r=this._littleEndian,o=new DataView(t,i,e);if(a){if(a.avcc!==void 0){var p=new Uint8Array(t,i,e);if(h(p,a.avcc))return;m.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),(a=this._videoMetadata={}).type="video",a.id=s.id,a.timescale=this._timescale,a.duration=this._duration;var g=o.getUint8(0),E=o.getUint8(1);if(o.getUint8(2),o.getUint8(3),g===1&&E!==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&&m.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+A);for(var S=6,T=0;T<A;T++){var B=o.getUint16(S,!r);if(S+=2,B!==0){var z=new Uint8Array(t,i+S,B);S+=B;var U=de.parseSPS(z);if(T===0){a.codecWidth=U.codec_size.width,a.codecHeight=U.codec_size.height,a.presentWidth=U.present_size.width,a.presentHeight=U.present_size.height,a.profile=U.profile_string,a.level=U.level_string,a.bitDepth=U.bit_depth,a.chromaFormat=U.chroma_format,a.sarRatio=U.sar_ratio,a.frameRate=U.frame_rate,U.frame_rate.fixed!==!1&&U.frame_rate.fps_num!==0&&U.frame_rate.fps_den!==0||(a.frameRate=this._referenceFrameRate);var Y=a.frameRate.fps_den,W=a.frameRate.fps_num;a.refSampleDuration=a.timescale*(Y/W);for(var q=z.subarray(1,4),oe="avc1.",ue=0;ue<3;ue++){var K=q[ue].toString(16);K.length<2&&(K="0"+K),oe+=K}a.codec=oe;var Q=this._mediaInfo;Q.width=a.codecWidth,Q.height=a.codecHeight,Q.fps=a.frameRate.fps,Q.profile=a.profile,Q.level=a.level,Q.refFrames=U.ref_frames,Q.chromaFormat=U.chroma_format_string,Q.sarNum=a.sarRatio.width,Q.sarDen=a.sarRatio.height,Q.videoCodec=oe,Q.hasAudio?Q.audioCodec!=null&&(Q.mimeType='video/x-flv; codecs="'+Q.videoCodec+","+Q.audioCodec+'"'):Q.mimeType='video/x-flv; codecs="'+Q.videoCodec+'"',Q.isComplete()&&this._onMediaInfo(Q)}}}var ce=o.getUint8(S);if(ce!==0){for(ce>1&&m.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+ce),S++,T=0;T<ce;T++)B=o.getUint16(S,!r),S+=2,B!==0&&(S+=B);a.avcc=new Uint8Array(e),a.avcc.set(new Uint8Array(t,i,e),0),m.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",a)}else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(J.a.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},n.prototype._parseHEVCDecoderConfigurationRecord=function(t,i,e){if(e<22)m.a.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var a=this._videoMetadata,s=this._videoTrack,r=this._littleEndian,o=new DataView(t,i,e);if(a){if(a.hvcc!==void 0){var p=new Uint8Array(t,i,e);if(h(p,a.hvcc))return;m.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),(a=this._videoMetadata={}).type="video",a.id=s.id,a.timescale=this._timescale,a.duration=this._duration;var g=o.getUint8(0),E=31&o.getUint8(1);if(g===1&&E!==0)if(this._naluLengthSize=1+(3&o.getUint8(21)),this._naluLengthSize===3||this._naluLengthSize===4){for(var A=o.getUint8(22),S=0,T=23;S<A;S++){var B=63&o.getUint8(T+0),z=o.getUint16(T+1,!r);T+=3;for(var U=0;U<z;U++){var Y=o.getUint16(T+0,!r);if(U===0)if(B===33){T+=2;var W=new Uint8Array(t,i+T,Y),q=re.parseSPS(W);a.codecWidth=q.codec_size.width,a.codecHeight=q.codec_size.height,a.presentWidth=q.present_size.width,a.presentHeight=q.present_size.height,a.profile=q.profile_string,a.level=q.level_string,a.bitDepth=q.bit_depth,a.chromaFormat=q.chroma_format,a.sarRatio=q.sar_ratio,a.frameRate=q.frame_rate,q.frame_rate.fixed!==!1&&q.frame_rate.fps_num!==0&&q.frame_rate.fps_den!==0||(a.frameRate=this._referenceFrameRate);var oe=a.frameRate.fps_den,ue=a.frameRate.fps_num;a.refSampleDuration=a.timescale*(oe/ue),a.codec=q.codec_mimetype;var K=this._mediaInfo;K.width=a.codecWidth,K.height=a.codecHeight,K.fps=a.frameRate.fps,K.profile=a.profile,K.level=a.level,K.refFrames=q.ref_frames,K.chromaFormat=q.chroma_format_string,K.sarNum=a.sarRatio.width,K.sarDen=a.sarRatio.height,K.videoCodec=q.codec_mimetype,K.hasAudio?K.audioCodec!=null&&(K.mimeType='video/x-flv; codecs="'+K.videoCodec+","+K.audioCodec+'"'):K.mimeType='video/x-flv; codecs="'+K.videoCodec+'"',K.isComplete()&&this._onMediaInfo(K),T+=Y}else T+=2+Y;else T+=2+Y}}a.hvcc=new Uint8Array(e),a.hvcc.set(new Uint8Array(t,i,e),0),m.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",a)}else this._onError(J.a.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},n.prototype._parseAVCVideoData=function(t,i,e,a,s,r,o){for(var p=this._littleEndian,g=new DataView(t,i,e),E=[],A=0,S=0,T=this._naluLengthSize,B=this._timestampBase+a,z=r===1;S<e;){if(S+4>=e){m.a.w(this.TAG,"Malformed Nalu near timestamp "+B+", offset = "+S+", dataSize = "+e);break}var U=g.getUint32(S,!p);if(T===3&&(U>>>=8),U>e-T)return void m.a.w(this.TAG,"Malformed Nalus near timestamp "+B+", NaluSize > DataSize!");var Y=31&g.getUint8(S+T);Y===5&&(z=!0);var W=new Uint8Array(t,i+S,T+U),q={type:Y,data:W};E.push(q),A+=W.byteLength,S+=T+U}if(E.length){var oe=this._videoTrack,ue={units:E,length:A,isKeyframe:z,dts:B,cts:o,pts:B+o};z&&(ue.fileposition=s),oe.samples.push(ue),oe.length+=A}},n.prototype._parseHEVCVideoData=function(t,i,e,a,s,r,o){for(var p=this._littleEndian,g=new DataView(t,i,e),E=[],A=0,S=0,T=this._naluLengthSize,B=this._timestampBase+a,z=r===1;S<e;){if(S+4>=e){m.a.w(this.TAG,"Malformed Nalu near timestamp "+B+", offset = "+S+", dataSize = "+e);break}var U=g.getUint32(S,!p);if(T===3&&(U>>>=8),U>e-T)return void m.a.w(this.TAG,"Malformed Nalus near timestamp "+B+", NaluSize > DataSize!");var Y=31&g.getUint8(S+T);Y!==19&&Y!==20||(z=!0);var W=new Uint8Array(t,i+S,T+U),q={type:Y,data:W};E.push(q),A+=W.byteLength,S+=T+U}if(E.length){var oe=this._videoTrack,ue={units:E,length:A,isKeyframe:z,dts:B,cts:o,pts:B+o};z&&(ue.fileposition=s),oe.samples.push(ue),oe.length+=A}},n}(),l=function(){function n(){}return n.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},n}(),P=function(){this.program_pmt_pid={}};(function(n){n[n.kMPEG1Audio=3]="kMPEG1Audio",n[n.kMPEG2Audio=4]="kMPEG2Audio",n[n.kPESPrivateData=6]="kPESPrivateData",n[n.kADTSAAC=15]="kADTSAAC",n[n.kLOASAAC=17]="kLOASAAC",n[n.kAC3=129]="kAC3",n[n.kID3=21]="kID3",n[n.kSCTE35=134]="kSCTE35",n[n.kH264=27]="kH264",n[n.kH265=36]="kH265"})(_||(_={}));var D,F=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},ee=function(){},fe=function(){},ve=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};(function(n){n[n.kUnspecified=0]="kUnspecified",n[n.kSliceNonIDR=1]="kSliceNonIDR",n[n.kSliceDPA=2]="kSliceDPA",n[n.kSliceDPB=3]="kSliceDPB",n[n.kSliceDPC=4]="kSliceDPC",n[n.kSliceIDR=5]="kSliceIDR",n[n.kSliceSEI=6]="kSliceSEI",n[n.kSliceSPS=7]="kSliceSPS",n[n.kSlicePPS=8]="kSlicePPS",n[n.kSliceAUD=9]="kSliceAUD",n[n.kEndOfSequence=10]="kEndOfSequence",n[n.kEndOfStream=11]="kEndOfStream",n[n.kFiller=12]="kFiller",n[n.kSPSExt=13]="kSPSExt",n[n.kReserved0=14]="kReserved0"})(D||(D={}));var L,d,u=function(){},R=function(n){var t=n.data.byteLength;this.type=n.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(n.data,4)},X=function(){function n(t){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=t,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&m.a.e(this.TAG,"Could not find H264 startcode until payload end!")}return n.prototype.findNextStartCodeOffset=function(t){for(var i=t,e=this.data_;;){if(i+3>=e.byteLength)return this.eof_flag_=!0,e.byteLength;var a=e[i+0]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],s=e[i+0]<<16|e[i+1]<<8|e[i+2];if(a===1||s===1)return i;i++}},n.prototype.readNextNaluPayload=function(){for(var t=this.data_,i=null;i==null&&!this.eof_flag_;){var e=this.current_startcode_offset_,a=31&t[e+=(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])===1?4:3],s=(128&t[e])>>>7,r=this.findNextStartCodeOffset(e);if(this.current_startcode_offset_=r,!(a>=D.kReserved0)&&s===0){var o=t.subarray(e,r);(i=new u).type=a,i.data=o}}return i},n}(),se=function(){function n(t,i,e){var a=8+t.byteLength+1+2+i.byteLength,s=!1;t[3]!==66&&t[3]!==77&&t[3]!==88&&(s=!0,a+=4);var r=this.data=new Uint8Array(a);r[0]=1,r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=255,r[5]=225;var o=t.byteLength;r[6]=o>>>8,r[7]=255&o;var p=8;r.set(t,8),r[p+=o]=1;var g=i.byteLength;r[p+1]=g>>>8,r[p+2]=255&g,r.set(i,p+3),p+=3+g,s&&(r[p]=252|e.chroma_format_idc,r[p+1]=248|e.bit_depth_luma-8,r[p+2]=248|e.bit_depth_chroma-8,r[p+3]=0,p+=4)}return n.prototype.getData=function(){return this.data},n}();(function(n){n[n.kNull=0]="kNull",n[n.kAACMain=1]="kAACMain",n[n.kAAC_LC=2]="kAAC_LC",n[n.kAAC_SSR=3]="kAAC_SSR",n[n.kAAC_LTP=4]="kAAC_LTP",n[n.kAAC_SBR=5]="kAAC_SBR",n[n.kAAC_Scalable=6]="kAAC_Scalable",n[n.kLayer1=32]="kLayer1",n[n.kLayer2=33]="kLayer2",n[n.kLayer3=34]="kLayer3"})(L||(L={})),function(n){n[n.k96000Hz=0]="k96000Hz",n[n.k88200Hz=1]="k88200Hz",n[n.k64000Hz=2]="k64000Hz",n[n.k48000Hz=3]="k48000Hz",n[n.k44100Hz=4]="k44100Hz",n[n.k32000Hz=5]="k32000Hz",n[n.k24000Hz=6]="k24000Hz",n[n.k22050Hz=7]="k22050Hz",n[n.k16000Hz=8]="k16000Hz",n[n.k12000Hz=9]="k12000Hz",n[n.k11025Hz=10]="k11025Hz",n[n.k8000Hz=11]="k8000Hz",n[n.k7350Hz=12]="k7350Hz"}(d||(d={}));var me,Se,De=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Te=(me=function(n,t){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,e){i.__proto__=e}||function(i,e){for(var a in e)e.hasOwnProperty(a)&&(i[a]=e[a])})(n,t)},function(n,t){function i(){this.constructor=n}me(n,t),n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}),M=function(){},V=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return Te(t,n),t}(M),$=function(){function n(t){this.TAG="AACADTSParser",this.data_=t,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&m.a.e(this.TAG,"Could not found ADTS syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(t){for(var i=t,e=this.data_;;){if(i+7>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[i+0]<<8|e[i+1])>>>4===4095)return i;i++}},n.prototype.readNextAACFrame=function(){for(var t=this.data_,i=null;i==null&&!this.eof_flag_;){var e=this.current_syncword_offset_,a=(8&t[e+1])>>>3,s=(6&t[e+1])>>>1,r=1&t[e+1],o=(192&t[e+2])>>>6,p=(60&t[e+2])>>>2,g=(1&t[e+2])<<2|(192&t[e+3])>>>6,E=(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5;if(t[e+6],e+E>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var A=r===1?7:9,S=E-A;e+=A;var T=this.findNextSyncwordOffset(e+S);if(this.current_syncword_offset_=T,(a===0||a===1)&&s===0){var B=t.subarray(e,e+S);(i=new M).audio_object_type=o+1,i.sampling_freq_index=p,i.sampling_frequency=De[p],i.channel_config=g,i.data=B}}return i},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n}(),ie=function(){function n(t){this.TAG="AACLOASParser",this.data_=t,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&m.a.e(this.TAG,"Could not found LOAS syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(t){for(var i=t,e=this.data_;;){if(i+1>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[i+0]<<3|e[i+1]>>>5)===695)return i;i++}},n.prototype.getLATMValue=function(t){for(var i=t.readBits(2),e=0,a=0;a<=i;a++)e<<=8,e|=t.readByte();return e},n.prototype.readNextAACFrame=function(t){for(var i=this.data_,e=null;e==null&&!this.eof_flag_;){var a=this.current_syncword_offset_,s=(31&i[a+1])<<8|i[a+2];if(a+3+s>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=new he(i.subarray(a+3,a+3+s)),o=null;if(r.readBool()){if(t==null){m.a.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(a+3+s),r.destroy();continue}o=t}else{var p=r.readBool();if(p&&r.readBool()){m.a.e(this.TAG,"audioMuxVersionA is Not Supported"),r.destroy();break}if(p&&this.getLATMValue(r),!r.readBool()){m.a.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),r.destroy();break}if(r.readBits(6)!==0){m.a.e(this.TAG,"more than 2 numSubFrames Not Supported"),r.destroy();break}if(r.readBits(4)!==0){m.a.e(this.TAG,"more than 2 numProgram Not Supported"),r.destroy();break}if(r.readBits(3)!==0){m.a.e(this.TAG,"more than 2 numLayer Not Supported"),r.destroy();break}var g=p?this.getLATMValue(r):0,E=r.readBits(5);g-=5;var A=r.readBits(4);g-=4;var S=r.readBits(4);g-=4,r.readBits(3),(g-=3)>0&&r.readBits(g);var T=r.readBits(3);if(T!==0){m.a.e(this.TAG,"frameLengthType = "+T+". Only frameLengthType = 0 Supported"),r.destroy();break}r.readByte();var B=r.readBool();if(B)if(p)this.getLATMValue(r);else{for(var z=0;;){z<<=8;var U=r.readBool();if(z+=r.readByte(),!U)break}console.log(z)}r.readBool()&&r.readByte(),(o=new V).audio_object_type=E,o.sampling_freq_index=A,o.sampling_frequency=De[o.sampling_freq_index],o.channel_config=S,o.other_data_present=B}for(var Y=0;;){var W=r.readByte();if(Y+=W,W!==255)break}for(var q=new Uint8Array(Y),oe=0;oe<Y;oe++)q[oe]=r.readByte();(e=new V).audio_object_type=o.audio_object_type,e.sampling_freq_index=o.sampling_freq_index,e.sampling_frequency=De[o.sampling_freq_index],e.channel_config=o.channel_config,e.other_data_present=o.other_data_present,e.data=q,this.current_syncword_offset_=this.findNextSyncwordOffset(a+3+s)}return e},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n}(),ne=function(n){var t=null,i=n.audio_object_type,e=n.audio_object_type,a=n.sampling_freq_index,s=n.channel_config,r=0,o=navigator.userAgent.toLowerCase();o.indexOf("firefox")!==-1?a>=6?(e=5,t=new Array(4),r=a-3):(e=2,t=new Array(2),r=a):o.indexOf("android")!==-1?(e=2,t=new Array(2),r=a):(e=5,r=a,t=new Array(4),a>=6?r=a-3:s===1&&(e=2,t=new Array(2),r=a)),t[0]=e<<3,t[0]|=(15&a)>>>1,t[1]=(15&a)<<7,t[1]|=(15&s)<<3,e===5&&(t[1]|=(15&r)>>>1,t[2]=(1&r)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=De[a],this.channel_count=s,this.codec_mimetype="mp4a.40."+e,this.original_codec_mimetype="mp4a.40."+i},le=function(){},we=function(){};(function(n){n[n.kSpliceNull=0]="kSpliceNull",n[n.kSpliceSchedule=4]="kSpliceSchedule",n[n.kSpliceInsert=5]="kSpliceInsert",n[n.kTimeSignal=6]="kTimeSignal",n[n.kBandwidthReservation=7]="kBandwidthReservation",n[n.kPrivateCommand=255]="kPrivateCommand"})(Se||(Se={}));var Ee,Ie=function(n){var t=n.readBool();return t?(n.readBits(6),{time_specified_flag:t,pts_time:4*n.readBits(31)+n.readBits(2)}):(n.readBits(7),{time_specified_flag:t})},Be=function(n){var t=n.readBool();return n.readBits(6),{auto_return:t,duration:4*n.readBits(31)+n.readBits(2)}},Je=function(n,t){var i=t.readBits(8);return n?{component_tag:i}:{component_tag:i,splice_time:Ie(t)}},Ze=function(n){return{component_tag:n.readBits(8),utc_splice_time:n.readBits(32)}},$e=function(n){var t=n.readBits(32),i=n.readBool();n.readBits(7);var e={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return e;if(e.out_of_network_indicator=n.readBool(),e.program_splice_flag=n.readBool(),e.duration_flag=n.readBool(),n.readBits(5),e.program_splice_flag)e.utc_splice_time=n.readBits(32);else{e.component_count=n.readBits(8),e.components=[];for(var a=0;a<e.component_count;a++)e.components.push(Ze(n))}return e.duration_flag&&(e.break_duration=Be(n)),e.unique_program_id=n.readBits(16),e.avail_num=n.readBits(8),e.avails_expected=n.readBits(8),e},Qe=function(n,t,i,e){return{descriptor_tag:n,descriptor_length:t,identifier:i,provider_avail_id:e.readBits(32)}},bt=function(n,t,i,e){var a=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:n,descriptor_length:t,identifier:i,preroll:a,dtmf_count:s,DTMF_char:r}},St=function(n){var t=n.readBits(8);return n.readBits(7),{component_tag:t,pts_offset:4*n.readBits(31)+n.readBits(2)}},Et=function(n,t,i,e){var a=e.readBits(32),s=e.readBool();e.readBits(7);var r={descriptor_tag:n,descriptor_length:t,identifier:i,segmentation_event_id:a,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(St(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 p=new Uint8Array(r.segmentation_upid_length);for(o=0;o<r.segmentation_upid_length;o++)p[o]=e.readBits(8);return r.segmentation_upid=p.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},At=function(n,t,i,e){return{descriptor_tag:n,descriptor_length:t,identifier:i,TAI_seconds:e.readBits(48),TAI_ns:e.readBits(32),UTC_offset:e.readBits(16)}},Rt=function(n){return{component_tag:n.readBits(8),ISO_code:String.fromCharCode(n.readBits(8),n.readBits(8),n.readBits(8)),Bit_Stream_Mode:n.readBits(3),Num_Channels:n.readBits(4),Full_Srvc_Audio:n.readBool()}},Tt=function(n,t,i,e){for(var a=e.readBits(4),s=[],r=0;r<a;r++)s.push(Rt(e));return{descriptor_tag:n,descriptor_length:t,identifier:i,audio_count:a,components:s}},wt=function(n){var t=new he(n),i=t.readBits(8),e=t.readBool(),a=t.readBool();t.readBits(2);var s=t.readBits(12),r=t.readBits(8),o=t.readBool(),p=t.readBits(6),g=4*t.readBits(31)+t.readBits(2),E=t.readBits(8),A=t.readBits(12),S=t.readBits(12),T=t.readBits(8),B=null;T===Se.kSpliceNull?B={}:T===Se.kSpliceSchedule?B=function(ae){for(var be=ae.readBits(8),Ae=[],_e=0;_e<be;_e++)Ae.push($e(ae));return{splice_count:be,events:Ae}}(t):T===Se.kSpliceInsert?B=function(ae){var be=ae.readBits(32),Ae=ae.readBool();ae.readBits(7);var _e={splice_event_id:be,splice_event_cancel_indicator:Ae};if(Ae)return _e;if(_e.out_of_network_indicator=ae.readBool(),_e.program_splice_flag=ae.readBool(),_e.duration_flag=ae.readBool(),_e.splice_immediate_flag=ae.readBool(),ae.readBits(4),_e.program_splice_flag&&!_e.splice_immediate_flag&&(_e.splice_time=Ie(ae)),!_e.program_splice_flag){_e.component_count=ae.readBits(8),_e.components=[];for(var ye=0;ye<_e.component_count;ye++)_e.components.push(Je(_e.splice_immediate_flag,ae))}return _e.duration_flag&&(_e.break_duration=Be(ae)),_e.unique_program_id=ae.readBits(16),_e.avail_num=ae.readBits(8),_e.avails_expected=ae.readBits(8),_e}(t):T===Se.kTimeSignal?B=function(ae){return{splice_time:Ie(ae)}}(t):T===Se.kBandwidthReservation?B={}:T===Se.kPrivateCommand?B=function(ae,be){for(var Ae=String.fromCharCode(be.readBits(8),be.readBits(8),be.readBits(8),be.readBits(8)),_e=new Uint8Array(ae-4),ye=0;ye<ae-4;ye++)_e[ye]=be.readBits(8);return{identifier:Ae,private_data:_e.buffer}}(S,t):t.readBits(8*S);for(var z=[],U=t.readBits(16),Y=0;Y<U;){var W=t.readBits(8),q=t.readBits(8),oe=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8));W===0?z.push(Qe(W,q,oe,t)):W===1?z.push(bt(W,q,oe,t)):W===2?z.push(Et(W,q,oe,t)):W===3?z.push(At(W,q,oe,t)):W===4?z.push(Tt(W,q,oe,t)):t.readBits(8*(q-4)),Y+=2+q}var ue={table_id:i,section_syntax_indicator:e,private_indicator:a,section_length:s,protocol_version:r,encrypted_packet:o,encryption_algorithm:p,pts_adjustment:g,cw_index:E,tier:A,splice_command_length:S,splice_command_type:T,splice_command:B,descriptor_loop_length:U,splice_descriptors:z,E_CRC32:o?t.readBits(32):void 0,CRC32:t.readBits(32)};if(T===Se.kSpliceInsert){var K=B;if(K.splice_event_cancel_indicator)return{splice_command_type:T,detail:ue,data:n};if(K.program_splice_flag&&!K.splice_immediate_flag){var Q=K.duration_flag?K.break_duration.auto_return:void 0,ce=K.duration_flag?K.break_duration.duration/90:void 0;return K.splice_time.time_specified_flag?{splice_command_type:T,pts:(g+K.splice_time.pts_time)%Math.pow(2,33),auto_return:Q,duraiton:ce,detail:ue,data:n}:{splice_command_type:T,auto_return:Q,duraiton:ce,detail:ue,data:n}}return{splice_command_type:T,auto_return:Q=K.duration_flag?K.break_duration.auto_return:void 0,duraiton:ce=K.duration_flag?K.break_duration.duration/90:void 0,detail:ue,data:n}}if(T===Se.kTimeSignal){var te=B;return te.splice_time.time_specified_flag?{splice_command_type:T,pts:(g+te.splice_time.pts_time)%Math.pow(2,33),detail:ue,data:n}:{splice_command_type:T,detail:ue,data:n}}return{splice_command_type:T,detail:ue,data:n}};(function(n){n[n.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",n[n.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",n[n.kSliceCRA_NUT=21]="kSliceCRA_NUT",n[n.kSliceVPS=32]="kSliceVPS",n[n.kSliceSPS=33]="kSliceSPS",n[n.kSlicePPS=34]="kSlicePPS",n[n.kSliceAUD=35]="kSliceAUD"})(Ee||(Ee={}));var kt=function(){},Lt=function(n){var t=n.data.byteLength;this.type=n.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(n.data,4)},Dt=function(){function n(t){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=t,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&m.a.e(this.TAG,"Could not find H265 startcode until payload end!")}return n.prototype.findNextStartCodeOffset=function(t){for(var i=t,e=this.data_;;){if(i+3>=e.byteLength)return this.eof_flag_=!0,e.byteLength;var a=e[i+0]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],s=e[i+0]<<16|e[i+1]<<8|e[i+2];if(a===1||s===1)return i;i++}},n.prototype.readNextNaluPayload=function(){for(var t=this.data_,i=null;i==null&&!this.eof_flag_;){var e=this.current_startcode_offset_,a=t[e+=(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])===1?4:3]>>1&63,s=(128&t[e])>>>7,r=this.findNextStartCodeOffset(e);if(this.current_startcode_offset_=r,s===0){var o=t.subarray(e,r);(i=new kt).type=a,i.data=o}}return i},n}(),Ct=function(){function n(t,i,e,a){var s=23+(5+t.byteLength)+(5+i.byteLength)+(5+e.byteLength),r=this.data=new Uint8Array(s);r[0]=1,r[1]=(3&a.general_profile_space)<<6|(a.general_tier_flag?1:0)<<5|31&a.general_profile_idc,r[2]=a.general_profile_compatibility_flags_1,r[3]=a.general_profile_compatibility_flags_2,r[4]=a.general_profile_compatibility_flags_3,r[5]=a.general_profile_compatibility_flags_4,r[6]=a.general_constraint_indicator_flags_1,r[7]=a.general_constraint_indicator_flags_2,r[8]=a.general_constraint_indicator_flags_3,r[9]=a.general_constraint_indicator_flags_4,r[10]=a.general_constraint_indicator_flags_5,r[11]=a.general_constraint_indicator_flags_6,r[12]=a.general_level_idc,r[13]=240|(3840&a.min_spatial_segmentation_idc)>>8,r[14]=255&a.min_spatial_segmentation_idc,r[15]=252|3&a.parallelismType,r[16]=252|3&a.chroma_format_idc,r[17]=248|7&a.bit_depth_luma_minus8,r[18]=248|7&a.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&a.constant_frame_rate)<<6|(7&a.num_temporal_layers)<<3|(a.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|Ee.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&t.byteLength)>>8,r[27]=(255&t.byteLength)>>0,r.set(t,28),r[23+(5+t.byteLength)+0]=128|Ee.kSliceSPS,r[23+(5+t.byteLength)+1]=0,r[23+(5+t.byteLength)+2]=1,r[23+(5+t.byteLength)+3]=(65280&i.byteLength)>>8,r[23+(5+t.byteLength)+4]=(255&i.byteLength)>>0,r.set(i,23+(5+t.byteLength)+5),r[23+(5+t.byteLength+5+i.byteLength)+0]=128|Ee.kSlicePPS,r[23+(5+t.byteLength+5+i.byteLength)+1]=0,r[23+(5+t.byteLength+5+i.byteLength)+2]=1,r[23+(5+t.byteLength+5+i.byteLength)+3]=(65280&e.byteLength)>>8,r[23+(5+t.byteLength+5+i.byteLength)+4]=(255&e.byteLength)>>0,r.set(e,23+(5+t.byteLength+5+i.byteLength)+5)}return n.prototype.getData=function(){return this.data},n}(),Bt=function(){},It=function(){},Ot=function(){},Pt=[[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]],Mt=function(){function n(t){this.TAG="AC3Parser",this.data_=t,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&m.a.e(this.TAG,"Could not found AC3 syncword until payload end")}return n.prototype.findNextSyncwordOffset=function(t){for(var i=t,e=this.data_;;){if(i+7>=e.byteLength)return this.eof_flag_=!0,e.byteLength;if((e[i+0]<<8|e[i+1]<<0)===2935)return i;i++}},n.prototype.readNextAC3Frame=function(){for(var t=this.data_,i=null;i==null&&!this.eof_flag_;){var e=this.current_syncword_offset_,a=t[e+4]>>6,s=[48e3,44200,33e3][a],r=63&t[e+4],o=2*Pt[a][r];if(e+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var p=this.findNextSyncwordOffset(e+o);this.current_syncword_offset_=p;var g=t[e+5]>>3,E=7&t[e+5],A=t[e+6]>>5,S=0;1&A&&A!==1&&(S+=2),4&A&&(S+=2),A===2&&(S+=2);var T=(t[e+6]<<8|t[e+7]<<0)>>12-S&1,B=[2,1,2,3,3,4,4,5][A]+T;(i=new Ot).sampling_frequency=s,i.channel_count=B,i.channel_mode=A,i.bit_stream_identification=g,i.low_frequency_effects_channel_on=T,i.bit_stream_mode=E,i.frame_size_code=r,i.data=t.subarray(e,e+o)}return i},n.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},n.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},n}(),xt=function(n){var t;t=[n.sampling_rate_code<<6|n.bit_stream_identification<<1|n.bit_stream_mode>>2,(3&n.bit_stream_mode)<<6|n.channel_mode<<3|n.low_frequency_effects_channel_on<<2|n.frame_size_code>>4,n.frame_size_code<<4&224],this.config=t,this.sampling_rate=n.sampling_frequency,this.bit_stream_identification=n.bit_stream_identification,this.bit_stream_mode=n.bit_stream_mode,this.low_frequency_effects_channel_on=n.low_frequency_effects_channel_on,this.channel_count=n.channel_count,this.channel_mode=n.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},Ut=function(){var n=function(t,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var s in a)a.hasOwnProperty(s)&&(e[s]=a[s])})(t,i)};return function(t,i){function e(){this.constructor=t}n(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}}(),Fe=function(){return(Fe=Object.assign||function(n){for(var t,i=1,e=arguments.length;i<e;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a]);return n}).apply(this,arguments)},rt=function(n){function t(i,e){var a=n.call(this)||this;return a.TAG="TSDemuxer",a.first_parse_=!0,a.media_info_=new v.a,a.timescale_=90,a.duration_=0,a.current_pmt_pid_=-1,a.program_pmt_map_={},a.pes_slice_queues_={},a.section_slice_queues_={},a.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},a.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},a.aac_last_sample_pts_=void 0,a.aac_last_incomplete_data_=null,a.has_video_=!1,a.has_audio_=!1,a.video_init_segment_dispatched_=!1,a.audio_init_segment_dispatched_=!1,a.video_metadata_changed_=!1,a.audio_metadata_changed_=!1,a.loas_previous_frame=null,a.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},a.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},a.ts_packet_size_=i.ts_packet_size,a.sync_offset_=i.sync_offset,a.config_=e,a}return Ut(t,n),t.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,n.prototype.destroy.call(this)},t.probe=function(i){var e=new Uint8Array(i),a=-1,s=188;if(e.byteLength<=3*s)return{needMoreData:!0};for(;a===-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){a=o;break}o++}if(a===-1)if(s===188)s=192;else{if(s!==192)break;s=204}}return a===-1?{match:!1}:(s===192&&a>=4?(m.a.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),a-=4):s===204&&m.a.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:s,sync_offset:a})},t.prototype.bindDataSource=function(i){return i.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new v.a},t.prototype.parseChunks=function(i,e){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new C.a("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0;for(this.first_parse_&&(this.first_parse_=!1,a=this.sync_offset_);a+this.ts_packet_size_<=i.byteLength;){var s=e+a;this.ts_packet_size_===192&&(a+=4);var r=new Uint8Array(i,a,188),o=r[0];if(o!==71){m.a.e(this.TAG,"sync_byte = "+o+", not 0x47");break}var p=(64&r[1])>>>6,g=(r[1],(31&r[1])<<8|r[2]),E=(48&r[3])>>>4,A=15&r[3],S={},T=4;if(E==2||E==3){var B=r[4];if(5+B===188){a+=188,this.ts_packet_size_===204&&(a+=16);continue}B>0&&(S=this.parseAdaptationField(i,a+4,1+B)),T=5+B}if(E==1||E==3){if(g===0||g===this.current_pmt_pid_||this.pmt_!=null&&this.pmt_.pid_stream_type[g]===_.kSCTE35){var z=188-T;this.handleSectionSlice(i,a+T,z,{pid:g,file_position:s,payload_unit_start_indicator:p,continuity_conunter:A,random_access_indicator:S.random_access_indicator})}else if(this.pmt_!=null&&this.pmt_.pid_stream_type[g]!=null){z=188-T;var U=this.pmt_.pid_stream_type[g];g!==this.pmt_.common_pids.h264&&g!==this.pmt_.common_pids.h265&&g!==this.pmt_.common_pids.adts_aac&&g!==this.pmt_.common_pids.loas_aac&&g!==this.pmt_.common_pids.ac3&&g!==this.pmt_.common_pids.opus&&g!==this.pmt_.common_pids.mp3&&this.pmt_.pes_private_data_pids[g]!==!0&&this.pmt_.timed_id3_pids[g]!==!0||this.handlePESSlice(i,a+T,z,{pid:g,stream_type:U,file_position:s,payload_unit_start_indicator:p,continuity_conunter:A,random_access_indicator:S.random_access_indicator})}}a+=188,this.ts_packet_size_===204&&(a+=16)}return this.dispatchAudioVideoMediaSegment(),a},t.prototype.parseAdaptationField=function(i,e,a){var s=new Uint8Array(i,e,a),r=s[0];return r>0?r>183?(m.a.w(this.TAG,"Illegal adaptation_field_length: "+r),{}):{discontinuity_indicator:(128&s[1])>>>7,random_access_indicator:(64&s[1])>>>6,elementary_stream_priority_indicator:(32&s[1])>>>5}:{}},t.prototype.handleSectionSlice=function(i,e,a,s){var r=new Uint8Array(i,e,a),o=this.section_slice_queues_[s.pid];if(s.payload_unit_start_indicator){var p=r[0];if(o!=null&&o.total_length!==0){var g=new Uint8Array(i,e+1,Math.min(a,p));o.slices.push(g),o.total_length+=g.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):this.clearSlices(o,s)}for(var E=1+p;E<r.byteLength&&r[E+0]!==255;){var A=(15&r[E+1])<<8|r[E+2];this.section_slice_queues_[s.pid]=new ve,(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,g=new Uint8Array(i,e+E,Math.min(a-E,o.expected_length-o.total_length)),o.slices.push(g),o.total_length+=g.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):o.total_length>=o.expected_length&&this.clearSlices(o,s),E+=g.byteLength}}else o!=null&&o.total_length!==0&&(g=new Uint8Array(i,e,Math.min(a,o.expected_length-o.total_length)),o.slices.push(g),o.total_length+=g.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,s):o.total_length>=o.expected_length&&this.clearSlices(o,s))},t.prototype.handlePESSlice=function(i,e,a,s){var r=new Uint8Array(i,e,a),o=r[0]<<16|r[1]<<8|r[2],p=(r[3],r[4]<<8|r[5]);if(s.payload_unit_start_indicator){if(o!==1)return void m.a.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value "+o);var g=this.pes_slice_queues_[s.pid];g&&(g.expected_length===0||g.expected_length===g.total_length?this.emitPESSlices(g,s):this.clearSlices(g,s)),this.pes_slice_queues_[s.pid]=new ve,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 E=this.pes_slice_queues_[s.pid];E.slices.push(r),s.payload_unit_start_indicator&&(E.expected_length=p===0?0:p+6),E.total_length+=r.byteLength,E.expected_length>0&&E.expected_length===E.total_length?this.emitPESSlices(E,s):E.expected_length>0&&E.expected_length<E.total_length&&this.clearSlices(E,s)}},t.prototype.emitSectionSlices=function(i,e){for(var a=new Uint8Array(i.total_length),s=0,r=0;s<i.slices.length;s++){var o=i.slices[s];a.set(o,r),r+=o.byteLength}i.slices=[],i.expected_length=-1,i.total_length=0;var p=new fe;p.pid=e.pid,p.data=a,p.file_position=i.file_position,p.random_access_indicator=i.random_access_indicator,this.parseSection(p)},t.prototype.emitPESSlices=function(i,e){for(var a=new Uint8Array(i.total_length),s=0,r=0;s<i.slices.length;s++){var o=i.slices[s];a.set(o,r),r+=o.byteLength}i.slices=[],i.expected_length=-1,i.total_length=0;var p=new ee;p.pid=e.pid,p.data=a,p.stream_type=e.stream_type,p.file_position=i.file_position,p.random_access_indicator=i.random_access_indicator,this.parsePES(p)},t.prototype.clearSlices=function(i,e){i.slices=[],i.expected_length=-1,i.total_length=0},t.prototype.parseSection=function(i){var e=i.data,a=i.pid;a===0?this.parsePAT(e):a===this.current_pmt_pid_?this.parsePMT(e):this.pmt_!=null&&this.pmt_.scte_35_pids[a]&&this.parseSCTE35(e)},t.prototype.parsePES=function(i){var e=i.data,a=e[0]<<16|e[1]<<8|e[2],s=e[3],r=e[4]<<8|e[5];if(a===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,p=e[8],g=void 0,E=void 0;o!==2&&o!==3||(g=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,E=o===3?536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2:g);var A=9+p,S=void 0;if(r!==0){if(r<3+p)return void m.a.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");S=r-3-p}else S=e.byteLength-A;var T=e.subarray(A,A+S);switch(i.stream_type){case _.kMPEG1Audio:case _.kMPEG2Audio:this.parseMP3Payload(T,g);break;case _.kPESPrivateData:this.pmt_.common_pids.opus===i.pid?this.parseOpusPayload(T,g):this.pmt_.common_pids.ac3===i.pid?this.parseAC3Payload(T,g):this.pmt_.smpte2038_pids[i.pid]?this.parseSMPTE2038MetadataPayload(T,g,E,i.pid,s):this.parsePESPrivateDataPayload(T,g,E,i.pid,s);break;case _.kADTSAAC:this.parseADTSAACPayload(T,g);break;case _.kLOASAAC:this.parseLOASAACPayload(T,g);break;case _.kAC3:this.parseAC3Payload(T,g);break;case _.kID3:this.parseTimedID3MetadataPayload(T,g,E,i.pid,s);break;case _.kH264:this.parseH264Payload(T,g,E,i.file_position,i.random_access_indicator);break;case _.kH265:this.parseH265Payload(T,g,E,i.file_position,i.random_access_indicator)}}else(s===188||s===191||s===240||s===241||s===255||s===242||s===248)&&i.stream_type===_.kPESPrivateData&&(A=6,S=void 0,S=r!==0?r:e.byteLength-A,T=e.subarray(A,A+S),this.parsePESPrivateDataPayload(T,void 0,void 0,i.pid,s));else m.a.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value "+a)},t.prototype.parsePAT=function(i){var e=i[0];if(e===0){var a=(15&i[1])<<8|i[2],s=(i[3],i[4],(62&i[5])>>>1),r=1&i[5],o=i[6],p=(i[7],null);if(r===1&&o===0)(p=new P).version_number=s;else if((p=this.pat_)==null)return;for(var g=a-5-4,E=-1,A=-1,S=8;S<8+g;S+=4){var T=i[S]<<8|i[S+1],B=(31&i[S+2])<<8|i[S+3];T===0?p.network_pid=B:(p.program_pmt_pid[T]=B,E===-1&&(E=T),A===-1&&(A=B))}r===1&&o===0&&(this.pat_==null&&m.a.v(this.TAG,"Parsed first PAT: "+JSON.stringify(p)),this.pat_=p,this.current_program_=E,this.current_pmt_pid_=A)}else m.a.e(this.TAG,"parsePAT: table_id "+e+" is not corresponded to PAT!")},t.prototype.parsePMT=function(i){var e=i[0];if(e===2){var a=(15&i[1])<<8|i[2],s=i[3]<<8|i[4],r=(62&i[5])>>>1,o=1&i[5],p=i[6],g=(i[7],null);if(o===1&&p===0)(g=new F).program_number=s,g.version_number=r,this.program_pmt_map_[s]=g;else if((g=this.program_pmt_map_[s])==null)return;i[8],i[9];for(var E=(15&i[10])<<8|i[11],A=12+E,S=a-9-E-4,T=A;T<A+S;){var B=i[T],z=(31&i[T+1])<<8|i[T+2],U=(15&i[T+3])<<8|i[T+4];g.pid_stream_type[z]=B;var Y=g.common_pids.h264||g.common_pids.h265,W=g.common_pids.adts_aac||g.common_pids.loas_aac||g.common_pids.ac3||g.common_pids.opus||g.common_pids.mp3;if(B!==_.kH264||Y)if(B!==_.kH265||Y)if(B!==_.kADTSAAC||W)if(B!==_.kLOASAAC||W)if(B!==_.kAC3||W)if(B!==_.kMPEG1Audio&&B!==_.kMPEG2Audio||W)if(B===_.kPESPrivateData){if(g.pes_private_data_pids[z]=!0,U>0){for(var q=T+5;q<T+5+U;){var oe=i[q+0],ue=i[q+1];if(oe===5){var K=String.fromCharCode.apply(String,Array.from(i.subarray(q+2,q+2+ue)));K==="VANC"?g.smpte2038_pids[z]=!0:K==="Opus"&&(g.common_pids.opus=z)}else if(oe===127&&z===g.common_pids.opus){var Q=null;if(i[q+2]===128&&(Q=i[q+3]),Q==null){m.a.e(this.TAG,"Not Supported Opus channel count.");continue}var ce={codec:"opus",channel_count:15&Q?15&Q:2,channel_config_code:Q,sample_rate:48e3},te={codec:"opus",meta:ce};this.audio_init_segment_dispatched_==0?(this.audio_metadata_=ce,this.dispatchAudioInitSegment(te)):this.detectAudioMetadataChange(te)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(te))}q+=2+ue}var ae=i.subarray(T+5,T+5+U);this.dispatchPESPrivateDataDescriptor(z,B,ae)}}else B===_.kID3?g.timed_id3_pids[z]=!0:B===_.kSCTE35&&(g.scte_35_pids[z]=!0);else g.common_pids.mp3=z;else g.common_pids.ac3=z;else g.common_pids.loas_aac=z;else g.common_pids.adts_aac=z;else g.common_pids.h265=z;else g.common_pids.h264=z;T+=5+U}s===this.current_program_&&(this.pmt_==null&&m.a.v(this.TAG,"Parsed first PMT: "+JSON.stringify(g)),this.pmt_=g,(g.common_pids.h264||g.common_pids.h265)&&(this.has_video_=!0),(g.common_pids.adts_aac||g.common_pids.loas_aac||g.common_pids.ac3||g.common_pids.opus||g.common_pids.mp3)&&(this.has_audio_=!0))}else m.a.e(this.TAG,"parsePMT: table_id "+e+" is not corresponded to PMT!")},t.prototype.parseSCTE35=function(i){var e=wt(i);if(e.pts!=null){var a=Math.floor(e.pts/this.timescale_);e.pts=a}else e.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(e)},t.prototype.parseH264Payload=function(i,e,a,s,r){for(var o=new X(i),p=null,g=[],E=0,A=!1;(p=o.readNextNaluPayload())!=null;){var S=new R(p);if(S.type===D.kSliceSPS){var T=de.parseSPS(p.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(S,T)===!0&&(m.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:S,pps:void 0,details:T}):(this.video_metadata_.sps=S,this.video_metadata_.details=T)}else S.type===D.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_.pps=S,this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(S.type===D.kSliceIDR||S.type===D.kSliceNonIDR&&r===1)&&(A=!0);this.video_init_segment_dispatched_&&(g.push(S),E+=S.data.byteLength)}var B=Math.floor(e/this.timescale_),z=Math.floor(a/this.timescale_);if(g.length){var U=this.video_track_,Y={units:g,length:E,isKeyframe:A,dts:z,pts:B,cts:B-z,file_position:s};U.samples.push(Y),U.length+=E}},t.prototype.parseH265Payload=function(i,e,a,s,r){for(var o=new Dt(i),p=null,g=[],E=0,A=!1;(p=o.readNextNaluPayload())!=null;){var S=new Lt(p);if(S.type===Ee.kSliceVPS){if(!this.video_init_segment_dispatched_){var T=re.parseVPS(p.data);this.video_metadata_.vps=S,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),T)}}else S.type===Ee.kSliceSPS?(T=re.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(S,T)===!0&&(m.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:S,pps:void 0,details:T}):(this.video_metadata_.sps=S,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),T))):S.type===Ee.kSlicePPS?(!this.video_init_segment_dispatched_||this.video_metadata_changed_)&&(T=re.parsePPS(p.data),this.video_metadata_.pps=S,this.video_metadata_.details=Fe(Fe({},this.video_metadata_.details),T),this.video_metadata_.vps&&this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):S.type!==Ee.kSliceIDR_W_RADL&&S.type!==Ee.kSliceIDR_N_LP&&S.type!==Ee.kSliceCRA_NUT||(A=!0);this.video_init_segment_dispatched_&&(g.push(S),E+=S.data.byteLength)}var B=Math.floor(e/this.timescale_),z=Math.floor(a/this.timescale_);if(g.length){var U=this.video_track_,Y={units:g,length:E,isKeyframe:A,dts:z,pts:B,cts:B-z,file_position:s};U.samples.push(Y),U.length+=E}},t.prototype.detectVideoMetadataChange=function(i,e){if(e.codec_mimetype!==this.video_metadata_.details.codec_mimetype)return m.a.v(this.TAG,"Video: Codec mimeType changed from "+this.video_metadata_.details.codec_mimetype+" to "+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 a=this.video_metadata_.details.codec_size,s=e.codec_size;return m.a.v(this.TAG,"Video: Coded Resolution changed from "+a.width+"x"+a.height+" to "+s.width+"x"+s.height),!0}return e.present_size.width!==this.video_metadata_.details.present_size.width&&(m.a.v(this.TAG,"Video: Present resolution width changed from "+this.video_metadata_.details.present_size.width+" to "+e.present_size.width),!0)},t.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_},t.prototype.dispatchVideoInitSegment=function(){var i=this.video_metadata_.details,e={type:"video"};e.id=this.video_track_.id,e.timescale=1e3,e.duration=this.duration_,e.codecWidth=i.codec_size.width,e.codecHeight=i.codec_size.height,e.presentWidth=i.present_size.width,e.presentHeight=i.present_size.height,e.profile=i.profile_string,e.level=i.level_string,e.bitDepth=i.bit_depth,e.chromaFormat=i.chroma_format,e.sarRatio=i.sar_ratio,e.frameRate=i.frame_rate;var a=e.frameRate.fps_den,s=e.frameRate.fps_num;if(e.refSampleDuration=a/s*1e3,e.codec=i.codec_mimetype,this.video_metadata_.vps){var r=this.video_metadata_.vps.data.subarray(4),o=this.video_metadata_.sps.data.subarray(4),p=this.video_metadata_.pps.data.subarray(4),g=new Ct(r,o,p,i);e.hvcc=g.getData(),this.video_init_segment_dispatched_==0&&m.a.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: "+e.codec)}else{o=this.video_metadata_.sps.data.subarray(4),p=this.video_metadata_.pps.data.subarray(4);var E=new se(o,p,i);e.avcc=E.getData(),this.video_init_segment_dispatched_==0&&m.a.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: "+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=i.ref_frames,A.chromaFormat=i.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="'+A.videoCodec+","+A.audioCodec+'"':A.mimeType='video/mp2t; codecs="'+A.videoCodec+'"',A.isComplete()&&this.onMediaInfo(A)},t.prototype.dispatchVideoMediaSegment=function(){this.isInitSegmentDispatched()&&this.video_track_.length&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){this.isInitSegmentDispatched()&&this.audio_track_.length&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){this.isInitSegmentDispatched()&&(this.audio_track_.length||this.video_track_.length)&&this.onDataAvailable(this.audio_track_,this.video_track_)},t.prototype.parseADTSAACPayload=function(i,e){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(i.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(i,this.aac_last_incomplete_data_.byteLength),i=a}var s,r;if(e!=null&&(r=e/this.timescale_),this.audio_metadata_.codec==="aac"){if(e==null&&this.aac_last_sample_pts_!=null)s=1024/this.audio_metadata_.sampling_frequency*1e3,r=this.aac_last_sample_pts_+s;else if(e==null)return void m.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var o=this.aac_last_sample_pts_+s;Math.abs(o-r)>1&&(m.a.w(this.TAG,"AAC: Detected pts overlapped, expected: "+o+"ms, PES pts: "+r+"ms"),r=o)}}for(var p,g=new $(i),E=null,A=r;(E=g.readNextAACFrame())!=null;){s=1024/E.sampling_frequency*1e3;var S={codec:"aac",data:E};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"aac",audio_object_type:E.audio_object_type,sampling_freq_index:E.sampling_freq_index,sampling_frequency:E.sampling_frequency,channel_config:E.channel_config},this.dispatchAudioInitSegment(S)):this.detectAudioMetadataChange(S)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(S)),p=A;var T=Math.floor(A),B={unit:E.data,length:E.data.byteLength,pts:T,dts:T};this.audio_track_.samples.push(B),this.audio_track_.length+=E.data.byteLength,A+=s}g.hasIncompleteData()&&(this.aac_last_incomplete_data_=g.getIncompleteData()),p&&(this.aac_last_sample_pts_=p)}},t.prototype.parseLOASAACPayload=function(i,e){var a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var s=new Uint8Array(i.byteLength+this.aac_last_incomplete_data_.byteLength);s.set(this.aac_last_incomplete_data_,0),s.set(i,this.aac_last_incomplete_data_.byteLength),i=s}var r,o;if(e!=null&&(o=e/this.timescale_),this.audio_metadata_.codec==="aac"){if(e==null&&this.aac_last_sample_pts_!=null)r=1024/this.audio_metadata_.sampling_frequency*1e3,o=this.aac_last_sample_pts_+r;else if(e==null)return void m.a.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var p=this.aac_last_sample_pts_+r;Math.abs(p-o)>1&&(m.a.w(this.TAG,"AAC: Detected pts overlapped, expected: "+p+"ms, PES pts: "+o+"ms"),o=p)}}for(var g,E=new ie(i),A=null,S=o;(A=E.readNextAACFrame((a=this.loas_previous_frame)!==null&&a!==void 0?a:void 0))!=null;){this.loas_previous_frame=A,r=1024/A.sampling_frequency*1e3;var T={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(T)):this.detectAudioMetadataChange(T)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(T)),g=S;var B=Math.floor(S),z={unit:A.data,length:A.data.byteLength,pts:B,dts:B};this.audio_track_.samples.push(z),this.audio_track_.length+=A.data.byteLength,S+=r}E.hasIncompleteData()&&(this.aac_last_incomplete_data_=E.getIncompleteData()),g&&(this.aac_last_sample_pts_=g)}},t.prototype.parseAC3Payload=function(i,e){if(!this.has_video_||this.video_init_segment_dispatched_){var a,s;if(e!=null&&(s=e/this.timescale_),this.audio_metadata_.codec==="ac-3"){if(e==null&&this.aac_last_sample_pts_!=null)a=1536/this.audio_metadata_.sampling_frequency*1e3,s=this.aac_last_sample_pts_+a;else if(e==null)return void m.a.w(this.TAG,"Opus: Unknown pts")}for(var r,o=new Mt(i),p=null,g=s;(p=o.readNextAC3Frame())!=null;){a=1536/p.sampling_frequency*1e3;var E={codec:"ac-3",data:p};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"ac-3",sampling_frequency:p.sampling_frequency,bit_stream_identification:p.bit_stream_identification,bit_stream_mode:p.bit_stream_mode,low_frequency_effects_channel_on:p.low_frequency_effects_channel_on,channel_mode:p.channel_mode},console.log(JSON.stringify(this.audio_metadata_)),this.dispatchAudioInitSegment(E)):this.detectAudioMetadataChange(E)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(E)),r=g;var A=Math.floor(g),S={unit:p.data,length:p.data.byteLength,pts:A,dts:A};this.audio_track_.samples.push(S),this.audio_track_.length+=p.data.byteLength,g+=a}r&&(this.aac_last_sample_pts_=r)}},t.prototype.parseOpusPayload=function(i,e){if(!this.has_video_||this.video_init_segment_dispatched_){var a,s;if(e!=null&&(s=e/this.timescale_),this.audio_metadata_.codec==="opus"){if(e==null&&this.aac_last_sample_pts_!=null)a=20,s=this.aac_last_sample_pts_+a;else if(e==null)return void m.a.w(this.TAG,"Opus: Unknown pts")}for(var r,o=s,p=0;p<i.length;){a=20;for(var g=(16&i[p+1])!=0,E=(8&i[p+1])!=0,A=p+2,S=0;i[A]===255;)S+=255,A+=1;S+=i[A],A+=1,A+=g?2:0,A+=E?2:0,r=o;var T=Math.floor(o),B=i.slice(A,A+S),z={unit:B,length:B.byteLength,pts:T,dts:T};this.audio_track_.samples.push(z),this.audio_track_.length+=B.byteLength,o+=a,p=A+S}r&&(this.aac_last_sample_pts_=r)}},t.prototype.parseMP3Payload=function(i,e){if(!this.has_video_||this.video_init_segment_dispatched_){var a=[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=i[1]>>>3&3,p=(6&i[1])>>1,g=(240&i[2])>>>4,E=(12&i[2])>>>2,A=(i[3]>>>6&3)!==3?2:1,S=0,T=34;switch(o){case 0:S=[11025,12e3,8e3,0][E];break;case 2:S=[22050,24e3,16e3,0][E];break;case 3:S=[44100,48e3,32e3,0][E]}switch(p){case 1:T=34,g<r.length&&r[g];break;case 2:T=33,g<s.length&&s[g];break;case 3:T=32,g<a.length&&a[g]}var B=new It;B.object_type=T,B.sample_rate=S,B.channel_count=A,B.data=i;var z={codec:"mp3",data:B};this.audio_init_segment_dispatched_==0?(this.audio_metadata_={codec:"mp3",object_type:T,sample_rate:S,channel_count:A},this.dispatchAudioInitSegment(z)):this.detectAudioMetadataChange(z)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(z));var U={unit:i,length:i.byteLength,pts:e/this.timescale_,dts:e/this.timescale_};this.audio_track_.samples.push(U),this.audio_track_.length+=i.byteLength}},t.prototype.detectAudioMetadataChange=function(i){if(i.codec!==this.audio_metadata_.codec)return m.a.v(this.TAG,"Audio: Audio Codecs changed from "+this.audio_metadata_.codec+" to "+i.codec),!0;if(i.codec==="aac"&&this.audio_metadata_.codec==="aac"){if((e=i.data).audio_object_type!==this.audio_metadata_.audio_object_type)return m.a.v(this.TAG,"AAC: AudioObjectType changed from "+this.audio_metadata_.audio_object_type+" to "+e.audio_object_type),!0;if(e.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return m.a.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+this.audio_metadata_.sampling_freq_index+" to "+e.sampling_freq_index),!0;if(e.channel_config!==this.audio_metadata_.channel_config)return m.a.v(this.TAG,"AAC: Channel configuration changed from "+this.audio_metadata_.channel_config+" to "+e.channel_config),!0}else if(i.codec==="ac-3"&&this.audio_metadata_.codec==="ac-3"){var e;if((e=i.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return m.a.v(this.TAG,"AC3: Sampling Frequency changed from "+this.audio_metadata_.sampling_frequency+" to "+e.sampling_frequency),!0;if(e.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return m.a.v(this.TAG,"AC3: Bit Stream Identification changed from "+this.audio_metadata_.bit_stream_identification+" to "+e.bit_stream_identification),!0;if(e.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return m.a.v(this.TAG,"AC3: BitStream Mode changed from "+this.audio_metadata_.bit_stream_mode+" to "+e.bit_stream_mode),!0;if(e.channel_mode!==this.audio_metadata_.channel_mode)return m.a.v(this.TAG,"AC3: Channel Mode changed from "+this.audio_metadata_.channel_mode+" to "+e.channel_mode),!0;if(e.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return m.a.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+this.audio_metadata_.low_frequency_effects_channel_on+" to "+e.low_frequency_effects_channel_on),!0}else if(i.codec==="opus"&&this.audio_metadata_.codec==="opus"){if((a=i.meta).sample_rate!==this.audio_metadata_.sample_rate)return m.a.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+this.audio_metadata_.sample_rate+" to "+a.sample_rate),!0;if(a.channel_count!==this.audio_metadata_.channel_count)return m.a.v(this.TAG,"Opus: Channel count changed from "+this.audio_metadata_.channel_count+" to "+a.channel_count),!0}else if(i.codec==="mp3"&&this.audio_metadata_.codec==="mp3"){var a;if((a=i.data).object_type!==this.audio_metadata_.object_type)return m.a.v(this.TAG,"MP3: AudioObjectType changed from "+this.audio_metadata_.object_type+" to "+a.object_type),!0;if(a.sample_rate!==this.audio_metadata_.sample_rate)return m.a.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+this.audio_metadata_.sample_rate+" to "+a.sample_rate),!0;if(a.channel_count!==this.audio_metadata_.channel_count)return m.a.v(this.TAG,"MP3: Channel count changed from "+this.audio_metadata_.channel_count+" to "+a.channel_count),!0}return!1},t.prototype.dispatchAudioInitSegment=function(i){var e={type:"audio"};if(e.id=this.audio_track_.id,e.timescale=1e3,e.duration=this.duration_,this.audio_metadata_.codec==="aac"){var a=i.codec==="aac"?i.data:null,s=new ne(a);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=i.codec==="ac-3"?i.data:null,o=new xt(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 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&&m.a.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: "+e.codec),this.onTrackMetadata("audio",e),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var p=this.media_info_;p.hasAudio=!0,p.audioCodec=e.originalCodec,p.audioSampleRate=e.audioSampleRate,p.audioChannelCount=e.channelCount,p.hasVideo&&p.videoCodec?p.mimeType='video/mp2t; codecs="'+p.videoCodec+","+p.audioCodec+'"':p.mimeType='video/mp2t; codecs="'+p.audioCodec+'"',p.isComplete()&&this.onMediaInfo(p)},t.prototype.dispatchPESPrivateDataDescriptor=function(i,e,a){var s=new we;s.pid=i,s.stream_type=e,s.descriptor=a,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(s)},t.prototype.parsePESPrivateDataPayload=function(i,e,a,s,r){var o=new le;if(o.pid=s,o.stream_id=r,o.len=i.byteLength,o.data=i,e!=null){var p=Math.floor(e/this.timescale_);o.pts=p}else o.nearest_pts=this.aac_last_sample_pts_;if(a!=null){var g=Math.floor(a/this.timescale_);o.dts=g}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(i,e,a,s,r){var o=new le;if(o.pid=s,o.stream_id=r,o.len=i.byteLength,o.data=i,e!=null){var p=Math.floor(e/this.timescale_);o.pts=p}if(a!=null){var g=Math.floor(a/this.timescale_);o.dts=g}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(i,e,a,s,r){var o=new Bt;if(o.pid=s,o.stream_id=r,o.len=i.byteLength,o.data=i,e!=null){var p=Math.floor(e/this.timescale_);o.pts=p}if(o.nearest_pts=this.aac_last_sample_pts_,a!=null){var g=Math.floor(a/this.timescale_);o.dts=g}o.ancillaries=function(E){for(var A=new he(E),S=0,T=[];S+=6,A.readBits(6)===0;){var B=A.readBool();S+=1;var z=A.readBits(11);S+=11;var U=A.readBits(12);S+=12;var Y=255&A.readBits(10);S+=10;var W=255&A.readBits(10);S+=10;var q=255&A.readBits(10);S+=10;for(var oe=new Uint8Array(q),ue=0;ue<q;ue++){var K=255&A.readBits(10);S+=10,oe[ue]=K}A.readBits(10),S+=10;var Q="User Defined";Y===65?W===7&&(Q="SCTE-104"):Y===95?W===220?Q="ARIB STD-B37 (1SEG)":W===221?Q="ARIB STD-B37 (ANALOG)":W===222?Q="ARIB STD-B37 (SD)":W===223&&(Q="ARIB STD-B37 (HD)"):Y===97&&(W===1?Q="EIA-708":W===2&&(Q="EIA-608")),T.push({yc_indicator:B,line_number:z,horizontal_offset:U,did:Y,sdid:W,user_data:oe,description:Q,information:{}}),A.readBits(8-(S-Math.floor(S/8))%8),S+=(8-(S-Math.floor(S/8)))%8}return A.destroy(),A=null,T}(i),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(l),Nt=function(){for(var n=0,t=0,i=arguments.length;t<i;t++)n+=arguments[t].length;var e=Array(n),a=0;for(t=0;t<i;t++)for(var s=arguments[t],r=0,o=s.length;r<o;r++,a++)e[a]=s[r];return e},st=function(){function n(){}return n.init=function(){for(var t in n.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],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:[]},n.types)n.types.hasOwnProperty(t)&&(n.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=n.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.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]),i.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]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},n.box=function(t){for(var i=8,e=null,a=Array.prototype.slice.call(arguments,1),s=a.length,r=0;r<s;r++)i+=a[r].byteLength;(e=new Uint8Array(i))[0]=i>>>24&255,e[1]=i>>>16&255,e[2]=i>>>8&255,e[3]=255&i,e.set(t,4);var o=8;for(r=0;r<s;r++)e.set(a[r],o),o+=a[r].byteLength;return e},n.generateInitSegment=function(t){var i=n.box(n.types.ftyp,n.constants.FTYP),e=n.moov(t),a=new Uint8Array(i.byteLength+e.byteLength);return a.set(i,0),a.set(e,i.byteLength),a},n.moov=function(t){var i=n.mvhd(t.timescale,t.duration),e=n.trak(t),a=n.mvex(t);return n.box(n.types.moov,i,e,a)},n.mvhd=function(t,i){return n.box(n.types.mvhd,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,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))},n.trak=function(t){return n.box(n.types.trak,n.tkhd(t),n.mdia(t))},n.tkhd=function(t){var i=t.id,e=t.duration,a=t.presentWidth,s=t.presentHeight;return n.box(n.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,a>>>8&255,255&a,0,0,s>>>8&255,255&s,0,0]))},n.mdia=function(t){return n.box(n.types.mdia,n.mdhd(t),n.hdlr(t),n.minf(t))},n.mdhd=function(t){var i=t.timescale,e=t.duration;return n.box(n.types.mdhd,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,e>>>24&255,e>>>16&255,e>>>8&255,255&e,85,196,0,0]))},n.hdlr=function(t){var i=null;return i=t.type==="audio"?n.constants.HDLR_AUDIO:n.constants.HDLR_VIDEO,n.box(n.types.hdlr,i)},n.minf=function(t){var i=null;return i=t.type==="audio"?n.box(n.types.smhd,n.constants.SMHD):n.box(n.types.vmhd,n.constants.VMHD),n.box(n.types.minf,i,n.dinf(),n.stbl(t))},n.dinf=function(){return n.box(n.types.dinf,n.box(n.types.dref,n.constants.DREF))},n.stbl=function(t){return n.box(n.types.stbl,n.stsd(t),n.box(n.types.stts,n.constants.STTS),n.box(n.types.stsc,n.constants.STSC),n.box(n.types.stsz,n.constants.STSZ),n.box(n.types.stco,n.constants.STCO))},n.stsd=function(t){return t.type==="audio"?t.codec==="mp3"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.mp3(t)):t.codec==="ac-3"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.ac3(t)):t.codec==="opus"?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.Opus(t)):n.box(n.types.stsd,n.constants.STSD_PREFIX,n.mp4a(t)):t.type==="video"&&t.codec.startsWith("hvc1")?n.box(n.types.stsd,n.constants.STSD_PREFIX,n.hvc1(t)):n.box(n.types.stsd,n.constants.STSD_PREFIX,n.avc1(t))},n.mp3=function(t){var i=t.channelCount,e=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return n.box(n.types[".mp3"],a)},n.mp4a=function(t){var i=t.channelCount,e=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return n.box(n.types.mp4a,a,n.esds(t))},n.ac3=function(t){var i=t.channelCount,e=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return n.box(n.types["ac-3"],a,n.box(n.types.dac3,new Uint8Array(t.config)))},n.esds=function(t){var i=t.config||[],e=i.length,a=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(i).concat([6,1,2]));return n.box(n.types.esds,a)},n.Opus=function(t){var i=t.channelCount,e=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,e>>>8&255,255&e,0,0]);return n.box(n.types.Opus,a,n.dOps(t))},n.dOps=function(t){var i=t.channelCount,e=t.channelConfigCode,a=t.audioSampleRate;if(t.config)return n.box(n.types.dOps,r);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(Nt([0,i,0,0,a>>>24&255,a>>>17&255,a>>>8&255,a>>>0&255,0,0],s));return n.box(n.types.dOps,r)},n.avc1=function(t){var i=t.avcc,e=t.codecWidth,a=t.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,a>>>8&255,255&a,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 n.box(n.types.avc1,s,n.box(n.types.avcC,i))},n.hvc1=function(t){var i=t.hvcc,e=t.codecWidth,a=t.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,a>>>8&255,255&a,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 n.box(n.types.hvc1,s,n.box(n.types.hvcC,i))},n.mvex=function(t){return n.box(n.types.mvex,n.trex(t))},n.trex=function(t){var i=t.id,e=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return n.box(n.types.trex,e)},n.moof=function(t,i){return n.box(n.types.moof,n.mfhd(t.sequenceNumber),n.traf(t,i))},n.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return n.box(n.types.mfhd,i)},n.traf=function(t,i){var e=t.id,a=n.box(n.types.tfhd,new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])),s=n.box(n.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),r=n.sdtp(t),o=n.trun(t,r.byteLength+16+16+8+16+8+8);return n.box(n.types.traf,a,s,o,r)},n.sdtp=function(t){for(var i=t.samples||[],e=i.length,a=new Uint8Array(4+e),s=0;s<e;s++){var r=i[s].flags;a[s+4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy}return n.box(n.types.sdtp,a)},n.trun=function(t,i){var e=t.samples||[],a=e.length,s=12+16*a,r=new Uint8Array(s);i+=8+s,r.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var o=0;o<a;o++){var p=e[o].duration,g=e[o].size,E=e[o].flags,A=e[o].cts;r.set([p>>>24&255,p>>>16&255,p>>>8&255,255&p,g>>>24&255,g>>>16&255,g>>>8&255,255&g,E.isLeading<<2|E.dependsOn,E.isDependedOn<<6|E.hasRedundancy<<4|E.isNonSync,0,0,A>>>24&255,A>>>16&255,A>>>8&255,255&A],12+16*o)}return n.box(n.types.trun,r)},n.mdat=function(t){return n.box(n.types.mdat,t)},n}();st.init();var je=st,ot=function(){function n(){}return n.getSilentFrame=function(t,i){if(t==="mp4a.40.2"){if(i===1)return new Uint8Array([0,200,0,128,35,128]);if(i===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(i===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(i===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(i===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(i===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(i===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(i===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(i===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},n}(),Pe=O(7),dt=function(){function n(t){this.TAG="MP4Remuxer",this._config=t,this._isLive=t.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 Pe.c("audio"),this._videoSegmentInfoList=new Pe.c("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!b.a.chrome||!(b.a.version.major<50||b.a.version.major===50&&b.a.version.build<2661)),this._fillSilentAfterSeek=b.a.msedge||b.a.msie,this._mp3UseMpegAudio=!b.a.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return n.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},n.prototype.bindDataSource=function(t){return t.onDataAvailable=this.remux.bind(this),t.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(n.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(t){this._onInitSegment=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(t){this._onMediaSegment=t},enumerable:!1,configurable:!0}),n.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},n.prototype.seek=function(t){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},n.prototype.remux=function(t,i){if(!this._onMediaSegment)throw new C.a("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(t,i),i&&this._remuxVideo(i),t&&this._remuxAudio(t)},n.prototype._onTrackMetadataReceived=function(t,i){var e=null,a="mp4",s=i.codec;if(t==="audio")this._audioMeta=i,i.codec==="mp3"&&this._mp3UseMpegAudio?(a="mpeg",s="",e=new Uint8Array):e=je.generateInitSegment(i);else{if(t!=="video")return;this._videoMeta=i,e=je.generateInitSegment(i)}if(!this._onInitSegment)throw new C.a("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(t,{type:t,data:e.buffer,codec:s,container:t+"/"+a,mediaDuration:i.duration})},n.prototype._calculateDtsBase=function(t,i){this._dtsBaseInited||(t&&t.samples&&t.samples.length&&(this._audioDtsBase=t.samples[0].dts),i&&i.samples&&i.samples.length&&(this._videoDtsBase=i.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},n.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},n.prototype.flushStashedSamples=function(){var t=this._videoStashedLastSample,i=this._audioStashedLastSample,e={type:"video",id:1,sequenceNumber:0,samples:[],length:0};t!=null&&(e.samples.push(t),e.length=t.length);var a={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};i!=null&&(a.samples.push(i),a.length=i.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(e,!0),this._remuxAudio(a,!0)},n.prototype._remuxAudio=function(t,i){if(this._audioMeta!=null){var e,a=t,s=a.samples,r=void 0,o=-1,p=this._audioMeta.refSampleDuration,g=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&this._audioNextDts===void 0,A=!1;if(s&&s.length!==0&&(s.length!==1||i)){var S=0,T=null,B=0;g?(S=0,B=a.length):(S=8,B=8+a.length);var z=null;if(s.length>1&&(B-=(z=s.pop()).length),this._audioStashedLastSample!=null){var U=this._audioStashedLastSample;this._audioStashedLastSample=null,s.unshift(U),B+=U.length}z!=null&&(this._audioStashedLastSample=z);var Y=s[0].dts-this._dtsBase;if(this._audioNextDts)r=Y-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())r=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(A=!0);else{var W=this._audioSegmentInfoList.getLastSampleBefore(Y);if(W!=null){var q=Y-(W.originalDts+W.duration);q<=3&&(q=0),r=Y-(W.dts+W.duration+q)}else r=0}if(A){var oe=Y-r,ue=this._videoSegmentInfoList.getLastSegmentBefore(Y);if(ue!=null&&ue.beginDts<oe){if(ke=ot.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount)){var K=ue.beginDts,Q=oe-ue.beginDts;m.a.v(this.TAG,"InsertPrefixSilentAudio: dts: "+K+", duration: "+Q),s.unshift({unit:ke,dts:K,pts:K}),B+=ke.byteLength}}else A=!1}for(var ce=[],te=0;te<s.length;te++){var ae=(U=s[te]).unit,be=U.dts-this._dtsBase,Ae=(K=be,!1),_e=null,ye=0;if(!(be<-.001)){if(this._audioMeta.codec!=="mp3"){var Re=be;if(this._audioNextDts&&(Re=this._audioNextDts),(r=be-Re)<=-3*p){m.a.w(this.TAG,"Dropping 1 audio frame (originalDts: "+be+" ms ,curRefDts: "+Re+" ms) due to dtsCorrection: "+r+" ms overlap.");continue}if(r>=3*p&&this._fillAudioTimestampGap&&!b.a.safari){Ae=!0;var ke,Ue=Math.floor(r/p);m.a.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
- originalDts: `+be+" ms, curRefDts: "+Re+" ms, dtsCorrection: "+Math.round(r)+" ms, generate: "+Ue+" frames"),K=Math.floor(Re),ye=Math.floor(Re+p)-K,(ke=ot.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))==null&&(m.a.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),ke=ae),_e=[];for(var Oe=0;Oe<Ue;Oe++){Re+=p;var Ne=Math.floor(Re),Ve=Math.floor(Re+p)-Ne,Ge={dts:Ne,pts:Ne,cts:0,unit:ke,size:ke.byteLength,duration:Ve,originalDts:be,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};_e.push(Ge),B+=Ge.size}this._audioNextDts=Re+p}else K=Math.floor(Re),ye=Math.floor(Re+p)-K,this._audioNextDts=Re+p}else K=be-r,te!==s.length-1?ye=s[te+1].dts-this._dtsBase-r-K:z!=null?ye=z.dts-this._dtsBase-r-K:ye=ce.length>=1?ce[ce.length-1].duration:Math.floor(p),this._audioNextDts=K+ye;o===-1&&(o=K),ce.push({dts:K,pts:K,cts:0,unit:U.unit,size:U.unit.byteLength,duration:ye,originalDts:be,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ae&&ce.push.apply(ce,_e)}}if(ce.length===0)return a.samples=[],void(a.length=0);for(g?T=new Uint8Array(B):((T=new Uint8Array(B))[0]=B>>>24&255,T[1]=B>>>16&255,T[2]=B>>>8&255,T[3]=255&B,T.set(je.types.mdat,4)),te=0;te<ce.length;te++)ae=ce[te].unit,T.set(ae,S),S+=ae.byteLength;var Ce=ce[ce.length-1];e=Ce.dts+Ce.duration;var ge=new Pe.b;ge.beginDts=o,ge.endDts=e,ge.beginPts=o,ge.endPts=e,ge.originalBeginDts=ce[0].originalDts,ge.originalEndDts=Ce.originalDts+Ce.duration,ge.firstSample=new Pe.d(ce[0].dts,ce[0].pts,ce[0].duration,ce[0].originalDts,!1),ge.lastSample=new Pe.d(Ce.dts,Ce.pts,Ce.duration,Ce.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(ge),a.samples=ce,a.sequenceNumber++;var Me=null;Me=g?new Uint8Array:je.moof(a,o),a.samples=[],a.length=0;var xe={type:"audio",data:this._mergeBoxes(Me,T).buffer,sampleCount:ce.length,info:ge};g&&E&&(xe.timestampOffset=o),this._onMediaSegment("audio",xe)}}},n.prototype._remuxVideo=function(t,i){if(this._videoMeta!=null){var e,a,s=t,r=s.samples,o=void 0,p=-1,g=-1;if(r&&r.length!==0&&(r.length!==1||i)){var E=8,A=null,S=8+t.length,T=null;if(r.length>1&&(S-=(T=r.pop()).length),this._videoStashedLastSample!=null){var B=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(B),S+=B.length}T!=null&&(this._videoStashedLastSample=T);var z=r[0].dts-this._dtsBase;if(this._videoNextDts)o=z-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var U=this._videoSegmentInfoList.getLastSampleBefore(z);if(U!=null){var Y=z-(U.originalDts+U.duration);Y<=3&&(Y=0),o=z-(U.dts+U.duration+Y)}else o=0}for(var W=new Pe.b,q=[],oe=0;oe<r.length;oe++){var ue=(B=r[oe]).dts-this._dtsBase,K=B.isKeyframe,Q=ue-o,ce=B.cts,te=Q+ce;p===-1&&(p=Q,g=te);var ae=0;if(oe!==r.length-1?ae=r[oe+1].dts-this._dtsBase-o-Q:T!=null?ae=T.dts-this._dtsBase-o-Q:ae=q.length>=1?q[q.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),K){var be=new Pe.d(Q,te,ae,B.dts,!0);be.fileposition=B.fileposition,W.appendSyncPoint(be)}q.push({dts:Q,pts:te,cts:ce,units:B.units,size:B.length,isKeyframe:K,duration:ae,originalDts:ue,flags:{isLeading:0,dependsOn:K?2:1,isDependedOn:K?1:0,hasRedundancy:0,isNonSync:K?0:1}})}for((A=new Uint8Array(S))[0]=S>>>24&255,A[1]=S>>>16&255,A[2]=S>>>8&255,A[3]=255&S,A.set(je.types.mdat,4),oe=0;oe<q.length;oe++)for(var Ae=q[oe].units;Ae.length;){var _e=Ae.shift().data;A.set(_e,E),E+=_e.byteLength}var ye=q[q.length-1];if(e=ye.dts+ye.duration,a=ye.pts+ye.duration,this._videoNextDts=e,W.beginDts=p,W.endDts=e,W.beginPts=g,W.endPts=a,W.originalBeginDts=q[0].originalDts,W.originalEndDts=ye.originalDts+ye.duration,W.firstSample=new Pe.d(q[0].dts,q[0].pts,q[0].duration,q[0].originalDts,q[0].isKeyframe),W.lastSample=new Pe.d(ye.dts,ye.pts,ye.duration,ye.originalDts,ye.isKeyframe),this._isLive||this._videoSegmentInfoList.append(W),s.samples=q,s.sequenceNumber++,this._forceFirstIDR){var Re=q[0].flags;Re.dependsOn=2,Re.isNonSync=0}var ke=je.moof(s,p);s.samples=[],s.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(ke,A).buffer,sampleCount:q.length,info:W})}}},n.prototype._mergeBoxes=function(t,i){var e=new Uint8Array(t.byteLength+i.byteLength);return e.set(t,0),e.set(i,t.byteLength),e},n}(),Gt=O(11),Le=O(1),Ft=function(){function n(t,i){this.TAG="TransmuxingController",this._emitter=new I.a,this._config=i,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),typeof t.cors!="boolean"&&(t.cors=!0),typeof t.withCredentials!="boolean"&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var e=0;this._mediaDataSource.segments.forEach(function(a){a.timestampBase=e,e+=a.duration,a.cors=t.cors,a.withCredentials=t.withCredentials,i.referrerPolicy&&(a.referrerPolicy=i.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 n.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},n.prototype.on=function(t,i){this._emitter.addListener(t,i)},n.prototype.off=function(t,i){this._emitter.removeListener(t,i)},n.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},n.prototype._loadSegment=function(t,i){this._currentSegmentIndex=t;var e=this._mediaDataSource.segments[t],a=this._ioctl=new Gt.a(e,this._config,t);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),i?this._demuxer.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(i)},n.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},n.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},n.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},n.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},n.prototype.seek=function(t){if(this._mediaInfo!=null&&this._mediaInfo.isSeekable()){var i=this._searchSegmentIndexContains(t);if(i===this._currentSegmentIndex){var e=this._mediaInfo.segments[i];if(e==null)this._pendingSeekTime=t;else{var a=e.getNearestKeyframe(t);this._remuxer.seek(a.milliseconds),this._ioctl.seek(a.fileposition),this._pendingResolveSeekPoint=a.milliseconds}}else{var s=this._mediaInfo.segments[i];s==null?(this._pendingSeekTime=t,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(i)):(a=s.getNearestKeyframe(t),this._internalAbort(),this._remuxer.seek(t),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[i].timestampBase,this._loadSegment(i,a.fileposition),this._pendingResolveSeekPoint=a.milliseconds,this._reportSegmentMediaInfo(i))}this._enableStatisticsReporter()}},n.prototype._searchSegmentIndexContains=function(t){for(var i=this._mediaDataSource.segments,e=i.length-1,a=0;a<i.length;a++)if(t<i[a].timestampBase){e=a-1;break}return e},n.prototype._onInitChunkArrival=function(t,i){var e=this,a=0;if(i>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,a=this._demuxer.parseChunks(t,i);else{var s=null;(s=c.probe(t)).match&&(this._setupFLVDemuxerRemuxer(s),a=this._demuxer.parseChunks(t,i)),s.match||s.needMoreData||(s=rt.probe(t)).match&&(this._setupTSDemuxerRemuxer(s),a=this._demuxer.parseChunks(t,i)),s.match||s.needMoreData||(s=null,m.a.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){e._internalAbort()}),this._emitter.emit(Le.a.DEMUX_ERROR,J.a.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return a},n.prototype._setupFLVDemuxerRemuxer=function(t){this._demuxer=new c(t,this._config),this._remuxer||(this._remuxer=new dt(this._config));var i=this._mediaDataSource;i.duration==null||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),typeof i.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=i.hasAudio),typeof i.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=i.hasVideo),this._demuxer.timestampBase=i.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)},n.prototype._setupTSDemuxerRemuxer=function(t){var i=this._demuxer=new rt(t,this._config);this._remuxer||(this._remuxer=new dt(this._config)),i.onError=this._onDemuxException.bind(this),i.onMediaInfo=this._onMediaInfo.bind(this),i.onMetaDataArrived=this._onMetaDataArrived.bind(this),i.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),i.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),i.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),i.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),i.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)},n.prototype._onMediaInfo=function(t){var i=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},t),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,v.a.prototype));var e=Object.assign({},t);Object.setPrototypeOf(e,v.a.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=e,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var a=i._pendingSeekTime;i._pendingSeekTime=null,i.seek(a)})},n.prototype._onMetaDataArrived=function(t){this._emitter.emit(Le.a.METADATA_ARRIVED,t)},n.prototype._onScriptDataArrived=function(t){this._emitter.emit(Le.a.SCRIPTDATA_ARRIVED,t)},n.prototype._onTimedID3Metadata=function(t){var i=this._remuxer.getTimestampBase();i!=null&&(t.pts!=null&&(t.pts-=i),t.dts!=null&&(t.dts-=i),this._emitter.emit(Le.a.TIMED_ID3_METADATA_ARRIVED,t))},n.prototype._onSMPTE2038Metadata=function(t){var i=this._remuxer.getTimestampBase();i!=null&&(t.pts!=null&&(t.pts-=i),t.dts!=null&&(t.dts-=i),t.nearest_pts!=null&&(t.nearest_pts-=i),this._emitter.emit(Le.a.SMPTE2038_METADATA_ARRIVED,t))},n.prototype._onSCTE35Metadata=function(t){var i=this._remuxer.getTimestampBase();i!=null&&(t.pts!=null&&(t.pts-=i),t.nearest_pts!=null&&(t.nearest_pts-=i),this._emitter.emit(Le.a.SCTE35_METADATA_ARRIVED,t))},n.prototype._onPESPrivateDataDescriptor=function(t){this._emitter.emit(Le.a.PES_PRIVATE_DATA_DESCRIPTOR,t)},n.prototype._onPESPrivateData=function(t){var i=this._remuxer.getTimestampBase();i!=null&&(t.pts!=null&&(t.pts-=i),t.nearest_pts!=null&&(t.nearest_pts-=i),t.dts!=null&&(t.dts-=i),this._emitter.emit(Le.a.PES_PRIVATE_DATA_ARRIVED,t))},n.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},n.prototype._onIOComplete=function(t){var i=t+1;i<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Le.a.LOADING_COMPLETE),this._disableStatisticsReporter())},n.prototype._onIORedirect=function(t){var i=this._ioctl.extraData;this._mediaDataSource.segments[i].redirectedURL=t},n.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Le.a.RECOVERED_EARLY_EOF)},n.prototype._onIOException=function(t,i){m.a.e(this.TAG,"IOException: type = "+t+", code = "+i.code+", msg = "+i.msg),this._emitter.emit(Le.a.IO_ERROR,t,i),this._disableStatisticsReporter()},n.prototype._onDemuxException=function(t,i){m.a.e(this.TAG,"DemuxException: type = "+t+", info = "+i),this._emitter.emit(Le.a.DEMUX_ERROR,t,i)},n.prototype._onRemuxerInitSegmentArrival=function(t,i){this._emitter.emit(Le.a.INIT_SEGMENT,t,i)},n.prototype._onRemuxerMediaSegmentArrival=function(t,i){if(this._pendingSeekTime==null&&(this._emitter.emit(Le.a.MEDIA_SEGMENT,t,i),this._pendingResolveSeekPoint!=null&&t==="video")){var e=i.info.syncPoints,a=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,b.a.safari&&e.length>0&&e[0].originalDts===a&&(a=e[0].pts),this._emitter.emit(Le.a.RECOMMEND_SEEKPOINT,a)}},n.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},n.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},n.prototype._reportSegmentMediaInfo=function(t){var i=this._mediaInfo.segments[t],e=Object.assign({},i);e.duration=this._mediaInfo.duration,e.segmentCount=this._mediaInfo.segmentCount,delete e.segments,delete e.keyframesIndex,this._emitter.emit(Le.a.MEDIA_INFO,e)},n.prototype._reportStatisticsInfo=function(){var t={};t.url=this._ioctl.currentURL,t.hasRedirect=this._ioctl.hasRedirect,t.hasRedirect&&(t.redirectedURL=this._ioctl.currentRedirectedURL),t.speed=this._ioctl.currentSpeed,t.loaderType=this._ioctl.loaderType,t.currentSegmentIndex=this._currentSegmentIndex,t.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.a.STATISTICS_INFO,t)},n}();Z.a=Ft},function(pe,Z,O){var N,I=O(0),m=function(){function w(){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 w.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},w.prototype.addBytes=function(h){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=h,this._totalBytes+=h):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=h,this._totalBytes+=h):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=h,this._totalBytes+=h,this._lastCheckpoint=this._now())},Object.defineProperty(w.prototype,"currentKBps",{get:function(){this.addBytes(0);var h=(this._now()-this._lastCheckpoint)/1e3;return h==0&&(h=1),this._intervalBytes/h/1024},enumerable:!1,configurable:!0}),Object.defineProperty(w.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(w.prototype,"averageKBps",{get:function(){var h=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/h/1024},enumerable:!1,configurable:!0}),w}(),b=O(2),v=O(4),f=O(3),k=(N=function(w,h){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,c){_.__proto__=c}||function(_,c){for(var l in c)c.hasOwnProperty(l)&&(_[l]=c[l])})(w,h)},function(w,h){function _(){this.constructor=w}N(w,h),w.prototype=h===null?Object.create(h):(_.prototype=h.prototype,new _)}),x=function(w){function h(_,c){var l=w.call(this,"fetch-stream-loader")||this;return l.TAG="FetchStreamLoader",l._seekHandler=_,l._config=c,l._needStash=!0,l._requestAbort=!1,l._abortController=null,l._contentLength=null,l._receivedLength=0,l}return k(h,w),h.isSupported=function(){try{var _=v.a.msedge&&v.a.version.minor>=15048,c=!v.a.msedge||_;return self.fetch&&self.ReadableStream&&c}catch{return!1}},h.prototype.destroy=function(){this.isWorking()&&this.abort(),w.prototype.destroy.call(this)},h.prototype.open=function(_,c){var l=this;this._dataSource=_,this._range=c;var P=_.url;this._config.reuseRedirectedURL&&_.redirectedURL!=null&&(P=_.redirectedURL);var D=this._seekHandler.getConfig(P,c),F=new self.Headers;if(typeof D.headers=="object"){var ee=D.headers;for(var fe in ee)ee.hasOwnProperty(fe)&&F.append(fe,ee[fe])}var ve={method:"GET",headers:F,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var fe in this._config.headers)F.append(fe,this._config.headers[fe]);_.cors===!1&&(ve.mode="same-origin"),_.withCredentials&&(ve.credentials="include"),_.referrerPolicy&&(ve.referrerPolicy=_.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,ve.signal=this._abortController.signal),this._status=b.c.kConnecting,self.fetch(D.url,ve).then(function(L){if(l._requestAbort)return l._status=b.c.kIdle,void L.body.cancel();if(L.ok&&L.status>=200&&L.status<=299){if(L.url!==D.url&&l._onURLRedirect){var d=l._seekHandler.removeURLParameters(L.url);l._onURLRedirect(d)}var u=L.headers.get("Content-Length");return u!=null&&(l._contentLength=parseInt(u),l._contentLength!==0&&l._onContentLengthKnown&&l._onContentLengthKnown(l._contentLength)),l._pump.call(l,L.body.getReader())}if(l._status=b.c.kError,!l._onError)throw new f.d("FetchStreamLoader: Http code invalid, "+L.status+" "+L.statusText);l._onError(b.b.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText})}).catch(function(L){if(!l._abortController||!l._abortController.signal.aborted){if(l._status=b.c.kError,!l._onError)throw L;l._onError(b.b.EXCEPTION,{code:-1,msg:L.message})}})},h.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==b.c.kBuffering||!v.a.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},h.prototype._pump=function(_){var c=this;return _.read().then(function(l){if(l.done)if(c._contentLength!==null&&c._receivedLength<c._contentLength){c._status=b.c.kError;var P=b.b.EARLY_EOF,D={code:-1,msg:"Fetch stream meet Early-EOF"};if(!c._onError)throw new f.d(D.msg);c._onError(P,D)}else c._status=b.c.kComplete,c._onComplete&&c._onComplete(c._range.from,c._range.from+c._receivedLength-1);else{if(c._abortController&&c._abortController.signal.aborted)return void(c._status=b.c.kComplete);if(c._requestAbort===!0)return c._status=b.c.kComplete,_.cancel();c._status=b.c.kBuffering;var F=l.value.buffer,ee=c._range.from+c._receivedLength;c._receivedLength+=F.byteLength,c._onDataArrival&&c._onDataArrival(F,ee,c._receivedLength),c._pump(_)}}).catch(function(l){if(c._abortController&&c._abortController.signal.aborted)c._status=b.c.kComplete;else if(l.code!==11||!v.a.msedge){c._status=b.c.kError;var P=0,D=null;if(l.code!==19&&l.message!=="network error"||!(c._contentLength===null||c._contentLength!==null&&c._receivedLength<c._contentLength)?(P=b.b.EXCEPTION,D={code:l.code,msg:l.message}):(P=b.b.EARLY_EOF,D={code:l.code,msg:"Fetch stream meet Early-EOF"}),!c._onError)throw new f.d(D.msg);c._onError(P,D)}})},h}(b.a),C=function(){var w=function(h,_){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,l){c.__proto__=l}||function(c,l){for(var P in l)l.hasOwnProperty(P)&&(c[P]=l[P])})(h,_)};return function(h,_){function c(){this.constructor=h}w(h,_),h.prototype=_===null?Object.create(_):(c.prototype=_.prototype,new c)}}(),j=function(w){function h(_,c){var l=w.call(this,"xhr-moz-chunked-loader")||this;return l.TAG="MozChunkedLoader",l._seekHandler=_,l._config=c,l._needStash=!0,l._xhr=null,l._requestAbort=!1,l._contentLength=null,l._receivedLength=0,l}return C(h,w),h.isSupported=function(){try{var _=new XMLHttpRequest;return _.open("GET","https://example.com",!0),_.responseType="moz-chunked-arraybuffer",_.responseType==="moz-chunked-arraybuffer"}catch(c){return I.a.w("MozChunkedLoader",c.message),!1}},h.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),w.prototype.destroy.call(this)},h.prototype.open=function(_,c){this._dataSource=_,this._range=c;var l=_.url;this._config.reuseRedirectedURL&&_.redirectedURL!=null&&(l=_.redirectedURL);var P=this._seekHandler.getConfig(l,c);this._requestURL=P.url;var D=this._xhr=new XMLHttpRequest;if(D.open("GET",P.url,!0),D.responseType="moz-chunked-arraybuffer",D.onreadystatechange=this._onReadyStateChange.bind(this),D.onprogress=this._onProgress.bind(this),D.onloadend=this._onLoadEnd.bind(this),D.onerror=this._onXhrError.bind(this),_.withCredentials&&(D.withCredentials=!0),typeof P.headers=="object"){var F=P.headers;for(var ee in F)F.hasOwnProperty(ee)&&D.setRequestHeader(ee,F[ee])}if(typeof this._config.headers=="object"){F=this._config.headers;for(var ee in F)F.hasOwnProperty(ee)&&D.setRequestHeader(ee,F[ee])}this._status=b.c.kConnecting,D.send()},h.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=b.c.kComplete},h.prototype._onReadyStateChange=function(_){var c=_.target;if(c.readyState===2){if(c.responseURL!=null&&c.responseURL!==this._requestURL&&this._onURLRedirect){var l=this._seekHandler.removeURLParameters(c.responseURL);this._onURLRedirect(l)}if(c.status!==0&&(c.status<200||c.status>299)){if(this._status=b.c.kError,!this._onError)throw new f.d("MozChunkedLoader: Http code invalid, "+c.status+" "+c.statusText);this._onError(b.b.HTTP_STATUS_CODE_INVALID,{code:c.status,msg:c.statusText})}else this._status=b.c.kBuffering}},h.prototype._onProgress=function(_){if(this._status!==b.c.kError){this._contentLength===null&&_.total!==null&&_.total!==0&&(this._contentLength=_.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var c=_.target.response,l=this._range.from+this._receivedLength;this._receivedLength+=c.byteLength,this._onDataArrival&&this._onDataArrival(c,l,this._receivedLength)}},h.prototype._onLoadEnd=function(_){this._requestAbort!==!0?this._status!==b.c.kError&&(this._status=b.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},h.prototype._onXhrError=function(_){this._status=b.c.kError;var c=0,l=null;if(this._contentLength&&_.loaded<this._contentLength?(c=b.b.EARLY_EOF,l={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(c=b.b.EXCEPTION,l={code:-1,msg:_.constructor.name+" "+_.type}),!this._onError)throw new f.d(l.msg);this._onError(c,l)},h}(b.a),H=function(){var w=function(h,_){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,l){c.__proto__=l}||function(c,l){for(var P in l)l.hasOwnProperty(P)&&(c[P]=l[P])})(h,_)};return function(h,_){function c(){this.constructor=h}w(h,_),h.prototype=_===null?Object.create(_):(c.prototype=_.prototype,new c)}}(),he=function(w){function h(_,c){var l=w.call(this,"xhr-range-loader")||this;return l.TAG="RangeLoader",l._seekHandler=_,l._config=c,l._needStash=!1,l._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],l._currentChunkSizeKB=384,l._currentSpeedNormalized=0,l._zeroSpeedChunkCount=0,l._xhr=null,l._speedSampler=new m,l._requestAbort=!1,l._waitForTotalLength=!1,l._totalLengthReceived=!1,l._currentRequestURL=null,l._currentRedirectedURL=null,l._currentRequestRange=null,l._totalLength=null,l._contentLength=null,l._receivedLength=0,l._lastTimeLoaded=0,l}return H(h,w),h.isSupported=function(){try{var _=new XMLHttpRequest;return _.open("GET","https://example.com",!0),_.responseType="arraybuffer",_.responseType==="arraybuffer"}catch(c){return I.a.w("RangeLoader",c.message),!1}},h.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),w.prototype.destroy.call(this)},Object.defineProperty(h.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),h.prototype.open=function(_,c){this._dataSource=_,this._range=c,this._status=b.c.kConnecting;var l=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(l=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||l?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},h.prototype._openSubRange=function(){var _=1024*this._currentChunkSizeKB,c=this._range.from+this._receivedLength,l=c+_;this._contentLength!=null&&l-this._range.from>=this._contentLength&&(l=this._range.from+this._contentLength-1),this._currentRequestRange={from:c,to:l},this._internalOpen(this._dataSource,this._currentRequestRange)},h.prototype._internalOpen=function(_,c){this._lastTimeLoaded=0;var l=_.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?l=this._currentRedirectedURL:_.redirectedURL!=null&&(l=_.redirectedURL));var P=this._seekHandler.getConfig(l,c);this._currentRequestURL=P.url;var D=this._xhr=new XMLHttpRequest;if(D.open("GET",P.url,!0),D.responseType="arraybuffer",D.onreadystatechange=this._onReadyStateChange.bind(this),D.onprogress=this._onProgress.bind(this),D.onload=this._onLoad.bind(this),D.onerror=this._onXhrError.bind(this),_.withCredentials&&(D.withCredentials=!0),typeof P.headers=="object"){var F=P.headers;for(var ee in F)F.hasOwnProperty(ee)&&D.setRequestHeader(ee,F[ee])}if(typeof this._config.headers=="object"){F=this._config.headers;for(var ee in F)F.hasOwnProperty(ee)&&D.setRequestHeader(ee,F[ee])}D.send()},h.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=b.c.kComplete},h.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)},h.prototype._onReadyStateChange=function(_){var c=_.target;if(c.readyState===2){if(c.responseURL!=null){var l=this._seekHandler.removeURLParameters(c.responseURL);c.responseURL!==this._currentRequestURL&&l!==this._currentRedirectedURL&&(this._currentRedirectedURL=l,this._onURLRedirect&&this._onURLRedirect(l))}if(c.status>=200&&c.status<=299){if(this._waitForTotalLength)return;this._status=b.c.kBuffering}else{if(this._status=b.c.kError,!this._onError)throw new f.d("RangeLoader: Http code invalid, "+c.status+" "+c.statusText);this._onError(b.b.HTTP_STATUS_CODE_INVALID,{code:c.status,msg:c.statusText})}}},h.prototype._onProgress=function(_){if(this._status!==b.c.kError){if(this._contentLength===null){var c=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,c=!0;var l=_.total;this._internalAbort(),l!=null&l!==0&&(this._totalLength=l)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,c)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var P=_.loaded-this._lastTimeLoaded;this._lastTimeLoaded=_.loaded,this._speedSampler.addBytes(P)}},h.prototype._normalizeSpeed=function(_){var c=this._chunkSizeKBList,l=c.length-1,P=0,D=0,F=l;if(_<c[0])return c[0];for(;D<=F;){if((P=D+Math.floor((F-D)/2))===l||_>=c[P]&&_<c[P+1])return c[P];c[P]<_?D=P+1:F=P-1}},h.prototype._onLoad=function(_){if(this._status!==b.c.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var c=this._speedSampler.lastSecondKBps;if(c===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(c=this._speedSampler.currentKBps)),c!==0){var l=this._normalizeSpeed(c);this._currentSpeedNormalized!==l&&(this._currentSpeedNormalized=l,this._currentChunkSizeKB=l)}var P=_.target.response,D=this._range.from+this._receivedLength;this._receivedLength+=P.byteLength;var F=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():F=!0,this._onDataArrival&&this._onDataArrival(P,D,this._receivedLength),F&&(this._status=b.c.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},h.prototype._onXhrError=function(_){this._status=b.c.kError;var c=0,l=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(c=b.b.EARLY_EOF,l={code:-1,msg:"RangeLoader meet Early-Eof"}):(c=b.b.EXCEPTION,l={code:-1,msg:_.constructor.name+" "+_.type}),!this._onError)throw new f.d(l.msg);this._onError(c,l)},h}(b.a),de=function(){var w=function(h,_){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,l){c.__proto__=l}||function(c,l){for(var P in l)l.hasOwnProperty(P)&&(c[P]=l[P])})(h,_)};return function(h,_){function c(){this.constructor=h}w(h,_),h.prototype=_===null?Object.create(_):(c.prototype=_.prototype,new c)}}(),J=function(w){function h(){var _=w.call(this,"websocket-loader")||this;return _.TAG="WebSocketLoader",_._needStash=!0,_._ws=null,_._requestAbort=!1,_._receivedLength=0,_}return de(h,w),h.isSupported=function(){try{return self.WebSocket!==void 0}catch{return!1}},h.prototype.destroy=function(){this._ws&&this.abort(),w.prototype.destroy.call(this)},h.prototype.open=function(_){try{var c=this._ws=new self.WebSocket(_.url);c.binaryType="arraybuffer",c.onopen=this._onWebSocketOpen.bind(this),c.onclose=this._onWebSocketClose.bind(this),c.onmessage=this._onWebSocketMessage.bind(this),c.onerror=this._onWebSocketError.bind(this),this._status=b.c.kConnecting}catch(P){this._status=b.c.kError;var l={code:P.code,msg:P.message};if(!this._onError)throw new f.d(l.msg);this._onError(b.b.EXCEPTION,l)}},h.prototype.abort=function(){var _=this._ws;!_||_.readyState!==0&&_.readyState!==1||(this._requestAbort=!0,_.close()),this._ws=null,this._status=b.c.kComplete},h.prototype._onWebSocketOpen=function(_){this._status=b.c.kBuffering},h.prototype._onWebSocketClose=function(_){this._requestAbort!==!0?(this._status=b.c.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},h.prototype._onWebSocketMessage=function(_){var c=this;if(_.data instanceof ArrayBuffer)this._dispatchArrayBuffer(_.data);else if(_.data instanceof Blob){var l=new FileReader;l.onload=function(){c._dispatchArrayBuffer(l.result)},l.readAsArrayBuffer(_.data)}else{this._status=b.c.kError;var P={code:-1,msg:"Unsupported WebSocket message type: "+_.data.constructor.name};if(!this._onError)throw new f.d(P.msg);this._onError(b.b.EXCEPTION,P)}},h.prototype._dispatchArrayBuffer=function(_){var c=_,l=this._receivedLength;this._receivedLength+=c.byteLength,this._onDataArrival&&this._onDataArrival(c,l,this._receivedLength)},h.prototype._onWebSocketError=function(_){this._status=b.c.kError;var c={code:_.code,msg:_.message};if(!this._onError)throw new f.d(c.msg);this._onError(b.b.EXCEPTION,c)},h}(b.a),re=function(){function w(h){this._zeroStart=h||!1}return w.prototype.getConfig=function(h,_){var c={};if(_.from!==0||_.to!==-1){var l=void 0;l=_.to!==-1?"bytes="+_.from.toString()+"-"+_.to.toString():"bytes="+_.from.toString()+"-",c.Range=l}else this._zeroStart&&(c.Range="bytes=0-");return{url:h,headers:c}},w.prototype.removeURLParameters=function(h){return h},w}(),y=function(){function w(h,_){this._startName=h,this._endName=_}return w.prototype.getConfig=function(h,_){var c=h;if(_.from!==0||_.to!==-1){var l=!0;c.indexOf("?")===-1&&(c+="?",l=!1),l&&(c+="&"),c+=this._startName+"="+_.from.toString(),_.to!==-1&&(c+="&"+this._endName+"="+_.to.toString())}return{url:c,headers:{}}},w.prototype.removeURLParameters=function(h){var _=h.split("?")[0],c=void 0,l=h.indexOf("?");l!==-1&&(c=h.substring(l+1));var P="";if(c!=null&&c.length>0)for(var D=c.split("&"),F=0;F<D.length;F++){var ee=D[F].split("="),fe=F>0;ee[0]!==this._startName&&ee[0]!==this._endName&&(fe&&(P+="&"),P+=D[F])}return P.length===0?_:_+"?"+P},w}(),G=function(){function w(h,_,c){this.TAG="IOController",this._config=_,this._extraData=c,this._stashInitialSize=65536,_.stashInitialSize!=null&&_.stashInitialSize>0&&(this._stashInitialSize=_.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=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=h,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(h.url),this._refTotalLength=h.filesize?h.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new m,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 w.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},w.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},w.prototype.isPaused=function(){return this._paused},Object.defineProperty(w.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"extraData",{get:function(){return this._extraData},set:function(h){this._extraData=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(h){this._onDataArrival=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(h){this._onSeeked=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onError",{get:function(){return this._onError},set:function(h){this._onError=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onComplete",{get:function(){return this._onComplete},set:function(h){this._onComplete=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(h){this._onRedirect=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(h){this._onRecoveredEarlyEof=h},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentSpeed",{get:function(){return this._loaderClass===he?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),w.prototype._selectSeekHandler=function(){var h=this._config;if(h.seekType==="range")this._seekHandler=new re(this._config.rangeLoadZeroStart);else if(h.seekType==="param"){var _=h.seekParamStart||"bstart",c=h.seekParamEnd||"bend";this._seekHandler=new y(_,c)}else{if(h.seekType!=="custom")throw new f.b("Invalid seekType in config: "+h.seekType);if(typeof h.customSeekHandler!="function")throw new f.b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new h.customSeekHandler}},w.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=J;else if(x.isSupported())this._loaderClass=x;else if(j.isSupported())this._loaderClass=j;else{if(!he.isSupported())throw new f.d("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=he}},w.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)},w.prototype.open=function(h){this._currentRange={from:0,to:-1},h&&(this._currentRange.from=h),this._speedSampler.reset(),h||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},w.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},w.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)},w.prototype.resume=function(){if(this._paused){this._paused=!1;var h=this._resumeFrom;this._resumeFrom=0,this._internalSeek(h,!0)}},w.prototype.seek=function(h){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(h,!0)},w.prototype._internalSeek=function(h,_){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(_),this._loader.destroy(),this._loader=null;var c={from:h,to:-1};this._currentRange={from:c.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,c),this._onSeeked&&this._onSeeked()},w.prototype.updateUrl=function(h){if(!h||typeof h!="string"||h.length===0)throw new f.b("Url must be a non-empty string!");this._dataSource.url=h},w.prototype._expandBuffer=function(h){for(var _=this._stashSize;_+1048576<h;)_*=2;if((_+=1048576)!==this._bufferSize){var c=new ArrayBuffer(_);if(this._stashUsed>0){var l=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(c,0,_).set(l,0)}this._stashBuffer=c,this._bufferSize=_}},w.prototype._normalizeSpeed=function(h){var _=this._speedNormalizeList,c=_.length-1,l=0,P=0,D=c;if(h<_[0])return _[0];for(;P<=D;){if((l=P+Math.floor((D-P)/2))===c||h>=_[l]&&h<_[l+1])return _[l];_[l]<h?P=l+1:D=l-1}},w.prototype._adjustStashSize=function(h){var _=0;(_=this._config.isLive?h/8:h<512?h:h>=512&&h<=1024?Math.floor(1.5*h):2*h)>8192&&(_=8192);var c=1024*_+1048576;this._bufferSize<c&&this._expandBuffer(c),this._stashSize=1024*_},w.prototype._dispatchChunks=function(h,_){return this._currentRange.to=_+h.byteLength-1,this._onDataArrival(h,_)},w.prototype._onURLRedirect=function(h){this._redirectedURL=h,this._onRedirect&&this._onRedirect(h)},w.prototype._onContentLengthKnown=function(h){h&&this._fullRequestFlag&&(this._totalLength=h,this._fullRequestFlag=!1)},w.prototype._onLoaderChunkArrival=function(h,_,c){if(!this._onDataArrival)throw new f.a("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(h.byteLength);var l=this._speedSampler.lastSecondKBps;if(l!==0){var P=this._normalizeSpeed(l);this._speedNormalized!==P&&(this._speedNormalized=P,this._adjustStashSize(P))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=_),this._stashUsed+h.byteLength<=this._stashSize)(ee=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(h),this._stashUsed),this._stashUsed+=h.byteLength;else if(ee=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var D=this._stashBuffer.slice(0,this._stashUsed);(fe=this._dispatchChunks(D,this._stashByteStart))<D.byteLength?fe>0&&(ve=new Uint8Array(D,fe),ee.set(ve,0),this._stashUsed=ve.byteLength,this._stashByteStart+=fe):(this._stashUsed=0,this._stashByteStart+=fe),this._stashUsed+h.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+h.byteLength),ee=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ee.set(new Uint8Array(h),this._stashUsed),this._stashUsed+=h.byteLength}else(fe=this._dispatchChunks(h,_))<h.byteLength&&((F=h.byteLength-fe)>this._bufferSize&&(this._expandBuffer(F),ee=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ee.set(new Uint8Array(h,fe),0),this._stashUsed+=F,this._stashByteStart=_+fe);else if(this._stashUsed===0){var F;(fe=this._dispatchChunks(h,_))<h.byteLength&&((F=h.byteLength-fe)>this._bufferSize&&this._expandBuffer(F),(ee=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(h,fe),0),this._stashUsed+=F,this._stashByteStart=_+fe)}else{var ee,fe;if(this._stashUsed+h.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+h.byteLength),(ee=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(h),this._stashUsed),this._stashUsed+=h.byteLength,(fe=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&fe>0){var ve=new Uint8Array(this._stashBuffer,fe);ee.set(ve,0)}this._stashUsed-=fe,this._stashByteStart+=fe}}},w.prototype._flushStashBuffer=function(h){if(this._stashUsed>0){var _=this._stashBuffer.slice(0,this._stashUsed),c=this._dispatchChunks(_,this._stashByteStart),l=_.byteLength-c;if(c<_.byteLength){if(!h){if(c>0){var P=new Uint8Array(this._stashBuffer,0,this._bufferSize),D=new Uint8Array(_,c);P.set(D,0),this._stashUsed=D.byteLength,this._stashByteStart+=c}return 0}I.a.w(this.TAG,l+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,l}return 0},w.prototype._onLoaderComplete=function(h,_){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},w.prototype._onLoaderError=function(h,_){switch(I.a.e(this.TAG,"Loader error, code = "+_.code+", msg = "+_.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,h=b.b.UNRECOVERABLE_EARLY_EOF),h){case b.b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var c=this._currentRange.to+1;return void(c<this._totalLength&&(I.a.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(c,!1)))}h=b.b.UNRECOVERABLE_EARLY_EOF;break;case b.b.UNRECOVERABLE_EARLY_EOF:case b.b.CONNECTING_TIMEOUT:case b.b.HTTP_STATUS_CODE_INVALID:case b.b.EXCEPTION:}if(!this._onError)throw new f.d("IOException: "+_.msg);this._onError(h,_)},w}();Z.a=G},function(pe,Z,O){var N=function(){function I(){}return I.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},Object.assign=Object.assign||function(m){if(m==null)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(m),v=1;v<arguments.length;v++){var f=arguments[v];if(f!=null)for(var k in f)f.hasOwnProperty(k)&&(b[k]=f[k])}return b},typeof self.Promise!="function"&&O(15).polyfill()},I}();N.install(),Z.a=N},function(pe,Z,O){function N(v){var f={};function k(C){if(f[C])return f[C].exports;var j=f[C]={i:C,l:!1,exports:{}};return v[C].call(j.exports,j,j.exports,k),j.l=!0,j.exports}k.m=v,k.c=f,k.i=function(C){return C},k.d=function(C,j,H){k.o(C,j)||Object.defineProperty(C,j,{configurable:!1,enumerable:!0,get:H})},k.r=function(C){Object.defineProperty(C,"__esModule",{value:!0})},k.n=function(C){var j=C&&C.__esModule?function(){return C.default}:function(){return C};return k.d(j,"a",j),j},k.o=function(C,j){return Object.prototype.hasOwnProperty.call(C,j)},k.p="/",k.oe=function(C){throw console.error(C),C};var x=k(k.s=ENTRY_MODULE);return x.default||x}function I(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function m(v,f,k){var x={};x[k]=[];var C=f.toString(),j=C.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!j)return x;for(var H,he=j[1],de=new RegExp("(\\\\n|\\W)"+I(he)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");H=de.exec(C);)H[3]!=="dll-reference"&&x[k].push(H[3]);for(de=new RegExp("\\("+I(he)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");H=de.exec(C);)v[H[2]]||(x[k].push(H[1]),v[H[2]]=O(H[1]).m),x[H[2]]=x[H[2]]||[],x[H[2]].push(H[4]);for(var J,re=Object.keys(x),y=0;y<re.length;y++)for(var G=0;G<x[re[y]].length;G++)J=x[re[y]][G],isNaN(1*J)||(x[re[y]][G]=1*x[re[y]][G]);return x}function b(v){return Object.keys(v).reduce(function(f,k){return f||v[k].length>0},!1)}pe.exports=function(v,f){f=f||{};var k={main:O.m},x=f.all?{main:Object.keys(k.main)}:function(de,J){for(var re={main:[J]},y={main:[]},G={main:{}};b(re);)for(var w=Object.keys(re),h=0;h<w.length;h++){var _=w[h],c=re[_].pop();if(G[_]=G[_]||{},!G[_][c]&&de[_][c]){G[_][c]=!0,y[_]=y[_]||[],y[_].push(c);for(var l=m(de,de[_][c],_),P=Object.keys(l),D=0;D<P.length;D++)re[P[D]]=re[P[D]]||[],re[P[D]]=re[P[D]].concat(l[P[D]])}}return y}(k,v),C="";Object.keys(x).filter(function(de){return de!=="main"}).forEach(function(de){for(var J=0;x[de][J];)J++;x[de].push(J),k[de][J]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",C=C+"var "+de+" = ("+N.toString().replace("ENTRY_MODULE",JSON.stringify(J))+")({"+x[de].map(function(re){return JSON.stringify(re)+": "+k[de][re].toString()}).join(",")+`});
- `}),C=C+"new (("+N.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+x.main.map(function(de){return JSON.stringify(de)+": "+k.main[de].toString()}).join(",")+"}))(self);";var j=new window.Blob([C],{type:"text/javascript"});if(f.bare)return j;var H=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(j),he=new window.Worker(H);return he.objectURL=H,he}},function(pe,Z,O){pe.exports=O(19).default},function(pe,Z,O){(function(N,I){/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version v4.2.8+1e68dce6
- */var m;m=function(){function b(M){return typeof M=="function"}var v=Array.isArray?Array.isArray:function(M){return Object.prototype.toString.call(M)==="[object Array]"},f=0,k=void 0,x=void 0,C=function(M,V){y[f]=M,y[f+1]=V,(f+=2)===2&&(x?x(G):l())},j=typeof window<"u"?window:void 0,H=j||{},he=H.MutationObserver||H.WebKitMutationObserver,de=typeof self>"u"&&N!==void 0&&{}.toString.call(N)==="[object process]",J=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function re(){var M=setTimeout;return function(){return M(G,1)}}var y=new Array(1e3);function G(){for(var M=0;M<f;M+=2)(0,y[M])(y[M+1]),y[M]=void 0,y[M+1]=void 0;f=0}var w,h,_,c,l=void 0;function P(M,V){var $=this,ie=new this.constructor(ee);ie[F]===void 0&&Se(ie);var ne=$._state;if(ne){var le=arguments[ne-1];C(function(){return se(ne,ie,le,$._result)})}else R($,ie,M,V);return ie}function D(M){if(M&&typeof M=="object"&&M.constructor===this)return M;var V=new this(ee);return ve(V,M),V}de?l=function(){return N.nextTick(G)}:he?(h=0,_=new he(G),c=document.createTextNode(""),_.observe(c,{characterData:!0}),l=function(){c.data=h=++h%2}):J?((w=new MessageChannel).port1.onmessage=G,l=function(){return w.port2.postMessage(0)}):l=j===void 0?function(){try{var M=Function("return this")().require("vertx");return(k=M.runOnLoop||M.runOnContext)!==void 0?function(){k(G)}:re()}catch{return re()}}():re();var F=Math.random().toString(36).substring(2);function ee(){}function fe(M,V,$){V.constructor===M.constructor&&$===P&&V.constructor.resolve===D?function(ie,ne){ne._state===1?d(ie,ne._result):ne._state===2?u(ie,ne._result):R(ne,void 0,function(le){return ve(ie,le)},function(le){return u(ie,le)})}(M,V):$===void 0?d(M,V):b($)?function(ie,ne,le){C(function(we){var Ee=!1,Ie=function(Be,Je,Ze,$e){try{Be.call(Je,Ze,$e)}catch(Qe){return Qe}}(le,ne,function(Be){Ee||(Ee=!0,ne!==Be?ve(we,Be):d(we,Be))},function(Be){Ee||(Ee=!0,u(we,Be))},we._label);!Ee&&Ie&&(Ee=!0,u(we,Ie))},ie)}(M,V,$):d(M,V)}function ve(M,V){if(M===V)u(M,new TypeError("You cannot resolve a promise with itself"));else if(ne=typeof(ie=V),ie===null||ne!=="object"&&ne!=="function")d(M,V);else{var $=void 0;try{$=V.then}catch(le){return void u(M,le)}fe(M,V,$)}var ie,ne}function L(M){M._onerror&&M._onerror(M._result),X(M)}function d(M,V){M._state===void 0&&(M._result=V,M._state=1,M._subscribers.length!==0&&C(X,M))}function u(M,V){M._state===void 0&&(M._state=2,M._result=V,C(L,M))}function R(M,V,$,ie){var ne=M._subscribers,le=ne.length;M._onerror=null,ne[le]=V,ne[le+1]=$,ne[le+2]=ie,le===0&&M._state&&C(X,M)}function X(M){var V=M._subscribers,$=M._state;if(V.length!==0){for(var ie=void 0,ne=void 0,le=M._result,we=0;we<V.length;we+=3)ie=V[we],ne=V[we+$],ie?se($,ie,ne,le):ne(le);M._subscribers.length=0}}function se(M,V,$,ie){var ne=b($),le=void 0,we=void 0,Ee=!0;if(ne){try{le=$(ie)}catch(Ie){Ee=!1,we=Ie}if(V===le)return void u(V,new TypeError("A promises callback cannot return that same promise."))}else le=ie;V._state!==void 0||(ne&&Ee?ve(V,le):Ee===!1?u(V,we):M===1?d(V,le):M===2&&u(V,le))}var me=0;function Se(M){M[F]=me++,M._state=void 0,M._result=void 0,M._subscribers=[]}var De=function(){function M(V,$){this._instanceConstructor=V,this.promise=new V(ee),this.promise[F]||Se(this.promise),v($)?(this.length=$.length,this._remaining=$.length,this._result=new Array(this.length),this.length===0?d(this.promise,this._result):(this.length=this.length||0,this._enumerate($),this._remaining===0&&d(this.promise,this._result))):u(this.promise,new Error("Array Methods must be provided an Array"))}return M.prototype._enumerate=function(V){for(var $=0;this._state===void 0&&$<V.length;$++)this._eachEntry(V[$],$)},M.prototype._eachEntry=function(V,$){var ie=this._instanceConstructor,ne=ie.resolve;if(ne===D){var le=void 0,we=void 0,Ee=!1;try{le=V.then}catch(Be){Ee=!0,we=Be}if(le===P&&V._state!==void 0)this._settledAt(V._state,$,V._result);else if(typeof le!="function")this._remaining--,this._result[$]=V;else if(ie===Te){var Ie=new ie(ee);Ee?u(Ie,we):fe(Ie,V,le),this._willSettleAt(Ie,$)}else this._willSettleAt(new ie(function(Be){return Be(V)}),$)}else this._willSettleAt(ne(V),$)},M.prototype._settledAt=function(V,$,ie){var ne=this.promise;ne._state===void 0&&(this._remaining--,V===2?u(ne,ie):this._result[$]=ie),this._remaining===0&&d(ne,this._result)},M.prototype._willSettleAt=function(V,$){var ie=this;R(V,void 0,function(ne){return ie._settledAt(1,$,ne)},function(ne){return ie._settledAt(2,$,ne)})},M}(),Te=function(){function M(V){this[F]=me++,this._result=this._state=void 0,this._subscribers=[],ee!==V&&(typeof V!="function"&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof M?function($,ie){try{ie(function(ne){ve($,ne)},function(ne){u($,ne)})}catch(ne){u($,ne)}}(this,V):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return M.prototype.catch=function(V){return this.then(null,V)},M.prototype.finally=function(V){var $=this.constructor;return b(V)?this.then(function(ie){return $.resolve(V()).then(function(){return ie})},function(ie){return $.resolve(V()).then(function(){throw ie})}):this.then(V,V)},M}();return Te.prototype.then=P,Te.all=function(M){return new De(this,M).promise},Te.race=function(M){var V=this;return v(M)?new V(function($,ie){for(var ne=M.length,le=0;le<ne;le++)V.resolve(M[le]).then($,ie)}):new V(function($,ie){return ie(new TypeError("You must pass an array to race."))})},Te.resolve=D,Te.reject=function(M){var V=new this(ee);return u(V,M),V},Te._setScheduler=function(M){x=M},Te._setAsap=function(M){C=M},Te._asap=C,Te.polyfill=function(){var M=void 0;if(I!==void 0)M=I;else if(typeof self<"u")M=self;else try{M=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var V=M.Promise;if(V){var $=null;try{$=Object.prototype.toString.call(V.resolve())}catch{}if($==="[object Promise]"&&!V.cast)return}M.Promise=Te},Te.Promise=Te,Te},pe.exports=m()}).call(this,O(16),O(17))},function(pe,Z){var O,N,I=pe.exports={};function m(){throw new Error("setTimeout has not been defined")}function b(){throw new Error("clearTimeout has not been defined")}function v(J){if(O===setTimeout)return setTimeout(J,0);if((O===m||!O)&&setTimeout)return O=setTimeout,setTimeout(J,0);try{return O(J,0)}catch{try{return O.call(null,J,0)}catch{return O.call(this,J,0)}}}(function(){try{O=typeof setTimeout=="function"?setTimeout:m}catch{O=m}try{N=typeof clearTimeout=="function"?clearTimeout:b}catch{N=b}})();var f,k=[],x=!1,C=-1;function j(){x&&f&&(x=!1,f.length?k=f.concat(k):C=-1,k.length&&H())}function H(){if(!x){var J=v(j);x=!0;for(var re=k.length;re;){for(f=k,k=[];++C<re;)f&&f[C].run();C=-1,re=k.length}f=null,x=!1,function(y){if(N===clearTimeout)return clearTimeout(y);if((N===b||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(y);try{N(y)}catch{try{return N.call(null,y)}catch{return N.call(this,y)}}}(J)}}function he(J,re){this.fun=J,this.array=re}function de(){}I.nextTick=function(J){var re=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)re[y-1]=arguments[y];k.push(new he(J,re)),k.length!==1||x||v(H)},he.prototype.run=function(){this.fun.apply(null,this.array)},I.title="browser",I.browser=!0,I.env={},I.argv=[],I.version="",I.versions={},I.on=de,I.addListener=de,I.once=de,I.off=de,I.removeListener=de,I.removeAllListeners=de,I.emit=de,I.prependListener=de,I.prependOnceListener=de,I.listeners=function(J){return[]},I.binding=function(J){throw new Error("process.binding is not supported")},I.cwd=function(){return"/"},I.chdir=function(J){throw new Error("process.chdir is not supported")},I.umask=function(){return 0}},function(pe,Z){var O;O=function(){return this}();try{O=O||new Function("return this")()}catch{typeof window=="object"&&(O=window)}pe.exports=O},function(pe,Z,O){O.r(Z);var N=O(9),I=O(12),m=O(10),b=O(1);Z.default=function(v){var f=null,k=(function(D,F){v.postMessage({msg:"logcat_callback",data:{type:D,logcat:F}})}).bind(this);function x(D,F){var ee={msg:b.a.INIT_SEGMENT,data:{type:D,data:F}};v.postMessage(ee,[F.data])}function C(D,F){var ee={msg:b.a.MEDIA_SEGMENT,data:{type:D,data:F}};v.postMessage(ee,[F.data])}function j(){var D={msg:b.a.LOADING_COMPLETE};v.postMessage(D)}function H(){var D={msg:b.a.RECOVERED_EARLY_EOF};v.postMessage(D)}function he(D){var F={msg:b.a.MEDIA_INFO,data:D};v.postMessage(F)}function de(D){var F={msg:b.a.METADATA_ARRIVED,data:D};v.postMessage(F)}function J(D){var F={msg:b.a.SCRIPTDATA_ARRIVED,data:D};v.postMessage(F)}function re(D){var F={msg:b.a.TIMED_ID3_METADATA_ARRIVED,data:D};v.postMessage(F)}function y(D){var F={msg:b.a.SMPTE2038_METADATA_ARRIVED,data:D};v.postMessage(F)}function G(D){var F={msg:b.a.SCTE35_METADATA_ARRIVED,data:D};v.postMessage(F)}function w(D){var F={msg:b.a.PES_PRIVATE_DATA_DESCRIPTOR,data:D};v.postMessage(F)}function h(D){var F={msg:b.a.PES_PRIVATE_DATA_ARRIVED,data:D};v.postMessage(F)}function _(D){var F={msg:b.a.STATISTICS_INFO,data:D};v.postMessage(F)}function c(D,F){v.postMessage({msg:b.a.IO_ERROR,data:{type:D,info:F}})}function l(D,F){v.postMessage({msg:b.a.DEMUX_ERROR,data:{type:D,info:F}})}function P(D){v.postMessage({msg:b.a.RECOMMEND_SEEKPOINT,data:D})}I.a.install(),v.addEventListener("message",function(D){switch(D.data.cmd){case"init":(f=new m.a(D.data.param[0],D.data.param[1])).on(b.a.IO_ERROR,c.bind(this)),f.on(b.a.DEMUX_ERROR,l.bind(this)),f.on(b.a.INIT_SEGMENT,x.bind(this)),f.on(b.a.MEDIA_SEGMENT,C.bind(this)),f.on(b.a.LOADING_COMPLETE,j.bind(this)),f.on(b.a.RECOVERED_EARLY_EOF,H.bind(this)),f.on(b.a.MEDIA_INFO,he.bind(this)),f.on(b.a.METADATA_ARRIVED,de.bind(this)),f.on(b.a.SCRIPTDATA_ARRIVED,J.bind(this)),f.on(b.a.TIMED_ID3_METADATA_ARRIVED,re.bind(this)),f.on(b.a.SMPTE2038_METADATA_ARRIVED,y.bind(this)),f.on(b.a.SCTE35_METADATA_ARRIVED,G.bind(this)),f.on(b.a.PES_PRIVATE_DATA_DESCRIPTOR,w.bind(this)),f.on(b.a.PES_PRIVATE_DATA_ARRIVED,h.bind(this)),f.on(b.a.STATISTICS_INFO,_.bind(this)),f.on(b.a.RECOMMEND_SEEKPOINT,P.bind(this));break;case"destroy":f&&(f.destroy(),f=null),v.postMessage({msg:"destroyed"});break;case"start":f.start();break;case"stop":f.stop();break;case"seek":f.seek(D.data.param);break;case"pause":f.pause();break;case"resume":f.resume();break;case"logging_config":var F=D.data.param;N.a.applyConfig(F),F.enableCallback===!0?N.a.addLogListener(k):N.a.removeLogListener(k)}})}},function(pe,Z,O){O.r(Z);var N=O(12),I=O(11),m={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,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 b(){return Object.assign({},m)}var v=function(){function L(){}return L.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},L.supportMSEH265Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},L.supportNetworkStreamIO=function(){var d=new I.a({},b()),u=d.loaderType;return d.destroy(),u=="fetch-stream-loader"||u=="xhr-moz-chunked-loader"},L.getNetworkLoaderTypeName=function(){var d=new I.a({},b()),u=d.loaderType;return d.destroy(),u},L.supportNativeMediaPlayback=function(d){L.videoElement==null&&(L.videoElement=window.document.createElement("video"));var u=L.videoElement.canPlayType(d);return u==="probably"||u=="maybe"},L.getFeatureList=function(){var d={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return d.msePlayback=L.supportMSEH264Playback(),d.networkStreamIO=L.supportNetworkStreamIO(),d.networkLoaderName=L.getNetworkLoaderTypeName(),d.mseLivePlayback=d.msePlayback&&d.networkStreamIO,d.mseH265Playback=L.supportMSEH265Playback(),d.nativeMP4H264Playback=L.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),d.nativeMP4H265Playback=L.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),d.nativeWebmVP8Playback=L.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),d.nativeWebmVP9Playback=L.supportNativeMediaPlayback('video/webm; codecs="vp9"'),d},L}(),f=O(2),k=O(6),x=O.n(k),C=O(0),j=O(4),H={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info"},he=O(13),de=O.n(he),J=O(9),re=O(10),y=O(1),G=O(8),w=function(){function L(d,u){if(this.TAG="Transmuxer",this._emitter=new x.a,u.enableWorker&&typeof Worker<"u")try{this._worker=de()(18),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[d,u]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},J.a.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:J.a.getConfig()})}catch{C.a.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new re.a(d,u)}else this._controller=new re.a(d,u);if(this._controller){var R=this._controller;R.on(y.a.IO_ERROR,this._onIOError.bind(this)),R.on(y.a.DEMUX_ERROR,this._onDemuxError.bind(this)),R.on(y.a.INIT_SEGMENT,this._onInitSegment.bind(this)),R.on(y.a.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),R.on(y.a.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),R.on(y.a.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),R.on(y.a.MEDIA_INFO,this._onMediaInfo.bind(this)),R.on(y.a.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),R.on(y.a.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),R.on(y.a.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),R.on(y.a.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),R.on(y.a.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),R.on(y.a.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),R.on(y.a.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),R.on(y.a.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),R.on(y.a.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return L.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),J.a.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},L.prototype.on=function(d,u){this._emitter.addListener(d,u)},L.prototype.off=function(d,u){this._emitter.removeListener(d,u)},L.prototype.hasWorker=function(){return this._worker!=null},L.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},L.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},L.prototype.seek=function(d){this._worker?this._worker.postMessage({cmd:"seek",param:d}):this._controller.seek(d)},L.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},L.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},L.prototype._onInitSegment=function(d,u){var R=this;Promise.resolve().then(function(){R._emitter.emit(y.a.INIT_SEGMENT,d,u)})},L.prototype._onMediaSegment=function(d,u){var R=this;Promise.resolve().then(function(){R._emitter.emit(y.a.MEDIA_SEGMENT,d,u)})},L.prototype._onLoadingComplete=function(){var d=this;Promise.resolve().then(function(){d._emitter.emit(y.a.LOADING_COMPLETE)})},L.prototype._onRecoveredEarlyEof=function(){var d=this;Promise.resolve().then(function(){d._emitter.emit(y.a.RECOVERED_EARLY_EOF)})},L.prototype._onMediaInfo=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.MEDIA_INFO,d)})},L.prototype._onMetaDataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.METADATA_ARRIVED,d)})},L.prototype._onScriptDataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.SCRIPTDATA_ARRIVED,d)})},L.prototype._onTimedID3MetadataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.TIMED_ID3_METADATA_ARRIVED,d)})},L.prototype._onSMPTE2038MetadataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.SMPTE2038_METADATA_ARRIVED,d)})},L.prototype._onSCTE35MetadataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.SCTE35_METADATA_ARRIVED,d)})},L.prototype._onPESPrivateDataDescriptor=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.PES_PRIVATE_DATA_DESCRIPTOR,d)})},L.prototype._onPESPrivateDataArrived=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.PES_PRIVATE_DATA_ARRIVED,d)})},L.prototype._onStatisticsInfo=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.STATISTICS_INFO,d)})},L.prototype._onIOError=function(d,u){var R=this;Promise.resolve().then(function(){R._emitter.emit(y.a.IO_ERROR,d,u)})},L.prototype._onDemuxError=function(d,u){var R=this;Promise.resolve().then(function(){R._emitter.emit(y.a.DEMUX_ERROR,d,u)})},L.prototype._onRecommendSeekpoint=function(d){var u=this;Promise.resolve().then(function(){u._emitter.emit(y.a.RECOMMEND_SEEKPOINT,d)})},L.prototype._onLoggingConfigChanged=function(d){this._worker&&this._worker.postMessage({cmd:"logging_config",param:d})},L.prototype._onWorkerMessage=function(d){var u=d.data,R=u.data;if(u.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(u.msg){case y.a.INIT_SEGMENT:case y.a.MEDIA_SEGMENT:this._emitter.emit(u.msg,R.type,R.data);break;case y.a.LOADING_COMPLETE:case y.a.RECOVERED_EARLY_EOF:this._emitter.emit(u.msg);break;case y.a.MEDIA_INFO:Object.setPrototypeOf(R,G.a.prototype),this._emitter.emit(u.msg,R);break;case y.a.METADATA_ARRIVED:case y.a.SCRIPTDATA_ARRIVED:case y.a.TIMED_ID3_METADATA_ARRIVED:case y.a.SMPTE2038_METADATA_ARRIVED:case y.a.SCTE35_METADATA_ARRIVED:case y.a.PES_PRIVATE_DATA_DESCRIPTOR:case y.a.PES_PRIVATE_DATA_ARRIVED:case y.a.STATISTICS_INFO:this._emitter.emit(u.msg,R);break;case y.a.IO_ERROR:case y.a.DEMUX_ERROR:this._emitter.emit(u.msg,R.type,R.info);break;case y.a.RECOMMEND_SEEKPOINT:this._emitter.emit(u.msg,R);break;case"logcat_callback":C.a.emitter.emit("log",R.type,R.logcat)}},L}(),h={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},_=O(7),c=O(3),l=function(){function L(d){this.TAG="MSEController",this._config=d,this._emitter=new x.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),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=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:[]},this._idrList=new _.a}return L.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},L.prototype.on=function(d,u){this._emitter.addListener(d,u)},L.prototype.off=function(d,u){this._emitter.removeListener(d,u)},L.prototype.attachMediaElement=function(d){if(this._mediaSource)throw new c.a("MediaSource has been attached to an HTMLMediaElement!");var u=this._mediaSource=new window.MediaSource;u.addEventListener("sourceopen",this.e.onSourceOpen),u.addEventListener("sourceended",this.e.onSourceEnded),u.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=d,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),d.src=this._mediaSourceObjectURL},L.prototype.detachMediaElement=function(){if(this._mediaSource){var d=this._mediaSource;for(var u in this._sourceBuffers){var R=this._pendingSegments[u];R.splice(0,R.length),this._pendingSegments[u]=null,this._pendingRemoveRanges[u]=null,this._lastInitSegments[u]=null;var X=this._sourceBuffers[u];if(X){if(d.readyState!=="closed"){try{d.removeSourceBuffer(X)}catch(se){C.a.e(this.TAG,se.message)}X.removeEventListener("error",this.e.onSourceBufferError),X.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[u]=null,this._sourceBuffers[u]=null}}if(d.readyState==="open")try{d.endOfStream()}catch(se){C.a.e(this.TAG,se.message)}d.removeEventListener("sourceopen",this.e.onSourceOpen),d.removeEventListener("sourceended",this.e.onSourceEnded),d.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},L.prototype.appendInitSegment=function(d,u){if(!this._mediaSource||this._mediaSource.readyState!=="open")return this._pendingSourceBufferInit.push(d),void this._pendingSegments[d.type].push(d);var R=d,X=""+R.container;R.codec&&R.codec.length>0&&(X+=";codecs="+R.codec);var se=!1;if(C.a.v(this.TAG,"Received Initialization Segment, mimeType: "+X),this._lastInitSegments[R.type]=R,X!==this._mimeTypes[R.type]){if(this._mimeTypes[R.type])C.a.v(this.TAG,"Notice: "+R.type+" mimeType changed, origin: "+this._mimeTypes[R.type]+", target: "+X);else{se=!0;try{var me=this._sourceBuffers[R.type]=this._mediaSource.addSourceBuffer(X);me.addEventListener("error",this.e.onSourceBufferError),me.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Se){return C.a.e(this.TAG,Se.message),void this._emitter.emit(h.ERROR,{code:Se.code,msg:Se.message})}}this._mimeTypes[R.type]=X}u||this._pendingSegments[R.type].push(R),se||this._sourceBuffers[R.type]&&!this._sourceBuffers[R.type].updating&&this._doAppendSegments(),j.a.safari&&R.container==="audio/mpeg"&&R.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=R.mediaDuration/1e3,this._updateMediaSourceDuration())},L.prototype.appendMediaSegment=function(d){var u=d;this._pendingSegments[u.type].push(u),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var R=this._sourceBuffers[u.type];!R||R.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},L.prototype.seek=function(d){for(var u in this._sourceBuffers)if(this._sourceBuffers[u]){var R=this._sourceBuffers[u];if(this._mediaSource.readyState==="open")try{R.abort()}catch(Te){C.a.e(this.TAG,Te.message)}this._idrList.clear();var X=this._pendingSegments[u];if(X.splice(0,X.length),this._mediaSource.readyState!=="closed"){for(var se=0;se<R.buffered.length;se++){var me=R.buffered.start(se),Se=R.buffered.end(se);this._pendingRemoveRanges[u].push({start:me,end:Se})}if(R.updating||this._doRemoveRanges(),j.a.safari){var De=this._lastInitSegments[u];De&&(this._pendingSegments[u].push(De),R.updating||this._doAppendSegments())}}}},L.prototype.endOfStream=function(){var d=this._mediaSource,u=this._sourceBuffers;d&&d.readyState==="open"?u.video&&u.video.updating||u.audio&&u.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,d.endOfStream()):d&&d.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},L.prototype.getNearestKeyframe=function(d){return this._idrList.getLastSyncPointBeforeDts(d)},L.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var d=this._mediaElement.currentTime;for(var u in this._sourceBuffers){var R=this._sourceBuffers[u];if(R){var X=R.buffered;if(X.length>=1&&d-X.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},L.prototype._doCleanupSourceBuffer=function(){var d=this._mediaElement.currentTime;for(var u in this._sourceBuffers){var R=this._sourceBuffers[u];if(R){for(var X=R.buffered,se=!1,me=0;me<X.length;me++){var Se=X.start(me),De=X.end(me);if(Se<=d&&d<De+3){if(d-Se>=this._config.autoCleanupMaxBackwardDuration){se=!0;var Te=d-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[u].push({start:Se,end:Te})}}else De<d&&(se=!0,this._pendingRemoveRanges[u].push({start:Se,end:De}))}se&&!R.updating&&this._doRemoveRanges()}}},L.prototype._updateMediaSourceDuration=function(){var d=this._sourceBuffers;if(this._mediaElement.readyState!==0&&this._mediaSource.readyState==="open"&&!(d.video&&d.video.updating||d.audio&&d.audio.updating)){var u=this._mediaSource.duration,R=this._pendingMediaDuration;R>0&&(isNaN(u)||R>u)&&(C.a.v(this.TAG,"Update MediaSource duration from "+u+" to "+R),this._mediaSource.duration=R),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},L.prototype._doRemoveRanges=function(){for(var d in this._pendingRemoveRanges)if(this._sourceBuffers[d]&&!this._sourceBuffers[d].updating)for(var u=this._sourceBuffers[d],R=this._pendingRemoveRanges[d];R.length&&!u.updating;){var X=R.shift();u.remove(X.start,X.end)}},L.prototype._doAppendSegments=function(){var d=this._pendingSegments;for(var u in d)if(this._sourceBuffers[u]&&!this._sourceBuffers[u].updating&&d[u].length>0){var R=d[u].shift();if(R.timestampOffset){var X=this._sourceBuffers[u].timestampOffset,se=R.timestampOffset/1e3;Math.abs(X-se)>.1&&(C.a.v(this.TAG,"Update MPEG audio timestampOffset from "+X+" to "+se),this._sourceBuffers[u].timestampOffset=se),delete R.timestampOffset}if(!R.data||R.data.byteLength===0)continue;try{this._sourceBuffers[u].appendBuffer(R.data),this._isBufferFull=!1,u==="video"&&R.hasOwnProperty("info")&&this._idrList.appendArray(R.info.syncPoints)}catch(me){this._pendingSegments[u].unshift(R),me.code===22?(this._isBufferFull||this._emitter.emit(h.BUFFER_FULL),this._isBufferFull=!0):(C.a.e(this.TAG,me.message),this._emitter.emit(h.ERROR,{code:me.code,msg:me.message}))}}},L.prototype._onSourceOpen=function(){if(C.a.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var d=this._pendingSourceBufferInit;d.length;){var u=d.shift();this.appendInitSegment(u,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(h.SOURCE_OPEN)},L.prototype._onSourceEnded=function(){C.a.v(this.TAG,"MediaSource onSourceEnded")},L.prototype._onSourceClose=function(){C.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))},L.prototype._hasPendingSegments=function(){var d=this._pendingSegments;return d.video.length>0||d.audio.length>0},L.prototype._hasPendingRemoveRanges=function(){var d=this._pendingRemoveRanges;return d.video.length>0||d.audio.length>0},L.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(h.UPDATE_END)},L.prototype._onSourceBufferError=function(d){C.a.e(this.TAG,"SourceBuffer Error: "+d)},L}(),P=O(5),D={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},F={NETWORK_EXCEPTION:f.b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:f.b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:f.b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:f.b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:P.a.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:P.a.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:P.a.CODEC_UNSUPPORTED},ee=function(){function L(d,u){this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new x.a,this._config=b(),typeof u=="object"&&Object.assign(this._config,u);var R=d.type.toLowerCase();if(R!=="mse"&&R!=="mpegts"&&R!=="m2ts"&&R!=="flv")throw new c.b("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");d.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=d,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var X=j.a.chrome&&(j.a.version.major<50||j.a.version.major===50&&j.a.version.build<2661);this._alwaysSeekKeyframe=!!(X||j.a.msedge||j.a.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return L.prototype.destroy=function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},L.prototype.on=function(d,u){var R=this;d===H.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){R._emitter.emit(H.MEDIA_INFO,R.mediaInfo)}):d===H.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){R._emitter.emit(H.STATISTICS_INFO,R.statisticsInfo)}),this._emitter.addListener(d,u)},L.prototype.off=function(d,u){this._emitter.removeListener(d,u)},L.prototype.attachMediaElement=function(d){var u=this;if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),d.addEventListener("seeking",this.e.onvSeeking),d.addEventListener("canplay",this.e.onvCanPlay),d.addEventListener("stalled",this.e.onvStalled),d.addEventListener("progress",this.e.onvProgress),this._msectl=new l(this._config),this._msectl.on(h.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(h.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(h.SOURCE_OPEN,function(){u._mseSourceOpened=!0,u._hasPendingLoad&&(u._hasPendingLoad=!1,u.load())}),this._msectl.on(h.ERROR,function(R){u._emitter.emit(H.ERROR,D.MEDIA_ERROR,F.MEDIA_MSE_ERROR,R)}),this._msectl.attachMediaElement(d),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},L.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},L.prototype.load=function(){var d=this;if(!this._mediaElement)throw new c.a("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new c.a("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new w(this._mediaDataSource,this._config),this._transmuxer.on(y.a.INIT_SEGMENT,function(u,R){d._msectl.appendInitSegment(R)}),this._transmuxer.on(y.a.MEDIA_SEGMENT,function(u,R){if(d._msectl.appendMediaSegment(R),d._config.lazyLoad&&!d._config.isLive){var X=d._mediaElement.currentTime;R.info.endDts>=1e3*(X+d._config.lazyLoadMaxDuration)&&d._progressChecker==null&&(C.a.v(d.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),d._suspendTransmuxer())}}),this._transmuxer.on(y.a.LOADING_COMPLETE,function(){d._msectl.endOfStream(),d._emitter.emit(H.LOADING_COMPLETE)}),this._transmuxer.on(y.a.RECOVERED_EARLY_EOF,function(){d._emitter.emit(H.RECOVERED_EARLY_EOF)}),this._transmuxer.on(y.a.IO_ERROR,function(u,R){d._emitter.emit(H.ERROR,D.NETWORK_ERROR,u,R)}),this._transmuxer.on(y.a.DEMUX_ERROR,function(u,R){d._emitter.emit(H.ERROR,D.MEDIA_ERROR,u,{code:-1,msg:R})}),this._transmuxer.on(y.a.MEDIA_INFO,function(u){d._mediaInfo=u,d._emitter.emit(H.MEDIA_INFO,Object.assign({},u))}),this._transmuxer.on(y.a.METADATA_ARRIVED,function(u){d._emitter.emit(H.METADATA_ARRIVED,u)}),this._transmuxer.on(y.a.SCRIPTDATA_ARRIVED,function(u){d._emitter.emit(H.SCRIPTDATA_ARRIVED,u)}),this._transmuxer.on(y.a.TIMED_ID3_METADATA_ARRIVED,function(u){d._emitter.emit(H.TIMED_ID3_METADATA_ARRIVED,u)}),this._transmuxer.on(y.a.SMPTE2038_METADATA_ARRIVED,function(u){d._emitter.emit(H.SMPTE2038_METADATA_ARRIVED,u)}),this._transmuxer.on(y.a.SCTE35_METADATA_ARRIVED,function(u){d._emitter.emit(H.SCTE35_METADATA_ARRIVED,u)}),this._transmuxer.on(y.a.PES_PRIVATE_DATA_DESCRIPTOR,function(u){d._emitter.emit(H.PES_PRIVATE_DATA_DESCRIPTOR,u)}),this._transmuxer.on(y.a.PES_PRIVATE_DATA_ARRIVED,function(u){d._emitter.emit(H.PES_PRIVATE_DATA_ARRIVED,u)}),this._transmuxer.on(y.a.STATISTICS_INFO,function(u){d._statisticsInfo=d._fillStatisticsInfo(u),d._emitter.emit(H.STATISTICS_INFO,Object.assign({},d._statisticsInfo))}),this._transmuxer.on(y.a.RECOMMEND_SEEKPOINT,function(u){d._mediaElement&&!d._config.accurateSeek&&(d._requestSetTime=!0,d._mediaElement.currentTime=u/1e3)}),this._transmuxer.open()))},L.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},L.prototype.play=function(){return this._mediaElement.play()},L.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(L.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(d){this._mediaElement.volume=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(d){this._mediaElement.muted=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(d){this._mediaElement?this._internalSeek(d):this._pendingSeekTime=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),L.prototype._fillStatisticsInfo=function(d){if(d.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return d;var u=!0,R=0,X=0;if(this._mediaElement.getVideoPlaybackQuality){var se=this._mediaElement.getVideoPlaybackQuality();R=se.totalVideoFrames,X=se.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(R=this._mediaElement.webkitDecodedFrameCount,X=this._mediaElement.webkitDroppedFrameCount):u=!1;return u&&(d.decodedFrames=R,d.droppedFrames=X),d},L.prototype._onmseUpdateEnd=function(){var d=this._mediaElement.buffered,u=this._mediaElement.currentTime;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&d.length>0&&!this._mediaElement.paused){var R=d.end(d.length-1);if(R>this._config.liveBufferLatencyMaxLatency&&R-u>this._config.liveBufferLatencyMaxLatency){var X=R-this._config.liveBufferLatencyMinRemain;this.currentTime=X}}if(this._config.lazyLoad&&!this._config.isLive){for(var se=0,me=0;me<d.length;me++){var Se=d.start(me),De=d.end(me);if(Se<=u&&u<De){se=De;break}}se>=u+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(C.a.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},L.prototype._onmseBufferFull=function(){C.a.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},L.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},L.prototype._checkProgressAndResume=function(){for(var d=this._mediaElement.currentTime,u=this._mediaElement.buffered,R=!1,X=0;X<u.length;X++){var se=u.start(X),me=u.end(X);if(d>=se&&d<me){d>=me-this._config.lazyLoadRecoverDuration&&(R=!0);break}}R&&(window.clearInterval(this._progressChecker),this._progressChecker=null,R&&(C.a.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},L.prototype._isTimepointBuffered=function(d){for(var u=this._mediaElement.buffered,R=0;R<u.length;R++){var X=u.start(R),se=u.end(R);if(d>=X&&d<se)return!0}return!1},L.prototype._internalSeek=function(d){var u=this._isTimepointBuffered(d),R=!1,X=0;if(d<1&&this._mediaElement.buffered.length>0){var se=this._mediaElement.buffered.start(0);(se<1&&d<se||j.a.safari)&&(R=!0,X=j.a.safari?.1:se)}if(R)this._requestSetTime=!0,this._mediaElement.currentTime=X;else if(u){if(this._alwaysSeekKeyframe){var me=this._msectl.getNearestKeyframe(Math.floor(1e3*d));this._requestSetTime=!0,this._mediaElement.currentTime=me!=null?me.dts/1e3:d}else this._requestSetTime=!0,this._mediaElement.currentTime=d;this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(1e3*d)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d)},L.prototype._checkAndApplyUnbufferedSeekpoint=function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var d=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(d)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(1e3*d)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},L.prototype._checkAndResumeStuckPlayback=function(d){var u=this._mediaElement;if(d||!this._receivedCanPlay||u.readyState<2){var R=u.buffered;R.length>0&&u.currentTime<R.start(0)&&(C.a.w(this.TAG,"Playback seems stuck at "+u.currentTime+", seek to "+R.start(0)),this._requestSetTime=!0,this._mediaElement.currentTime=R.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)},L.prototype._onvLoadedMetadata=function(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)},L.prototype._onvSeeking=function(d){var u=this._mediaElement.currentTime,R=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(u<1&&R.length>0){var X=R.start(0);if(X<1&&u<X||j.a.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=j.a.safari?.1:X)}if(this._isTimepointBuffered(u)){if(this._alwaysSeekKeyframe){var se=this._msectl.getNearestKeyframe(Math.floor(1e3*u));se!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=se.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:u,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},L.prototype._onvCanPlay=function(d){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)},L.prototype._onvStalled=function(d){this._checkAndResumeStuckPlayback(!0)},L.prototype._onvProgress=function(d){this._checkAndResumeStuckPlayback()},L}(),fe=function(){function L(d,u){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new x.a,this._config=b(),typeof u=="object"&&Object.assign(this._config,u);var R=d.type.toLowerCase();if(R==="mse"||R==="mpegts"||R==="m2ts"||R==="flv")throw new c.b("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(d.hasOwnProperty("segments"))throw new c.b("NativePlayer("+d.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=d,this._mediaElement=null}return L.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},L.prototype.on=function(d,u){var R=this;d===H.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){R._emitter.emit(H.MEDIA_INFO,R.mediaInfo)}):d===H.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){R._emitter.emit(H.STATISTICS_INFO,R.statisticsInfo)}),this._emitter.addListener(d,u)},L.prototype.off=function(d,u){this._emitter.removeListener(d,u)},L.prototype.attachMediaElement=function(d){if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},L.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)},L.prototype.load=function(){if(!this._mediaElement)throw new c.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)},L.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},L.prototype.play=function(){return this._mediaElement.play()},L.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(L.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(d){this._mediaElement.volume=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(d){this._mediaElement.muted=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(d){this._mediaElement?this._mediaElement.currentTime=d:this._pendingSeekTime=d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"mediaInfo",{get:function(){var d={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(d.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(d.width=this._mediaElement.videoWidth,d.height=this._mediaElement.videoHeight)),d},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"statisticsInfo",{get:function(){var d={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return d;var u=!0,R=0,X=0;if(this._mediaElement.getVideoPlaybackQuality){var se=this._mediaElement.getVideoPlaybackQuality();R=se.totalVideoFrames,X=se.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(R=this._mediaElement.webkitDecodedFrameCount,X=this._mediaElement.webkitDroppedFrameCount):u=!1;return u&&(d.decodedFrames=R,d.droppedFrames=X),d},enumerable:!1,configurable:!0}),L.prototype._onvLoadedMetadata=function(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(H.MEDIA_INFO,this.mediaInfo)},L.prototype._reportStatisticsInfo=function(){this._emitter.emit(H.STATISTICS_INFO,this.statisticsInfo)},L}();N.a.install();var ve={createPlayer:function(L,d){var u=L;if(u==null||typeof u!="object")throw new c.b("MediaDataSource must be an javascript object!");if(!u.hasOwnProperty("type"))throw new c.b("MediaDataSource must has type field to indicate video file type!");switch(u.type){case"mse":case"mpegts":case"m2ts":case"flv":return new ee(u,d);default:return new fe(u,d)}},isSupported:function(){return v.supportMSEH264Playback()},getFeatureList:function(){return v.getFeatureList()}};ve.BaseLoader=f.a,ve.LoaderStatus=f.c,ve.LoaderErrors=f.b,ve.Events=H,ve.ErrorTypes=D,ve.ErrorDetails=F,ve.MSEPlayer=ee,ve.NativePlayer=fe,ve.LoggingControl=J.a,Object.defineProperty(ve,"version",{enumerable:!0,get:function(){return"1.7.3"}}),Z.default=ve}])})})(vt);var yt=vt.exports;const qt=zt(yt),Wt=Ht({__proto__:null,default:qt},[yt]);export{Wt as m};
|