jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
1 lines • 219 kB
JavaScript
import{g as zt}from"../sdk.js";function Ht(ze,Ye){for(var pe=0;pe<Ye.length;pe++){const Z=Ye[pe];if(typeof Z!="string"&&!Array.isArray(Z)){for(const O in Z)if(O!=="default"&&!(O in ze)){const N=Object.getOwnPropertyDescriptor(Z,O);N&&Object.defineProperty(ze,O,N.get?N:{enumerable:!0,get:()=>Z[O]})}}}return Object.freeze(Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"}))}var vt={exports:{}};(function(ze,Ye){(function(pe,Z){ze.exports=Z()})(window,function(){return function(pe){var Z={};function O(N){if(Z[N])return Z[N].exports;var I=Z[N]={i:N,l:!1,exports:{}};return pe[N].call(I.exports,I,I.exports,O),I.l=!0,I.exports}return O.m=pe,O.c=Z,O.d=function(N,I,m){O.o(N,I)||Object.defineProperty(N,I,{enumerable:!0,get:m})},O.r=function(N){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},O.t=function(N,I){if(1&I&&(N=O(N)),8&I||4&I&&typeof N=="object"&&N&&N.__esModule)return N;var m=Object.create(null);if(O.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:N}),2&I&&typeof N!="string")for(var b in N)O.d(m,b,(function(v){return N[v]}).bind(null,b));return m},O.n=function(N){var I=N&&N.__esModule?function(){return N.default}:function(){return N};return O.d(I,"a",I),I},O.o=function(N,I){return Object.prototype.hasOwnProperty.call(N,I)},O.p="",O(O.s=14)}([function(pe,Z,O){var N=O(6),I=O.n(N),m=function(){function b(){}return b.e=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","error",k),b.ENABLE_ERROR&&(console.error?console.error(k):console.warn?console.warn(k):console.log(k))},b.i=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","info",k),b.ENABLE_INFO&&(console.info?console.info(k):console.log(k))},b.w=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","warn",k),b.ENABLE_WARN&&(console.warn?console.warn(k):console.log(k))},b.d=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","debug",k),b.ENABLE_DEBUG&&(console.debug?console.debug(k):console.log(k))},b.v=function(v,f){v&&!b.FORCE_GLOBAL_TAG||(v=b.GLOBAL_TAG);var k="["+v+"] > "+f;b.ENABLE_CALLBACK&&b.emitter.emit("log","verbose",k),b.ENABLE_VERBOSE&&console.log(k)},b}();m.GLOBAL_TAG="mpegts.js",m.FORCE_GLOBAL_TAG=!1,m.ENABLE_ERROR=!0,m.ENABLE_INFO=!0,m.ENABLE_WARN=!0,m.ENABLE_DEBUG=!0,m.ENABLE_VERBOSE=!0,m.ENABLE_CALLBACK=!1,m.emitter=new I.a,Z.a=m},function(pe,Z,O){Z.a={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},function(pe,Z,O){O.d(Z,"c",function(){return I}),O.d(Z,"b",function(){return m}),O.d(Z,"a",function(){return b});var N=O(3),I={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},m={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},b=function(){function v(f){this._type=f||"undefined",this._status=I.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return v.prototype.destroy=function(){this._status=I.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},v.prototype.isWorking=function(){return this._status===I.kConnecting||this._status===I.kBuffering},Object.defineProperty(v.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(f){this._onContentLengthKnown=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(f){this._onURLRedirect=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(f){this._onDataArrival=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onError",{get:function(){return this._onError},set:function(f){this._onError=f},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onComplete",{get:function(){return this._onComplete},set:function(f){this._onComplete=f},enumerable:!1,configurable:!0}),v.prototype.open=function(f,k){throw new N.c("Unimplemented abstract function!")},v.prototype.abort=function(){throw new N.c("Unimplemented abstract function!")},v}()},function(pe,Z,O){O.d(Z,"d",function(){return m}),O.d(Z,"a",function(){return b}),O.d(Z,"b",function(){return v}),O.d(Z,"c",function(){return f});var N,I=(N=function(k,x){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,j){C.__proto__=j}||function(C,j){for(var H in j)j.hasOwnProperty(H)&&(C[H]=j[H])})(k,x)},function(k,x){function C(){this.constructor=k}N(k,x),k.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}),m=function(){function k(x){this._message=x}return Object.defineProperty(k.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),k.prototype.toString=function(){return this.name+": "+this.message},k}(),b=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),x}(m),v=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),x}(m),f=function(k){function x(C){return k.call(this,C)||this}return I(x,k),Object.defineProperty(x.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),x}(m)},function(pe,Z,O){var N={};(function(){var I=self.navigator.userAgent.toLowerCase(),m=/(edge)\/([\w.]+)/.exec(I)||/(opr)[\/]([\w.]+)/.exec(I)||/(chrome)[ \/]([\w.]+)/.exec(I)||/(iemobile)[\/]([\w.]+)/.exec(I)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(I)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(I)||/(webkit)[ \/]([\w.]+)/.exec(I)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(I)||/(msie) ([\w.]+)/.exec(I)||I.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(I)||I.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(I)||[],b=/(ipad)/.exec(I)||/(ipod)/.exec(I)||/(windows phone)/.exec(I)||/(iphone)/.exec(I)||/(kindle)/.exec(I)||/(android)/.exec(I)||/(windows)/.exec(I)||/(mac)/.exec(I)||/(linux)/.exec(I)||/(cros)/.exec(I)||[],v={browser:m[5]||m[3]||m[1]||"",version:m[2]||m[4]||"0",majorVersion:m[4]||m[2]||"0",platform:b[0]||""},f={};if(v.browser){f[v.browser]=!0;var k=v.majorVersion.split(".");f.version={major:parseInt(v.majorVersion,10),string:v.version},k.length>1&&(f.version.minor=parseInt(k[1],10)),k.length>2&&(f.version.build=parseInt(k[2],10))}v.platform&&(f[v.platform]=!0),(f.chrome||f.opr||f.safari)&&(f.webkit=!0),(f.rv||f.iemobile)&&(f.rv&&delete f.rv,v.browser="msie",f.msie=!0),f.edge&&(delete f.edge,v.browser="msedge",f.msedge=!0),f.opr&&(v.browser="opera",f.opera=!0),f.safari&&f.android&&(v.browser="android",f.android=!0);for(var x in f.name=v.browser,f.platform=v.platform,N)N.hasOwnProperty(x)&&delete N[x];Object.assign(N,f)})(),Z.a=N},function(pe,Z,O){Z.a={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},function(pe,Z,O){var N,I=typeof Reflect=="object"?Reflect:null,m=I&&typeof I.apply=="function"?I.apply:function(y,G,w){return Function.prototype.apply.call(y,G,w)};N=I&&typeof I.ownKeys=="function"?I.ownKeys:Object.getOwnPropertySymbols?function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:function(y){return Object.getOwnPropertyNames(y)};var b=Number.isNaN||function(y){return y!=y};function v(){v.init.call(this)}pe.exports=v,pe.exports.once=function(y,G){return new Promise(function(w,h){function _(l){y.removeListener(G,c),h(l)}function c(){typeof y.removeListener=="function"&&y.removeListener("error",_),w([].slice.call(arguments))}re(y,G,c,{once:!0}),G!=="error"&&function(l,P,D){typeof l.on=="function"&&re(l,"error",P,D)}(y,_,{once:!0})})},v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var f=10;function k(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}function x(y){return y._maxListeners===void 0?v.defaultMaxListeners:y._maxListeners}function C(y,G,w,h){var _,c,l,P;if(k(w),(c=y._events)===void 0?(c=y._events=Object.create(null),y._eventsCount=0):(c.newListener!==void 0&&(y.emit("newListener",G,w.listener?w.listener:w),c=y._events),l=c[G]),l===void 0)l=c[G]=w,++y._eventsCount;else if(typeof l=="function"?l=c[G]=h?[w,l]:[l,w]:h?l.unshift(w):l.push(w),(_=x(y))>0&&l.length>_&&!l.warned){l.warned=!0;var D=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(G)+" listeners added. Use emitter.setMaxListeners() to increase limit");D.name="MaxListenersExceededWarning",D.emitter=y,D.type=G,D.count=l.length,P=D,console&&console.warn&&console.warn(P)}return y}function j(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function H(y,G,w){var h={fired:!1,wrapFn:void 0,target:y,type:G,listener:w},_=j.bind(h);return _.listener=w,h.wrapFn=_,_}function he(y,G,w){var h=y._events;if(h===void 0)return[];var _=h[G];return _===void 0?[]:typeof _=="function"?w?[_.listener||_]:[_]:w?function(c){for(var l=new Array(c.length),P=0;P<l.length;++P)l[P]=c[P].listener||c[P];return l}(_):J(_,_.length)}function de(y){var G=this._events;if(G!==void 0){var w=G[y];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}function J(y,G){for(var w=new Array(G),h=0;h<G;++h)w[h]=y[h];return w}function re(y,G,w,h){if(typeof y.on=="function")h.once?y.once(G,w):y.on(G,w);else{if(typeof y.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y);y.addEventListener(G,function _(c){h.once&&y.removeEventListener(G,_),w(c)})}}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(y){if(typeof y!="number"||y<0||b(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");f=y}}),v.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||b(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this},v.prototype.getMaxListeners=function(){return x(this)},v.prototype.emit=function(y){for(var G=[],w=1;w<arguments.length;w++)G.push(arguments[w]);var h=y==="error",_=this._events;if(_!==void 0)h=h&&_.error===void 0;else if(!h)return!1;if(h){var c;if(G.length>0&&(c=G[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var P=_[y];if(P===void 0)return!1;if(typeof P=="function")m(P,this,G);else{var D=P.length,F=J(P,D);for(w=0;w<D;++w)m(F[w],this,G)}return!0},v.prototype.addListener=function(y,G){return C(this,y,G,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(y,G){return C(this,y,G,!0)},v.prototype.once=function(y,G){return k(G),this.on(y,H(this,y,G)),this},v.prototype.prependOnceListener=function(y,G){return k(G),this.prependListener(y,H(this,y,G)),this},v.prototype.removeListener=function(y,G){var w,h,_,c,l;if(k(G),(h=this._events)===void 0)return this;if((w=h[y])===void 0)return this;if(w===G||w.listener===G)--this._eventsCount==0?this._events=Object.create(null):(delete h[y],h.removeListener&&this.emit("removeListener",y,w.listener||G));else if(typeof w!="function"){for(_=-1,c=w.length-1;c>=0;c--)if(w[c]===G||w[c].listener===G){l=w[c].listener,_=c;break}if(_<0)return this;_===0?w.shift():function(P,D){for(;D+1<P.length;D++)P[D]=P[D+1];P.pop()}(w,_),w.length===1&&(h[y]=w[0]),h.removeListener!==void 0&&this.emit("removeListener",y,l||G)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(y){var G,w,h;if((w=this._events)===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[y]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete w[y]),this;if(arguments.length===0){var _,c=Object.keys(w);for(h=0;h<c.length;++h)(_=c[h])!=="removeListener"&&this.removeAllListeners(_);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(G=w[y])=="function")this.removeListener(y,G);else if(G!==void 0)for(h=G.length-1;h>=0;h--)this.removeListener(y,G[h]);return this},v.prototype.listeners=function(y){return he(this,y,!0)},v.prototype.rawListeners=function(y){return he(this,y,!1)},v.listenerCount=function(y,G){return typeof y.listenerCount=="function"?y.listenerCount(G):de.call(y,G)},v.prototype.listenerCount=de,v.prototype.eventNames=function(){return this._eventsCount>0?N(this._events):[]}},function(pe,Z,O){O.d(Z,"d",function(){return N}),O.d(Z,"b",function(){return I}),O.d(Z,"a",function(){return m}),O.d(Z,"c",function(){return b});var N=function(v,f,k,x,C){this.dts=v,this.pts=f,this.duration=k,this.originalDts=x,this.isSyncPoint=C,this.fileposition=null},I=function(){function v(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return v.prototype.appendSyncPoint=function(f){f.isSyncPoint=!0,this.syncPoints.push(f)},v}(),m=function(){function v(){this._list=[]}return v.prototype.clear=function(){this._list=[]},v.prototype.appendArray=function(f){var k=this._list;f.length!==0&&(k.length>0&&f[0].originalDts<k[k.length-1].originalDts&&this.clear(),Array.prototype.push.apply(k,f))},v.prototype.getLastSyncPointBeforeDts=function(f){if(this._list.length==0)return null;var k=this._list,x=0,C=k.length-1,j=0,H=0,he=C;for(f<k[0].dts&&(x=0,H=he+1);H<=he;){if((j=H+Math.floor((he-H)/2))===C||f>=k[j].dts&&f<k[j+1].dts){x=j;break}k[j].dts<f?H=j+1:he=j-1}return this._list[x]},v}(),b=function(){function v(f){this._type=f,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(v.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),v.prototype.isEmpty=function(){return this._list.length===0},v.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},v.prototype._searchNearestSegmentBefore=function(f){var k=this._list;if(k.length===0)return-2;var x=k.length-1,C=0,j=0,H=x,he=0;if(f<k[0].originalBeginDts)return he=-1;for(;j<=H;){if((C=j+Math.floor((H-j)/2))===x||f>k[C].lastSample.originalDts&&f<k[C+1].originalBeginDts){he=C;break}k[C].originalBeginDts<f?j=C+1:H=C-1}return he},v.prototype._searchNearestSegmentAfter=function(f){return this._searchNearestSegmentBefore(f)+1},v.prototype.append=function(f){var k=this._list,x=f,C=this._lastAppendLocation,j=0;C!==-1&&C<k.length&&x.originalBeginDts>=k[C].lastSample.originalDts&&(C===k.length-1||C<k.length-1&&x.originalBeginDts<k[C+1].originalBeginDts)?j=C+1:k.length>0&&(j=this._searchNearestSegmentBefore(x.originalBeginDts)+1),this._lastAppendLocation=j,this._list.splice(j,0,x)},v.prototype.getLastSegmentBefore=function(f){var k=this._searchNearestSegmentBefore(f);return k>=0?this._list[k]:null},v.prototype.getLastSampleBefore=function(f){var k=this.getLastSegmentBefore(f);return k!=null?k.lastSample:null},v.prototype.getLastSyncPointBefore=function(f){for(var k=this._searchNearestSegmentBefore(f),x=this._list[k].syncPoints;x.length===0&&k>0;)k--,x=this._list[k].syncPoints;return x.length>0?x[x.length-1]:null},v}()},function(pe,Z,O){var N=function(){function I(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return I.prototype.isComplete=function(){var m=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,b=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&m&&b},I.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},I.prototype.getNearestKeyframe=function(m){if(this.keyframesIndex==null)return null;var b=this.keyframesIndex,v=this._search(b.times,m);return{index:v,milliseconds:b.times[v],fileposition:b.filepositions[v]}},I.prototype._search=function(m,b){var v=0,f=m.length-1,k=0,x=0,C=f;for(b<m[0]&&(v=0,x=C+1);x<=C;){if((k=x+Math.floor((C-x)/2))===f||b>=m[k]&&b<m[k+1]){v=k;break}m[k]<b?x=k+1:C=k-1}return v},I}();Z.a=N},function(pe,Z,O){var N=O(6),I=O.n(N),m=O(0),b=function(){function v(){}return Object.defineProperty(v,"forceGlobalTag",{get:function(){return m.a.FORCE_GLOBAL_TAG},set:function(f){m.a.FORCE_GLOBAL_TAG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"globalTag",{get:function(){return m.a.GLOBAL_TAG},set:function(f){m.a.GLOBAL_TAG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableAll",{get:function(){return m.a.ENABLE_VERBOSE&&m.a.ENABLE_DEBUG&&m.a.ENABLE_INFO&&m.a.ENABLE_WARN&&m.a.ENABLE_ERROR},set:function(f){m.a.ENABLE_VERBOSE=f,m.a.ENABLE_DEBUG=f,m.a.ENABLE_INFO=f,m.a.ENABLE_WARN=f,m.a.ENABLE_ERROR=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableDebug",{get:function(){return m.a.ENABLE_DEBUG},set:function(f){m.a.ENABLE_DEBUG=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableVerbose",{get:function(){return m.a.ENABLE_VERBOSE},set:function(f){m.a.ENABLE_VERBOSE=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableInfo",{get:function(){return m.a.ENABLE_INFO},set:function(f){m.a.ENABLE_INFO=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableWarn",{get:function(){return m.a.ENABLE_WARN},set:function(f){m.a.ENABLE_WARN=f,v._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(v,"enableError",{get:function(){return m.a.ENABLE_ERROR},set:function(f){m.a.ENABLE_ERROR=f,v._notifyChange()},enumerable:!1,configurable:!0}),v.getConfig=function(){return{globalTag:m.a.GLOBAL_TAG,forceGlobalTag:m.a.FORCE_GLOBAL_TAG,enableVerbose:m.a.ENABLE_VERBOSE,enableDebug:m.a.ENABLE_DEBUG,enableInfo:m.a.ENABLE_INFO,enableWarn:m.a.ENABLE_WARN,enableError:m.a.ENABLE_ERROR,enableCallback:m.a.ENABLE_CALLBACK}},v.applyConfig=function(f){m.a.GLOBAL_TAG=f.globalTag,m.a.FORCE_GLOBAL_TAG=f.forceGlobalTag,m.a.ENABLE_VERBOSE=f.enableVerbose,m.a.ENABLE_DEBUG=f.enableDebug,m.a.ENABLE_INFO=f.enableInfo,m.a.ENABLE_WARN=f.enableWarn,m.a.ENABLE_ERROR=f.enableError,m.a.ENABLE_CALLBACK=f.enableCallback},v._notifyChange=function(){var f=v.emitter;if(f.listenerCount("change")>0){var k=v.getConfig();f.emit("change",k)}},v.registerListener=function(f){v.emitter.addListener("change",f)},v.removeListener=function(f){v.emitter.removeListener("change",f)},v.addLogListener=function(f){m.a.emitter.addListener("log",f),m.a.emitter.listenerCount("log")>0&&(m.a.ENABLE_CALLBACK=!0,v._notifyChange())},v.removeLogListener=function(f){m.a.emitter.removeListener("log",f),m.a.emitter.listenerCount("log")===0&&(m.a.ENABLE_CALLBACK=!1,v._notifyChange())},v}();b.emitter=new I.a,Z.a=b},function(pe,Z,O){var N=O(6),I=O.n(N),m=O(0),b=O(4),v=O(8);function f(n,t,i){var e=n;if(t+i<e.length){for(;i--;)if((192&e[++t])!=128)return!1;return!0}return!1}var k,x=function(n){for(var t=[],i=n,e=0,a=n.length;e<a;)if(i[e]<128)t.push(String.fromCharCode(i[e])),++e;else{if(!(i[e]<192)){if(i[e]<224){if(f(i,e,1)&&(s=(31&i[e])<<6|63&i[e+1])>=128){t.push(String.fromCharCode(65535&s)),e+=2;continue}}else if(i[e]<240){if(f(i,e,2)&&(s=(15&i[e])<<12|(63&i[e+1])<<6|63&i[e+2])>=2048&&(63488&s)!=55296){t.push(String.fromCharCode(65535&s)),e+=3;continue}}else if(i[e]<248){var s;if(f(i,e,3)&&(s=(7&i[e])<<18|(63&i[e+1])<<12|(63&i[e+2])<<6|63&i[e+3])>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),e+=4;continue}}}t.push(String.fromCharCode(65533)),++e}return t.join("")},C=O(3),j=(k=new ArrayBuffer(2),new DataView(k).setInt16(0,256,!0),new Int16Array(k)[0]===256),H=function(){function n(){}return n.parseScriptData=function(t,i,e){var a={};try{var s=n.parseValue(t,i,e),r=n.parseValue(t,i+s.size,e-s.size);a[s.data]=r.data}catch(o){m.a.e("AMF",o.toString())}return a},n.parseObject=function(t,i,e){if(e<3)throw new C.a("Data not enough when parse ScriptDataObject");var a=n.parseString(t,i,e),s=n.parseValue(t,i+a.size,e-a.size),r=s.objectEnd;return{data:{name:a.data,value:s.data},size:a.size+s.size,objectEnd:r}},n.parseVariable=function(t,i,e){return n.parseObject(t,i,e)},n.parseString=function(t,i,e){if(e<2)throw new C.a("Data not enough when parse String");var a=new DataView(t,i,e).getUint16(0,!j);return{data:a>0?x(new Uint8Array(t,i+2,a)):"",size:2+a}},n.parseLongString=function(t,i,e){if(e<4)throw new C.a("Data not enough when parse LongString");var a=new DataView(t,i,e).getUint32(0,!j);return{data:a>0?x(new Uint8Array(t,i+4,a)):"",size:4+a}},n.parseDate=function(t,i,e){if(e<10)throw new C.a("Data size invalid when parse Date");var a=new DataView(t,i,e),s=a.getFloat64(0,!j),r=a.getInt16(8,!j);return{data:new Date(s+=60*r*1e3),size:10}},n.parseValue=function(t,i,e){if(e<1)throw new C.a("Data not enough when parse Value");var a,s=new DataView(t,i,e),r=1,o=s.getUint8(0),p=!1;try{switch(o){case 0:a=s.getFloat64(1,!j),r+=8;break;case 1:a=!!s.getUint8(1),r+=1;break;case 2:var g=n.parseString(t,i+1,e-1);a=g.data,r+=g.size;break;case 3:a={};var E=0;for((16777215&s.getUint32(e-4,!j))==9&&(E=3);r<e-4;){var A=n.parseObject(t,i+r,e-r-E);if(A.objectEnd)break;a[A.data.name]=A.data.value,r+=A.size}r<=e-3&&(16777215&s.getUint32(r-1,!j))===9&&(r+=3);break;case 8:for(a={},r+=4,E=0,(16777215&s.getUint32(e-4,!j))==9&&(E=3);r<e-8;){var S=n.parseVariable(t,i+r,e-r-E);if(S.objectEnd)break;a[S.data.name]=S.data.value,r+=S.size}r<=e-3&&(16777215&s.getUint32(r-1,!j))===9&&(r+=3);break;case 9:a=void 0,r=1,p=!0;break;case 10:a=[];var T=s.getUint32(1,!j);r+=4;for(var B=0;B<T;B++){var z=n.parseValue(t,i+r,e-r);a.push(z.data),r+=z.size}break;case 11:var U=n.parseDate(t,i+1,e-1);a=U.data,r+=U.size;break;case 12:var Y=n.parseString(t,i+1,e-1);a=Y.data,r+=Y.size;break;default:r=e,m.a.w("AMF","Unsupported AMF value type "+o)}}catch(W){m.a.e("AMF",W.toString())}return{data:a,size:r,objectEnd:p}},n}(),he=function(){function n(t){this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return n.prototype.destroy=function(){this._buffer=null},n.prototype._fillCurrentWord=function(){var t=this._total_bytes-this._buffer_index;if(t<=0)throw new C.a("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),e=new Uint8Array(4);e.set(this._buffer.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(e.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},n.prototype.readBits=function(t){if(t>32)throw new C.b("ExpGolomb: readBits() bits exceeded max 32bits!");if(t<=this._current_word_bits_left){var i=this._current_word>>>32-t;return this._current_word<<=t,this._current_word_bits_left-=t,i}var e=this._current_word_bits_left?this._current_word:0;e>>>=32-this._current_word_bits_left;var a=t-this._current_word_bits_left;this._fillCurrentWord();var s=Math.min(a,this._current_word_bits_left),r=this._current_word>>>32-s;return this._current_word<<=s,this._current_word_bits_left-=s,e=e<<s|r},n.prototype.readBool=function(){return this.readBits(1)===1},n.prototype.readByte=function(){return this.readBits(8)},n.prototype._skipLeadingZero=function(){var t;for(t=0;t<this._current_word_bits_left;t++)if(this._current_word&2147483648>>>t)return this._current_word<<=t,this._current_word_bits_left-=t,t;return this._fillCurrentWord(),t+this._skipLeadingZero()},n.prototype.readUEG=function(){var t=this._skipLeadingZero();return this.readBits(t+1)-1},n.prototype.readSEG=function(){var t=this.readUEG();return 1&t?t+1>>>1:-1*(t>>>1)},n}(),de=function(){function n(){}return n._ebsp2rbsp=function(t){for(var i=t,e=i.byteLength,a=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&i[r]===3&&i[r-1]===0&&i[r-2]===0||(a[s]=i[r],s++);return new Uint8Array(a.buffer,0,s)},n.parseSPS=function(t){for(var i=t.subarray(1,4),e="avc1.",a=0;a<3;a++){var s=i[a].toString(16);s.length<2&&(s="0"+s),e+=s}var r=n._ebsp2rbsp(t),o=new he(r);o.readByte();var p=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var E=n.getProfileString(p),A=n.getLevelString(g),S=1,T=420,B=8,z=8;if((p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128||p===138||p===144)&&((S=o.readUEG())===3&&o.readBits(1),S<=3&&(T=[0,420,422,444][S]),B=o.readUEG()+8,z=o.readUEG()+8,o.readBits(1),o.readBool()))for(var U=S!==3?8:12,Y=0;Y<U;Y++)o.readBool()&&(Y<6?n._skipScalingList(o,16):n._skipScalingList(o,64));o.readUEG();var W=o.readUEG();if(W===0)o.readUEG();else if(W===1){o.readBits(1),o.readSEG(),o.readSEG();var q=o.readUEG();for(Y=0;Y<q;Y++)o.readSEG()}var oe=o.readUEG();o.readBits(1);var ue=o.readUEG(),K=o.readUEG(),Q=o.readBits(1);Q===0&&o.readBits(1),o.readBits(1);var ce=0,te=0,ae=0,be=0;o.readBool()&&(ce=o.readUEG(),te=o.readUEG(),ae=o.readUEG(),be=o.readUEG());var Ae=1,_e=1,ye=0,Re=!0,ke=0,Ue=0;if(o.readBool()){if(o.readBool()){var Oe=o.readByte();Oe>0&&Oe<16?(Ae=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Oe-1],_e=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Oe-1]):Oe===255&&(Ae=o.readByte()<<8|o.readByte(),_e=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var Ne=o.readBits(32),Ve=o.readBits(32);Re=o.readBool(),ye=(ke=Ve)/(Ue=2*Ne)}}var Ge=1;Ae===1&&_e===1||(Ge=Ae/_e);var Ce=0,ge=0;S===0?(Ce=1,ge=2-Q):(Ce=S===3?1:2,ge=(S===1?2:1)*(2-Q));var Me=16*(ue+1),xe=16*(K+1)*(2-Q);Me-=(ce+te)*Ce,xe-=(ae+be)*ge;var We=Math.ceil(Me*Ge);return o.destroy(),o=null,{codec_mimetype:e,profile_idc:p,level_idc:g,profile_string:E,level_string:A,chroma_format_idc:S,bit_depth:B,bit_depth_luma:B,bit_depth_chroma:z,ref_frames:oe,chroma_format:T,chroma_format_string:n.getChromaFormatString(T),frame_rate:{fixed:Re,fps:ye,fps_den:Ue,fps_num:ke},sar_ratio:{width:Ae,height:_e},codec_size:{width:Me,height:xe},present_size:{width:We,height:xe}}},n._skipScalingList=function(t,i){for(var e=8,a=8,s=0;s<i;s++)a!==0&&(a=(e+t.readSEG()+256)%256),e=a===0?e:a},n.getProfileString=function(t){switch(t){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},n.getLevelString=function(t){return(t/10).toFixed(1)},n.getChromaFormatString=function(t){switch(t){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},n}(),J=O(5),re=function(){function n(){}return n._ebsp2rbsp=function(t){for(var i=t,e=i.byteLength,a=new Uint8Array(e),s=0,r=0;r<e;r++)r>=2&&i[r]===3&&i[r-1]===0&&i[r-2]===0||(a[s]=i[r],s++);return new Uint8Array(a.buffer,0,s)},n.parseVPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);return e.readByte(),e.readByte(),e.readBits(4),e.readBits(2),e.readBits(6),{num_temporal_layers:e.readBits(3)+1,temporal_id_nested:e.readBool()}},n.parseSPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);e.readByte(),e.readByte();for(var a=0,s=0,r=0,o=0,p=(e.readBits(4),e.readBits(3)),g=(e.readBool(),e.readBits(2)),E=e.readBool(),A=e.readBits(5),S=e.readByte(),T=e.readByte(),B=e.readByte(),z=e.readByte(),U=e.readByte(),Y=e.readByte(),W=e.readByte(),q=e.readByte(),oe=e.readByte(),ue=e.readByte(),K=e.readByte(),Q=[],ce=[],te=0;te<p;te++)Q.push(e.readBool()),ce.push(e.readBool());if(p>0)for(te=p;te<8;te++)e.readBits(2);for(te=0;te<p;te++)Q[te]&&(e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte()),ce[te]&&e.readByte();e.readUEG();var ae=e.readUEG();ae==3&&e.readBits(1);var be=e.readUEG(),Ae=e.readUEG();e.readBool()&&(a+=e.readUEG(),s+=e.readUEG(),r+=e.readUEG(),o+=e.readUEG());var _e=e.readUEG(),ye=e.readUEG(),Re=e.readUEG();for(te=e.readBool()?0:p;te<=p;te++)e.readUEG(),e.readUEG(),e.readUEG();if(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readBool()&&e.readBool())for(var ke=0;ke<4;ke++)for(var Ue=0;Ue<(ke===3?2:6);Ue++)if(e.readBool()){var Oe=Math.min(64,1<<4+(ke<<1));for(ke>1&&e.readSEG(),te=0;te<Oe;te++)e.readSEG()}else e.readUEG();e.readBool(),e.readBool(),e.readBool()&&(e.readByte(),e.readUEG(),e.readUEG(),e.readBool());var Ne=e.readUEG(),Ve=0;for(te=0;te<Ne;te++){var Ge=!1;if(te!==0&&(Ge=e.readBool()),Ge){te===Ne&&e.readUEG(),e.readBool(),e.readUEG();for(var Ce=0,ge=0;ge<=Ve;ge++){var Me=e.readBool(),xe=!1;Me||(xe=e.readBool()),(Me||xe)&&Ce++}Ve=Ce}else{var We=e.readUEG(),_t=e.readUEG();for(Ve=We+_t,ge=0;ge<We;ge++)e.readUEG(),e.readBool();for(ge=0;ge<_t;ge++)e.readUEG(),e.readBool()}}if(e.readBool()){var Vt=e.readUEG();for(te=0;te<Vt;te++){for(ge=0;ge<Re+4;ge++)e.readBits(1);e.readBits(1)}}var ht=0,He=1,qe=1,ct=!1,et=1,tt=1;if(e.readBool(),e.readBool(),e.readBool()){if(e.readBool()){var Ke=e.readByte();Ke>0&&Ke<=16?(He=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Ke-1],qe=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Ke-1]):Ke===255&&(He=e.readBits(16),qe=e.readBits(16))}if(e.readBool()&&e.readBool(),e.readBool()&&(e.readBits(3),e.readBool(),e.readBool()&&(e.readByte(),e.readByte(),e.readByte())),e.readBool()&&(e.readUEG(),e.readUEG()),e.readBool(),e.readBool(),e.readBool(),e.readBool()&&(e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG()),e.readBool()&&(et=e.readBits(32),tt=e.readBits(32),e.readBool()&&(e.readUEG(),e.readBool()))){var it=!1,nt=!1,Xe=!1;for(it=e.readBool(),nt=e.readBool(),(it||nt)&&((Xe=e.readBool())&&(e.readByte(),e.readBits(5),e.readBool(),e.readBits(5)),e.readBits(4),e.readBits(4),Xe&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5)),te=0;te<=p;te++){var ut=e.readBool();ct=ut;var lt=!1,at=1;ut||(lt=e.readBool());var ft=!1;if(lt?e.readSEG():ft=e.readBool(),ft||(at=e.readUEG()+1),it)for(ge=0;ge<at;ge++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG());if(nt)for(ge=0;ge<at;ge++)e.readUEG(),e.readUEG(),Xe&&(e.readUEG(),e.readUEG())}}e.readBool()&&(e.readBool(),e.readBool(),e.readBool(),ht=e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG(),e.readUEG())}e.readBool();var jt="hvc1."+A+".1.L"+K+".B0",pt=be-(a+s)*(ae===1||ae===2?2:1),mt=Ae-(r+o)*(ae===1?2:1),gt=1;return He!==1&&qe!==1&&(gt=He/qe),e.destroy(),e=null,{codec_mimetype:jt,level_string:n.getLevelString(K),profile_idc:A,bit_depth:_e+8,ref_frames:1,chroma_format:ae,chroma_format_string:n.getChromaFormatString(ae),general_level_idc:K,general_profile_space:g,general_tier_flag:E,general_profile_idc:A,general_profile_compatibility_flags_1:S,general_profile_compatibility_flags_2:T,general_profile_compatibility_flags_3:B,general_profile_compatibility_flags_4:z,general_constraint_indicator_flags_1:U,general_constraint_indicator_flags_2:Y,general_constraint_indicator_flags_3:W,general_constraint_indicator_flags_4:q,general_constraint_indicator_flags_5:oe,general_constraint_indicator_flags_6:ue,min_spatial_segmentation_idc:ht,constant_frame_rate:0,chroma_format_idc:ae,bit_depth_luma_minus8:_e,bit_depth_chroma_minus8:ye,frame_rate:{fixed:ct,fps:tt/et,fps_den:et,fps_num:tt},sar_ratio:{width:He,height:qe},codec_size:{width:pt,height:mt},present_size:{width:pt*gt,height:mt}}},n.parsePPS=function(t){var i=n._ebsp2rbsp(t),e=new he(i);e.readByte(),e.readByte(),e.readUEG(),e.readUEG(),e.readBool(),e.readBool(),e.readBits(3),e.readBool(),e.readBool(),e.readUEG(),e.readUEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool()&&e.readUEG(),e.readSEG(),e.readSEG(),e.readBool(),e.readBool(),e.readBool(),e.readBool();var a=e.readBool(),s=e.readBool(),r=1;return s&&a?r=0:s?r=3:a&&(r=2),{parallelismType:r}},n.getChromaFormatString=function(t){switch(t){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},n.getProfileString=function(t){switch(t){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},n.getLevelString=function(t){return(t/30).toFixed(1)},n}();function y(n){return n.byteOffset%2==0&&n.byteLength%2==0}function G(n){return n.byteOffset%4==0&&n.byteLength%4==0}function w(n,t){for(var i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}var h=function(n,t){return n.byteLength===t.byteLength&&(G(n)&&G(t)?function(i,e){return w(new Uint32Array(i.buffer,i.byteOffset,i.byteLength/4),new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4))}(n,t):y(n)&&y(t)?function(i,e){return w(new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2))}(n,t):function(i,e){return w(i,e)}(n,t))},_,c=function(){function n(t,i){this.TAG="FLVDemuxer",this._config=i,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new v.a,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256}()}return n.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},n.probe=function(t){var i=new Uint8Array(t);if(i.byteLength<9)return{needMoreData:!0};var e={match:!1};if(i[0]!==70||i[1]!==76||i[2]!==86||i[3]!==1)return e;var a,s,r=(4&i[4])>>>2!=0,o=(1&i[4])!=0,p=(a=i)[s=5]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3];return p<9?e:{match:!0,consumed:p,dataOffset:p,hasAudioTrack:r,hasVideoTrack:o}},n.prototype.bindDataSource=function(t){return t.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(n.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(t){this._onTrackMetadata=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(t){this._onMediaInfo=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(t){this._onMetaDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(t){this._onScriptDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onError",{get:function(){return this._onError},set:function(t){this._onError=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(t){this._onDataAvailable=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(t){this._timestampBase=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedDuration",{get:function(){return this._duration},set:function(t){this._durationOverrided=!0,this._duration=t,this._mediaInfo.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasAudio",{set:function(t){this._hasAudioFlagOverrided=!0,this._hasAudio=t,this._mediaInfo.hasAudio=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"overridedHasVideo",{set:function(t){this._hasVideoFlagOverrided=!0,this._hasVideo=t,this._mediaInfo.hasVideo=t},enumerable:!1,configurable:!0}),n.prototype.resetMediaInfo=function(){this._mediaInfo=new v.a},n.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},n.prototype.parseChunks=function(t,i){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new C.a("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var e=0,a=this._littleEndian;if(i===0){if(!(t.byteLength>13))return 0;e=n.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,i+e!==this._dataOffset&&m.a.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(s=new DataView(t,e)).getUint32(0,!a)!==0&&m.a.w(this.TAG,"PrevTagSize0 !== 0 !!!"),e+=4);e<t.byteLength;){this._dispatch=!0;var s=new DataView(t,e);if(e+11+4>t.byteLength)break;var r=s.getUint8(0),o=16777215&s.getUint32(0,!a);if(e+11+o+4>t.byteLength)break;if(r===8||r===9||r===18){var p=s.getUint8(4),g=s.getUint8(5),E=s.getUint8(6)|g<<8|p<<16|s.getUint8(7)<<24;16777215&s.getUint32(7,!a)&&m.a.w(this.TAG,"Meet tag which has StreamID != 0!");var A=e+11;switch(r){case 8:this._parseAudioData(t,A,o,E);break;case 9:this._parseVideoData(t,A,o,E,i+e);break;case 18:this._parseScriptData(t,A,o)}var S=s.getUint32(11+o,!a);S!==11+o&&m.a.w(this.TAG,"Invalid PrevTagSize "+S),e+=11+o+4}else m.a.w(this.TAG,"Unsupported tag type "+r+", skipped"),e+=11+o+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),e},n.prototype._parseScriptData=function(t,i,e){var a=H.parseScriptData(t,i,e);if(a.hasOwnProperty("onMetaData")){if(a.onMetaData==null||typeof a.onMetaData!="object")return void m.a.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&m.a.w(this.TAG,"Found another onMetaData tag!"),this._metadata=a;var s=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),typeof s.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=s.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof s.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=s.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof s.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=s.audiodatarate),typeof s.videodatarate=="number"&&(this._mediaInfo.videoDataRate=s.videodatarate),typeof s.width=="number"&&(this._mediaInfo.width=s.width),typeof s.height=="number"&&(this._mediaInfo.height=s.height),typeof s.duration=="number"){if(!this._durationOverrided){var r=Math.floor(s.duration*this._timescale);this._duration=r,this._mediaInfo.duration=r}}else this._mediaInfo.duration=0;if(typeof s.framerate=="number"){var o=Math.floor(1e3*s.framerate);if(o>0){var p=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=p,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=p}}if(typeof s.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var g=s.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(g),s.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=s,m.a.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(a).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},a))},n.prototype._parseKeyframesIndex=function(t){for(var i=[],e=[],a=1;a<t.times.length;a++){var s=this._timestampBase+Math.floor(1e3*t.times[a]);i.push(s),e.push(t.filepositions[a])}return{times:i,filepositions:e}},n.prototype._parseAudioData=function(t,i,e,a){if(e<=1)m.a.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(this._hasAudioFlagOverrided!==!0||this._hasAudio!==!1){this._littleEndian;var s=new DataView(t,i,e).getUint8(0),r=s>>>4;if(r===2||r===10){var o=0,p=(12&s)>>>2;if(p>=0&&p<=4){o=this._flvSoundRateTable[p];var g=1&s,E=this._audioMetadata,A=this._audioTrack;if(E||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(E=this._audioMetadata={}).type="audio",E.id=A.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=o,E.channelCount=g===0?1:2),r===10){var S=this._parseAACAudioData(t,i+1,e-1);if(S==null)return;if(S.packetType===0){if(E.config){if(h(S.data.config,E.config))return;m.a.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var T=S.data;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.config=T.config,E.refSampleDuration=1024/E.audioSampleRate*E.timescale,m.a.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",E),(U=this._mediaInfo).audioCodec=E.originalCodec,U.audioSampleRate=E.audioSampleRate,U.audioChannelCount=E.channelCount,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}else if(S.packetType===1){var B=this._timestampBase+a,z={unit:S.data,length:S.data.byteLength,dts:B,pts:B};A.samples.push(z),A.length+=S.data.length}else m.a.e(this.TAG,"Flv: Unsupported AAC data type "+S.packetType)}else if(r===2){if(!E.codec){var U;if((T=this._parseMP3AudioData(t,i+1,e-1,!0))==null)return;E.audioSampleRate=T.samplingRate,E.channelCount=T.channelCount,E.codec=T.codec,E.originalCodec=T.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.timescale,m.a.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",E),(U=this._mediaInfo).audioCodec=E.codec,U.audioSampleRate=E.audioSampleRate,U.audioChannelCount=E.channelCount,U.audioDataRate=T.bitRate,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}var Y=this._parseMP3AudioData(t,i+1,e-1,!1);if(Y==null)return;B=this._timestampBase+a;var W={unit:Y,length:Y.byteLength,dts:B,pts:B};A.samples.push(W),A.length+=Y.length}}else this._onError(J.a.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+p)}else this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+r)}},n.prototype._parseAACAudioData=function(t,i,e){if(!(e<=1)){var a={},s=new Uint8Array(t,i,e);return a.packetType=s[0],s[0]===0?a.data=this._parseAACAudioSpecificConfig(t,i+1,e-1):a.data=s.subarray(1),a}m.a.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},n.prototype._parseAACAudioSpecificConfig=function(t,i,e){var a,s,r=new Uint8Array(t,i,e),o=null,p=0,g=null;if(p=a=r[0]>>>3,(s=(7&r[0])<<1|r[1]>>>7)<0||s>=this._mpegSamplingRates.length)this._onError(J.a.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var E=this._mpegSamplingRates[s],A=(120&r[1])>>>3;if(!(A<0||A>=8)){p===5&&(g=(7&r[1])<<1|r[2]>>>7,(124&r[2])>>>2);var S=self.navigator.userAgent.toLowerCase();return S.indexOf("firefox")!==-1?s>=6?(p=5,o=new Array(4),g=s-3):(p=2,o=new Array(2),g=s):S.indexOf("android")!==-1?(p=2,o=new Array(2),g=s):(p=5,g=s,o=new Array(4),s>=6?g=s-3:A===1&&(p=2,o=new Array(2),g=s)),o[0]=p<<3,o[0]|=(15&s)>>>1,o[1]=(15&s)<<7,o[1]|=(15&A)<<3,p===5&&(o[1]|=(15&g)>>>1,o[2]=(1&g)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:E,channelCount:A,codec:"mp4a.40."+p,originalCodec:"mp4a.40."+a}}this._onError(J.a.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},n.prototype._parseMP3AudioData=function(t,i,e,a){if(!(e<4)){this._littleEndian;var s=new Uint8Array(t,i,e),r=null;if(a){if(s[0]!==255)return;var o=s[1]>>>3&3,p=(6&s[1])>>1,g=(240&s[2])>>>4,E=(12&s[2])>>>2,A=(s[3]>>>6&3)!==3?2:1,S=0,T=0;switch(o){case 0:S=this._mpegAudioV25SampleRateTable[E];break;case 2:S=this._mpegAudioV20SampleRateTable[E];break;case 3:S=this._mpegAudioV10SampleRateTable[E]}switch(p){case 1:g<this._mpegAudioL3BitRateTable.length&&(T=this._mpegAudioL3BitRateTable[g]);break;case 2:g<this._mpegAudioL2BitRateTable.length&&(T=this._mpegAudioL2BitRateTable[g]);break;case 3:g<this._mpegAudioL1BitRateTable.length&&(T=this._mpegAudioL1BitRateTable[g])}r={bitRate:T,samplingRate:S,channelCount:A,codec:"mp3",originalCodec:"mp3"}}else r=s;return r}m.a.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},n.prototype._parseVideoData=function(t,i,e,a,s){if(e<=1)m.a.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(this._hasVideoFlagOverrided!==!0||this._hasVideo!==!1){var r=new Uint8Array(t,i,e)[0],o=(112&r)>>>4;if(128&r){var p=15&r,g=String.fromCharCode.apply(String,new Uint8Array(t,i,e).slice(1,5));if(g!=="hvc1")return void this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+g);this._parseEnhancedHEVCVideoPacket(t,i+5,e-5,a,s,o,p)}else{var E=15&r;if(E===7)this._parseAVCVideoPacket(t,i+1,e-1,a,s,o);else{if(E!==12)return void this._onError(J.a.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+E);this._parseHEVCVideoPacket(t,i+1,e-1,a,s,o)}}}},n.prototype._parseAVCVideoPacket=function(t,i,e,a,s,r){if(e<4)m.a.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var o=this._littleEndian,p=new DataView(t,i,e),g=p.getUint8(0),E=(16777215&p.getUint32(0,!o))<<8>>8;if(g===0)this._parseAVCDecoderConfigurationRecord(t,i+4,e-4);else if(g===1)this._parseAVCVideoData(t,i+4,e-4,a,s,r,E);else if(g!==2)return void this._onError(J.a.FORMAT_ERROR,"Flv: Invalid video packet type "+g)}},n.prototype._parseHEVCVideoPacket=function(t,i,e,a,s,r){if(e<4)m.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var o=this._littleEndian,p=new DataView(t,i,e),g=p.getUint8(0),E=(16777215&p.getUint32(0,!o))<<8>>8;if(g===0)this._parseHEVCDecoderConfigurationRecord(t,i+4,e-4);else if(g===1)this._parseHEVCVideoData(t,i+4,e-4,a,s,r,E);else if(g!==2)return void this._onError(J.a.FORMAT_ERROR,"Flv: Invalid video packet type "+g)}},n.prototype._parseEnhancedHEVCVideoPacket=function(t,i,e,a,s,r,o){if(e<4)m.a.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and Co