import{p as zt}from"./index-DT8qTvyx.js";function Ht(ze,Ye){for(var pe=0;peZ[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;P0&&(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=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=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[j].dts&&fk[C].lastSample.originalDts&&f=k[C].lastSample.originalDts&&(C===k.length-1||C0&&(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[k]&&b0){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=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);r32)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<>>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=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;Y0&&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=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;te0)for(te=p;te<8;te++)e.readBits(2);for(te=0;te1&&e.readSEG(),te=0;te0&&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>>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);et.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>>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>>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;T1&&m.a.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+ce),S++,T=0;T=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){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=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.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=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=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>>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;T0){for(var q=T+5;q1&&(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>>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>>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>>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>>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>>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=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=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;te1&&(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=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;oe0)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;i0&&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._receivedLength299)){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&&(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[P]&&_=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._receivedLength0&&this._receivedLength0)for(var D=c.split("&"),F=0;F0;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;_+10485760){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]=512&&h<=1024?Math.floor(1.5*h):2*h)>8192&&(_=8192);var c=1024*_+1048576;this._bufferSize0){var D=this._stashBuffer.slice(0,this._stashUsed);(fe=this._dispatchChunks(D,this._stashByteStart))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,_))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,_))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))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(c0},!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"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;M1)for(var y=1;y0&&(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=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=this._config.autoCleanupMaxBackwardDuration){se=!0;var Te=d-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[u].push({start:Se,end:Te})}}else De0&&(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=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=se&&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=X&&d0){var se=this._mediaElement.buffered.start(0);(se<1&&d0&&u.currentTime0){var X=R.start(0);if(X<1&&u0&&(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};