(function(me,pe){typeof exports=="object"&&typeof module=="object"?module.exports=pe():typeof define=="function"&&define.amd?define([],pe):typeof exports=="object"?exports.flvjs=pe():me.flvjs=pe()})(self,function(){return function(){var me={264:function(W,K,T){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */W.exports=function(){"use strict";function N(b){var R=typeof b;return b!==null&&(R==="object"||R==="function")}function Z(b){return typeof b=="function"}var f=Array.isArray?Array.isArray:function(b){return Object.prototype.toString.call(b)==="[object Array]"},p=0,g=void 0,m=void 0,E=function(b,R){u[p]=b,u[p+1]=R,(p+=2)===2&&(m?m(d):k())};function M(b){m=b}function L(b){E=b}var D=typeof window!="undefined"?window:void 0,I=D||{},H=I.MutationObserver||I.WebKitMutationObserver,ee=typeof self=="undefined"&&typeof process!="undefined"&&{}.toString.call(process)==="[object process]",A=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function O(){return function(){return process.nextTick(d)}}function S(){return g!==void 0?function(){g(d)}:o()}function P(){var b=0,R=new H(d),B=document.createTextNode("");return R.observe(B,{characterData:!0}),function(){B.data=b=++b%2}}function y(){var b=new MessageChannel;return b.port1.onmessage=d,function(){return b.port2.postMessage(0)}}function o(){var b=setTimeout;return function(){return b(d,1)}}var u=new Array(1e3);function d(){for(var b=0;b0&&u.length>y&&!u.warned){u.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=A,l.type=O,l.count=u.length,d=l,console&&console.warn&&console.warn(d)}return A}function M(){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 L(A,O,S){var P={fired:!1,wrapFn:void 0,target:A,type:O,listener:S},y=M.bind(P);return y.listener=S,P.wrapFn=y,y}function D(A,O,S){var P=A._events;if(P===void 0)return[];var y=P[O];return y===void 0?[]:typeof y=="function"?S?[y.listener||y]:[y]:S?function(o){for(var u=new Array(o.length),d=0;d0&&(o=O[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var d=y[A];if(d===void 0)return!1;if(typeof d=="function")N(d,this,O);else{var l=d.length,k=H(d,l);for(S=0;S=0;o--)if(S[o]===O||S[o].listener===O){u=S[o].listener,y=o;break}if(y<0)return this;y===0?S.shift():function(d,l){for(;l+1=0;P--)this.removeListener(A,O[P]);return this},f.prototype.listeners=function(A){return D(this,A,!0)},f.prototype.rawListeners=function(A){return D(this,A,!1)},f.listenerCount=function(A,O){return typeof A.listenerCount=="function"?A.listenerCount(O):I.call(A,O)},f.prototype.listenerCount=I,f.prototype.eventNames=function(){return this._eventsCount>0?K(this._events):[]}},397:function(W,K,T){function N(E){var M={};function L(I){if(M[I])return M[I].exports;var H=M[I]={i:I,l:!1,exports:{}};return E[I].call(H.exports,H,H.exports,L),H.l=!0,H.exports}L.m=E,L.c=M,L.i=function(I){return I},L.d=function(I,H,ee){L.o(I,H)||Object.defineProperty(I,H,{configurable:!1,enumerable:!0,get:ee})},L.r=function(I){Object.defineProperty(I,"__esModule",{value:!0})},L.n=function(I){var H=I&&I.__esModule?function(){return I.default}:function(){return I};return L.d(H,"a",H),H},L.o=function(I,H){return Object.prototype.hasOwnProperty.call(I,H)},L.p="/",L.oe=function(I){throw console.error(I),I};var D=L(L.s=ENTRY_MODULE);return D.default||D}var Z="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function p(E){return(E+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function g(E,M,L){var D={};D[L]=[];var I=M.toString(),H=I.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!H)return D;for(var ee,A=H[1],O=new RegExp("(\\\\n|\\W)"+p(A)+f,"g");ee=O.exec(I);)ee[3]!=="dll-reference"&&D[L].push(ee[3]);for(O=new RegExp("\\("+p(A)+'\\("(dll-reference\\s('+Z+'))"\\)\\)'+f,"g");ee=O.exec(I);)E[ee[2]]||(D[L].push(ee[1]),E[ee[2]]=T(ee[1]).m),D[ee[2]]=D[ee[2]]||[],D[ee[2]].push(ee[4]);for(var S,P=Object.keys(D),y=0;y0},!1)}W.exports=function(E,M){M=M||{};var L={main:T.m},D=M.all?{main:Object.keys(L.main)}:function(O,S){for(var P={main:[S]},y={main:[]},o={main:{}};m(P);)for(var u=Object.keys(P),d=0;d=Z[m]&&f0&&m[0].originalDts=E[D].dts&&mE[L].lastSample.originalDts&&m=E[L].lastSample.originalDts&&(L===E.length-1||L0&&(D=this._searchNearestSegmentBefore(M.originalBeginDts)+1),this._lastAppendLocation=D,this._list.splice(D,0,M)},g.prototype.getLastSegmentBefore=function(m){var E=this._searchNearestSegmentBefore(m);return E>=0?this._list[E]:null},g.prototype.getLastSampleBefore=function(m){var E=this.getLastSegmentBefore(m);return E!=null?E.lastSample:null},g.prototype.getLastSyncPointBefore=function(m){for(var E=this._searchNearestSegmentBefore(m),M=this._list[E].syncPoints;M.length===0&&E>0;)E--,M=this._list[E].syncPoints;return M.length>0?M[M.length-1]:null},g}()},949:function(W,K,T){"use strict";T.d(K,{Z:function(){return k}});var N=T(716),Z=T.n(N),f=T(300),p=T(538),g=T(118);function m(i,e,r){var n=i;if(e+r=128){e.push(String.fromCharCode(65535&_)),n+=2;continue}}else if(r[n]<240){if(m(r,n,2)&&(_=(15&r[n])<<12|(63&r[n+1])<<6|63&r[n+2])>=2048&&(63488&_)!=55296){e.push(String.fromCharCode(65535&_)),n+=3;continue}}else if(r[n]<248){var _;if(m(r,n,3)&&(_=(7&r[n])<<18|(63&r[n+1])<<12|(63&r[n+2])<<6|63&r[n+3])>65536&&_<1114112){_-=65536,e.push(String.fromCharCode(_>>>10|55296)),e.push(String.fromCharCode(1023&_|56320)),n+=4;continue}}}e.push(String.fromCharCode(65533)),++n}return e.join("")},L=T(29),D=(E=new ArrayBuffer(2),new DataView(E).setInt16(0,256,!0),new Int16Array(E)[0]===256),I=function(){function i(){}return i.parseScriptData=function(e,r,n){var a={};try{var _=i.parseValue(e,r,n),s=i.parseValue(e,r+_.size,n-_.size);a[_.data]=s.data}catch(t){f.Z.e("AMF",t.toString())}return a},i.parseObject=function(e,r,n){if(n<3)throw new L.rT("Data not enough when parse ScriptDataObject");var a=i.parseString(e,r,n),_=i.parseValue(e,r+a.size,n-a.size),s=_.objectEnd;return{data:{name:a.data,value:_.data},size:a.size+_.size,objectEnd:s}},i.parseVariable=function(e,r,n){return i.parseObject(e,r,n)},i.parseString=function(e,r,n){if(n<2)throw new L.rT("Data not enough when parse String");var a=new DataView(e,r,n).getUint16(0,!D);return{data:a>0?M(new Uint8Array(e,r+2,a)):"",size:2+a}},i.parseLongString=function(e,r,n){if(n<4)throw new L.rT("Data not enough when parse LongString");var a=new DataView(e,r,n).getUint32(0,!D);return{data:a>0?M(new Uint8Array(e,r+4,a)):"",size:4+a}},i.parseDate=function(e,r,n){if(n<10)throw new L.rT("Data size invalid when parse Date");var a=new DataView(e,r,n),_=a.getFloat64(0,!D),s=a.getInt16(8,!D);return{data:new Date(_+=60*s*1e3),size:10}},i.parseValue=function(e,r,n){if(n<1)throw new L.rT("Data not enough when parse Value");var a,_=new DataView(e,r,n),s=1,t=_.getUint8(0),h=!1;try{switch(t){case 0:a=_.getFloat64(1,!D),s+=8;break;case 1:a=!!_.getUint8(1),s+=1;break;case 2:var c=i.parseString(e,r+1,n-1);a=c.data,s+=c.size;break;case 3:a={};var v=0;for((16777215&_.getUint32(n-4,!D))==9&&(v=3);s32)throw new L.OC("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var r=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,r}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var a=e-this._current_word_bits_left;this._fillCurrentWord();var _=Math.min(a,this._current_word_bits_left),s=this._current_word>>>32-_;return this._current_word<<=_,this._current_word_bits_left-=_,n=n<<_|s},i.prototype.readBool=function(){return this.readBits(1)===1},i.prototype.readByte=function(){return this.readBits(8)},i.prototype._skipLeadingZero=function(){var e;for(e=0;e>>e)!=0)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},i.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},i.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},i}(),ee=function(){function i(){}return i._ebsp2rbsp=function(e){for(var r=e,n=r.byteLength,a=new Uint8Array(n),_=0,s=0;s=2&&r[s]===3&&r[s-1]===0&&r[s-2]===0||(a[_]=r[s],_++);return new Uint8Array(a.buffer,0,_)},i.parseSPS=function(e){var r=i._ebsp2rbsp(e),n=new H(r);n.readByte();var a=n.readByte();n.readByte();var _=n.readByte();n.readUEG();var s=i.getProfileString(a),t=i.getLevelString(_),h=1,c=420,v=8;if((a===100||a===110||a===122||a===244||a===44||a===83||a===86||a===118||a===128||a===138||a===144)&&((h=n.readUEG())===3&&n.readBits(1),h<=3&&(c=[0,420,422,444][h]),v=n.readUEG()+8,n.readUEG(),n.readBits(1),n.readBool()))for(var w=h!==3?8:12,C=0;C0&&ue<16?(re=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][ue-1],$=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][ue-1]):ue===255&&(re=n.readByte()<<8|n.readByte(),$=n.readByte()<<8|n.readByte())}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(4),n.readBool()&&n.readBits(24)),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool()){var ne=n.readBits(32),J=n.readBits(32);he=n.readBool(),oe=(ae=J)/(ce=2*ne)}}var de=1;re===1&&$===1||(de=re/$);var b=0,R=0;h===0?(b=1,R=2-Y):(b=h===3?1:2,R=(h===1?2:1)*(2-Y));var B=16*(U+1),j=16*(Q+1)*(2-Y);B-=(X+ie)*b,j-=(se+V)*R;var z=Math.ceil(B*de);return n.destroy(),n=null,{profile_string:s,level_string:t,bit_depth:v,ref_frames:F,chroma_format:c,chroma_format_string:i.getChromaFormatString(c),frame_rate:{fixed:he,fps:oe,fps_den:ce,fps_num:ae},sar_ratio:{width:re,height:$},codec_size:{width:B,height:j},present_size:{width:z,height:j}}},i._skipScalingList=function(e,r){for(var n=8,a=8,_=0;_>>2!=0,t=(1&r[4])!=0,h=(a=r)[_=5]<<24|a[_+1]<<16|a[_+2]<<8|a[_+3];return h<9?n:{match:!0,consumed:h,dataOffset:h,hasAudioTrack:s,hasVideoTrack:t}},i.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(i.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),i.prototype.resetMediaInfo=function(){this._mediaInfo=new g.Z},i.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},i.prototype.parseChunks=function(e,r){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new L.rT("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,a=this._littleEndian;if(r===0){if(!(e.byteLength>13))return 0;n=i.probe(e).dataOffset}for(this._firstParse&&(this._firstParse=!1,r+n!==this._dataOffset&&f.Z.w(this.TAG,"First time parsing but chunk byteStart invalid!"),(_=new DataView(e,n)).getUint32(0,!a)!==0&&f.Z.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4);ne.byteLength)break;var s=_.getUint8(0),t=16777215&_.getUint32(0,!a);if(n+11+t+4>e.byteLength)break;if(s===8||s===9||s===18){var h=_.getUint8(4),c=_.getUint8(5),v=_.getUint8(6)|c<<8|h<<16|_.getUint8(7)<<24;(16777215&_.getUint32(7,!a))!=0&&f.Z.w(this.TAG,"Meet tag which has StreamID != 0!");var w=n+11;switch(s){case 8:this._parseAudioData(e,w,t,v);break;case 9:this._parseVideoData(e,w,t,v,r+n);break;case 18:this._parseScriptData(e,w,t)}var C=_.getUint32(11+t,!a);C!==11+t&&f.Z.w(this.TAG,"Invalid PrevTagSize "+C),n+=11+t+4}else f.Z.w(this.TAG,"Unsupported tag type "+s+", skipped"),n+=11+t+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),n},i.prototype._parseScriptData=function(e,r,n){var a=I.parseScriptData(e,r,n);if(a.hasOwnProperty("onMetaData")){if(a.onMetaData==null||typeof a.onMetaData!="object")return void f.Z.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&f.Z.w(this.TAG,"Found another onMetaData tag!"),this._metadata=a;var _=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},_)),typeof _.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=_.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof _.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=_.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof _.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=_.audiodatarate),typeof _.videodatarate=="number"&&(this._mediaInfo.videoDataRate=_.videodatarate),typeof _.width=="number"&&(this._mediaInfo.width=_.width),typeof _.height=="number"&&(this._mediaInfo.height=_.height),typeof _.duration=="number"){if(!this._durationOverrided){var s=Math.floor(_.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if(typeof _.framerate=="number"){var t=Math.floor(1e3*_.framerate);if(t>0){var h=t/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=h,this._referenceFrameRate.fps_num=t,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=h}}if(typeof _.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var c=_.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(c),_.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=_,f.Z.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(a).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},a))},i.prototype._parseKeyframesIndex=function(e){for(var r=[],n=[],a=1;a>>4;if(s===2||s===10){var t=0,h=(12&_)>>>2;if(h>=0&&h<=4){t=this._flvSoundRateTable[h];var c=1&_,v=this._audioMetadata,w=this._audioTrack;if(v||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(v=this._audioMetadata={}).type="audio",v.id=w.id,v.timescale=this._timescale,v.duration=this._duration,v.audioSampleRate=t,v.channelCount=c===0?1:2),s===10){var C=this._parseAACAudioData(e,r+1,n-1);if(C==null)return;if(C.packetType===0){v.config&&f.Z.w(this.TAG,"Found another AudioSpecificConfig!");var x=C.data;v.audioSampleRate=x.samplingRate,v.channelCount=x.channelCount,v.codec=x.codec,v.originalCodec=x.originalCodec,v.config=x.config,v.refSampleDuration=1024/v.audioSampleRate*v.timescale,f.Z.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",v),(U=this._mediaInfo).audioCodec=v.originalCodec,U.audioSampleRate=v.audioSampleRate,U.audioChannelCount=v.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(C.packetType===1){var G=this._timestampBase+a,F={unit:C.data,length:C.data.byteLength,dts:G,pts:G};w.samples.push(F),w.length+=C.data.length}else f.Z.e(this.TAG,"Flv: Unsupported AAC data type "+C.packetType)}else if(s===2){if(!v.codec){var U;if((x=this._parseMP3AudioData(e,r+1,n-1,!0))==null)return;v.audioSampleRate=x.samplingRate,v.channelCount=x.channelCount,v.codec=x.codec,v.originalCodec=x.originalCodec,v.refSampleDuration=1152/v.audioSampleRate*v.timescale,f.Z.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",v),(U=this._mediaInfo).audioCodec=v.codec,U.audioSampleRate=v.audioSampleRate,U.audioChannelCount=v.channelCount,U.audioDataRate=x.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 Q=this._parseMP3AudioData(e,r+1,n-1,!1);if(Q==null)return;G=this._timestampBase+a;var Y={unit:Q,length:Q.byteLength,dts:G,pts:G};w.samples.push(Y),w.length+=Q.length}}else this._onError(A.Z.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+h)}else this._onError(A.Z.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+s)}},i.prototype._parseAACAudioData=function(e,r,n){if(!(n<=1)){var a={},_=new Uint8Array(e,r,n);return a.packetType=_[0],_[0]===0?a.data=this._parseAACAudioSpecificConfig(e,r+1,n-1):a.data=_.subarray(1),a}f.Z.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},i.prototype._parseAACAudioSpecificConfig=function(e,r,n){var a,_,s=new Uint8Array(e,r,n),t=null,h=0,c=null;if(h=a=s[0]>>>3,(_=(7&s[0])<<1|s[1]>>>7)<0||_>=this._mpegSamplingRates.length)this._onError(A.Z.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var v=this._mpegSamplingRates[_],w=(120&s[1])>>>3;if(!(w<0||w>=8)){h===5&&(c=(7&s[1])<<1|s[2]>>>7,(124&s[2])>>>2);var C=self.navigator.userAgent.toLowerCase();return C.indexOf("firefox")!==-1?_>=6?(h=5,t=new Array(4),c=_-3):(h=2,t=new Array(2),c=_):C.indexOf("android")!==-1?(h=2,t=new Array(2),c=_):(h=5,c=_,t=new Array(4),_>=6?c=_-3:w===1&&(h=2,t=new Array(2),c=_)),t[0]=h<<3,t[0]|=(15&_)>>>1,t[1]=(15&_)<<7,t[1]|=(15&w)<<3,h===5&&(t[1]|=(15&c)>>>1,t[2]=(1&c)<<7,t[2]|=8,t[3]=0),{config:t,samplingRate:v,channelCount:w,codec:"mp4a.40."+h,originalCodec:"mp4a.40."+a}}this._onError(A.Z.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},i.prototype._parseMP3AudioData=function(e,r,n,a){if(!(n<4)){this._littleEndian;var _=new Uint8Array(e,r,n),s=null;if(a){if(_[0]!==255)return;var t=_[1]>>>3&3,h=(6&_[1])>>1,c=(240&_[2])>>>4,v=(12&_[2])>>>2,w=(_[3]>>>6&3)!=3?2:1,C=0,x=0;switch(t){case 0:C=this._mpegAudioV25SampleRateTable[v];break;case 2:C=this._mpegAudioV20SampleRateTable[v];break;case 3:C=this._mpegAudioV10SampleRateTable[v]}switch(h){case 1:c>>4,h=15&s;h===7?this._parseAVCVideoPacket(e,r+1,n-1,a,_,t):this._onError(A.Z.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+h)}},i.prototype._parseAVCVideoPacket=function(e,r,n,a,_,s){if(n<4)f.Z.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var t=this._littleEndian,h=new DataView(e,r,n),c=h.getUint8(0),v=(16777215&h.getUint32(0,!t))<<8>>8;if(c===0)this._parseAVCDecoderConfigurationRecord(e,r+4,n-4);else if(c===1)this._parseAVCVideoData(e,r+4,n-4,a,_,s,v);else if(c!==2)return void this._onError(A.Z.FORMAT_ERROR,"Flv: Invalid video packet type "+c)}},i.prototype._parseAVCDecoderConfigurationRecord=function(e,r,n){if(n<7)f.Z.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var a=this._videoMetadata,_=this._videoTrack,s=this._littleEndian,t=new DataView(e,r,n);a?a.avcc!==void 0&&f.Z.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(a=this._videoMetadata={}).type="video",a.id=_.id,a.timescale=this._timescale,a.duration=this._duration);var h=t.getUint8(0),c=t.getUint8(1);if(t.getUint8(2),t.getUint8(3),h===1&&c!==0)if(this._naluLengthSize=1+(3&t.getUint8(4)),this._naluLengthSize===3||this._naluLengthSize===4){var v=31&t.getUint8(5);if(v!==0){v>1&&f.Z.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+v);for(var w=6,C=0;C1&&f.Z.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+re),w++,C=0;C=n){f.Z.w(this.TAG,"Malformed Nalu near timestamp "+G+", offset = "+C+", dataSize = "+n);break}var U=c.getUint32(C,!h);if(x===3&&(U>>>=8),U>n-x)return void f.Z.w(this.TAG,"Malformed Nalus near timestamp "+G+", NaluSize > DataSize!");var Q=31&c.getUint8(C+x);Q===5&&(F=!0);var Y=new Uint8Array(e,r+C,x+U),X={type:Q,data:Y};v.push(X),w+=Y.byteLength,C+=x+U}if(v.length){var ie=this._videoTrack,se={units:v,length:w,isKeyframe:F,dts:G,cts:t,pts:G+t};F&&(se.fileposition=_),ie.samples.push(se),ie.length+=w}},i}(),S=function(){function i(){}return i.init=function(){for(var e in i.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},i.types)i.types.hasOwnProperty(e)&&(i.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=i.constants={};r.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),r.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),r.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),r.STSC=r.STCO=r.STTS,r.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),r.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),r.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),r.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},i.box=function(e){for(var r=8,n=null,a=Array.prototype.slice.call(arguments,1),_=a.length,s=0;s<_;s++)r+=a[s].byteLength;(n=new Uint8Array(r))[0]=r>>>24&255,n[1]=r>>>16&255,n[2]=r>>>8&255,n[3]=255&r,n.set(e,4);var t=8;for(s=0;s<_;s++)n.set(a[s],t),t+=a[s].byteLength;return n},i.generateInitSegment=function(e){var r=i.box(i.types.ftyp,i.constants.FTYP),n=i.moov(e),a=new Uint8Array(r.byteLength+n.byteLength);return a.set(r,0),a.set(n,r.byteLength),a},i.moov=function(e){var r=i.mvhd(e.timescale,e.duration),n=i.trak(e),a=i.mvex(e);return i.box(i.types.moov,r,n,a)},i.mvhd=function(e,r){return i.box(i.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,r>>>24&255,r>>>16&255,r>>>8&255,255&r,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]))},i.trak=function(e){return i.box(i.types.trak,i.tkhd(e),i.mdia(e))},i.tkhd=function(e){var r=e.id,n=e.duration,a=e.presentWidth,_=e.presentHeight;return i.box(i.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,_>>>8&255,255&_,0,0]))},i.mdia=function(e){return i.box(i.types.mdia,i.mdhd(e),i.hdlr(e),i.minf(e))},i.mdhd=function(e){var r=e.timescale,n=e.duration;return i.box(i.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},i.hdlr=function(e){var r=null;return r=e.type==="audio"?i.constants.HDLR_AUDIO:i.constants.HDLR_VIDEO,i.box(i.types.hdlr,r)},i.minf=function(e){var r=null;return r=e.type==="audio"?i.box(i.types.smhd,i.constants.SMHD):i.box(i.types.vmhd,i.constants.VMHD),i.box(i.types.minf,r,i.dinf(),i.stbl(e))},i.dinf=function(){return i.box(i.types.dinf,i.box(i.types.dref,i.constants.DREF))},i.stbl=function(e){return i.box(i.types.stbl,i.stsd(e),i.box(i.types.stts,i.constants.STTS),i.box(i.types.stsc,i.constants.STSC),i.box(i.types.stsz,i.constants.STSZ),i.box(i.types.stco,i.constants.STCO))},i.stsd=function(e){return e.type==="audio"?e.codec==="mp3"?i.box(i.types.stsd,i.constants.STSD_PREFIX,i.mp3(e)):i.box(i.types.stsd,i.constants.STSD_PREFIX,i.mp4a(e)):i.box(i.types.stsd,i.constants.STSD_PREFIX,i.avc1(e))},i.mp3=function(e){var r=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return i.box(i.types[".mp3"],a)},i.mp4a=function(e){var r=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return i.box(i.types.mp4a,a,i.esds(e))},i.esds=function(e){var r=e.config||[],n=r.length,a=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(r).concat([6,1,2]));return i.box(i.types.esds,a)},i.avc1=function(e){var r=e.avcc,n=e.codecWidth,a=e.codecHeight,_=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,n>>>8&255,255&n,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 i.box(i.types.avc1,_,i.box(i.types.avcC,r))},i.mvex=function(e){return i.box(i.types.mvex,i.trex(e))},i.trex=function(e){var r=e.id,n=new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return i.box(i.types.trex,n)},i.moof=function(e,r){return i.box(i.types.moof,i.mfhd(e.sequenceNumber),i.traf(e,r))},i.mfhd=function(e){var r=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return i.box(i.types.mfhd,r)},i.traf=function(e,r){var n=e.id,a=i.box(i.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),_=i.box(i.types.tfdt,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),s=i.sdtp(e),t=i.trun(e,s.byteLength+16+16+8+16+8+8);return i.box(i.types.traf,a,_,t,s)},i.sdtp=function(e){for(var r=e.samples||[],n=r.length,a=new Uint8Array(4+n),_=0;_>>24&255,a>>>16&255,a>>>8&255,255&a,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var t=0;t>>24&255,h>>>16&255,h>>>8&255,255&h,c>>>24&255,c>>>16&255,c>>>8&255,255&c,v.isLeading<<2|v.dependsOn,v.isDependedOn<<6|v.hasRedundancy<<4|v.isNonSync,0,0,w>>>24&255,w>>>16&255,w>>>8&255,255&w],12+16*t)}return i.box(i.types.trun,s)},i.mdat=function(e){return i.box(i.types.mdat,e)},i}();S.init();var P=S,y=function(){function i(){}return i.getSilentFrame=function(e,r){if(e==="mp4a.40.2"){if(r===1)return new Uint8Array([0,200,0,128,35,128]);if(r===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(r===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(r===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(r===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(r===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(r===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(r===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(r===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},i}(),o=T(51),u=function(){function i(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=e.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 o.J1("audio"),this._videoSegmentInfoList=new o.J1("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!p.Z.chrome||!(p.Z.version.major<50||p.Z.version.major===50&&p.Z.version.build<2661)),this._fillSilentAfterSeek=p.Z.msedge||p.Z.msie,this._mp3UseMpegAudio=!p.Z.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return i.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},i.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(i.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),i.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},i.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},i.prototype.remux=function(e,r){if(!this._onMediaSegment)throw new L.rT("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,r),this._remuxVideo(r),this._remuxAudio(e)},i.prototype._onTrackMetadataReceived=function(e,r){var n=null,a="mp4",_=r.codec;if(e==="audio")this._audioMeta=r,r.codec==="mp3"&&this._mp3UseMpegAudio?(a="mpeg",_="",n=new Uint8Array):n=P.generateInitSegment(r);else{if(e!=="video")return;this._videoMeta=r,n=P.generateInitSegment(r)}if(!this._onInitSegment)throw new L.rT("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:_,container:e+"/"+a,mediaDuration:r.duration})},i.prototype._calculateDtsBase=function(e,r){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),r.samples&&r.samples.length&&(this._videoDtsBase=r.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},i.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,r=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};e!=null&&(n.samples.push(e),n.length=e.length);var a={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};r!=null&&(a.samples.push(r),a.length=r.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(a,!0)},i.prototype._remuxAudio=function(e,r){if(this._audioMeta!=null){var n,a=e,_=a.samples,s=void 0,t=-1,h=this._audioMeta.refSampleDuration,c=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,v=this._dtsBaseInited&&this._audioNextDts===void 0,w=!1;if(_&&_.length!==0&&(_.length!==1||r)){var C=0,x=null,G=0;c?(C=0,G=a.length):(C=8,G=8+a.length);var F=null;if(_.length>1&&(G-=(F=_.pop()).length),this._audioStashedLastSample!=null){var U=this._audioStashedLastSample;this._audioStashedLastSample=null,_.unshift(U),G+=U.length}F!=null&&(this._audioStashedLastSample=F);var Q=_[0].dts-this._dtsBase;if(this._audioNextDts)s=Q-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())s=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(w=!0);else{var Y=this._audioSegmentInfoList.getLastSampleBefore(Q);if(Y!=null){var X=Q-(Y.originalDts+Y.duration);X<=3&&(X=0),s=Q-(Y.dts+Y.duration+X)}else s=0}if(w){var ie=Q-s,se=this._videoSegmentInfoList.getLastSegmentBefore(Q);if(se!=null&&se.beginDts=3*h&&this._fillAudioTimestampGap&&!p.Z.safari){ce=!0;var de,b=Math.floor(s/h);f.Z.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. originalDts: `+ae+" ms, curRefDts: "+J+" ms, dtsCorrection: "+Math.round(s)+" ms, generate: "+b+" frames"),V=Math.floor(J),ne=Math.floor(J+h)-V,(de=y.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))==null&&(f.Z.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),de=he),ue=[];for(var R=0;R=1?$[$.length-1].duration:Math.floor(h),this._audioNextDts=V+ne;t===-1&&(t=V),$.push({dts:V,pts:V,cts:0,unit:U.unit,size:U.unit.byteLength,duration:ne,originalDts:ae,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ce&&$.push.apply($,ue)}}if($.length===0)return a.samples=[],void(a.length=0);for(c?x=new Uint8Array(G):((x=new Uint8Array(G))[0]=G>>>24&255,x[1]=G>>>16&255,x[2]=G>>>8&255,x[3]=255&G,x.set(P.types.mdat,4)),oe=0;oe<$.length;oe++)he=$[oe].unit,x.set(he,C),C+=he.byteLength;var q=$[$.length-1];n=q.dts+q.duration;var te=new o.Yy;te.beginDts=t,te.endDts=n,te.beginPts=t,te.endPts=n,te.originalBeginDts=$[0].originalDts,te.originalEndDts=q.originalDts+q.duration,te.firstSample=new o.Wk($[0].dts,$[0].pts,$[0].duration,$[0].originalDts,!1),te.lastSample=new o.Wk(q.dts,q.pts,q.duration,q.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(te),a.samples=$,a.sequenceNumber++;var _e=null;_e=c?new Uint8Array:P.moof(a,t),a.samples=[],a.length=0;var fe={type:"audio",data:this._mergeBoxes(_e,x).buffer,sampleCount:$.length,info:te};c&&v&&(fe.timestampOffset=t),this._onMediaSegment("audio",fe)}}},i.prototype._remuxVideo=function(e,r){if(this._videoMeta!=null){var n,a,_=e,s=_.samples,t=void 0,h=-1,c=-1;if(s&&s.length!==0&&(s.length!==1||r)){var v=8,w=null,C=8+e.length,x=null;if(s.length>1&&(C-=(x=s.pop()).length),this._videoStashedLastSample!=null){var G=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(G),C+=G.length}x!=null&&(this._videoStashedLastSample=x);var F=s[0].dts-this._dtsBase;if(this._videoNextDts)t=F-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())t=0;else{var U=this._videoSegmentInfoList.getLastSampleBefore(F);if(U!=null){var Q=F-(U.originalDts+U.duration);Q<=3&&(Q=0),t=F-(U.dts+U.duration+Q)}else t=0}for(var Y=new o.Yy,X=[],ie=0;ie=1?X[X.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),V){var ae=new o.Wk(re,oe,he,G.dts,!0);ae.fileposition=G.fileposition,Y.appendSyncPoint(ae)}X.push({dts:re,pts:oe,cts:$,units:G.units,size:G.length,isKeyframe:V,duration:he,originalDts:se,flags:{isLeading:0,dependsOn:V?2:1,isDependedOn:V?1:0,hasRedundancy:0,isNonSync:V?0:1}})}for((w=new Uint8Array(C))[0]=C>>>24&255,w[1]=C>>>16&255,w[2]=C>>>8&255,w[3]=255&C,w.set(P.types.mdat,4),ie=0;ie0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,_=this._demuxer.parseChunks(e,r);else if((a=O.probe(e)).match){this._demuxer=new O(a,this._config),this._remuxer||(this._remuxer=new u(this._config));var s=this._mediaDataSource;s.duration==null||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),typeof s.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=s.hasAudio),typeof s.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.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),_=this._demuxer.parseChunks(e,r)}else a=null,f.Z.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){n._internalAbort()}),this._emitter.emit(l.Z.DEMUX_ERROR,A.Z.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),_=0;return _},i.prototype._onMediaInfo=function(e){var r=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,g.Z.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,g.Z.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var a=r._pendingSeekTime;r._pendingSeekTime=null,r.seek(a)})},i.prototype._onMetaDataArrived=function(e){this._emitter.emit(l.Z.METADATA_ARRIVED,e)},i.prototype._onScriptDataArrived=function(e){this._emitter.emit(l.Z.SCRIPTDATA_ARRIVED,e)},i.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},i.prototype._onIOComplete=function(e){var r=e+1;r0&&n[0].originalDts===a&&(a=n[0].pts),this._emitter.emit(l.Z.RECOMMEND_SEEKPOINT,a)}},i.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},i.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},i.prototype._reportSegmentMediaInfo=function(e){var r=this._mediaInfo.segments[e],n=Object.assign({},r);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(l.Z.MEDIA_INFO,n)},i.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(l.Z.STATISTICS_INFO,e)},i}()},257:function(W,K){"use strict";K.Z={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",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},82:function(W,K,T){"use strict";T(846),T(219),T(949),T(257)},600:function(W,K){"use strict";K.Z={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},60:function(W,K,T){"use strict";T.d(K,{default:function(){return _}});var N=T(219),Z=T(191),f={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function p(){return Object.assign({},f)}var g=function(){function s(){}return s.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},s.supportNetworkStreamIO=function(){var t=new Z.Z({},p()),h=t.loaderType;return t.destroy(),h=="fetch-stream-loader"||h=="xhr-moz-chunked-loader"},s.getNetworkLoaderTypeName=function(){var t=new Z.Z({},p()),h=t.loaderType;return t.destroy(),h},s.supportNativeMediaPlayback=function(t){s.videoElement==null&&(s.videoElement=window.document.createElement("video"));var h=s.videoElement.canPlayType(t);return h==="probably"||h=="maybe"},s.getFeatureList=function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=s.supportMSEH264Playback(),t.networkStreamIO=s.supportNetworkStreamIO(),t.networkLoaderName=s.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=s.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeWebmVP8Playback=s.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=s.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},s}(),m=T(939),E=T(716),M=T.n(E),L=T(300),D=T(538),I={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},H=T(397),ee=T.n(H),A=T(846),O=T(949),S=T(257),P=T(118),y=function(){function s(t,h){if(this.TAG="Transmuxer",this._emitter=new(M()),h.enableWorker&&typeof Worker!="undefined")try{this._worker=ee()(82),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,h]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},A.Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:A.Z.getConfig()})}catch(v){L.Z.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new O.Z(t,h)}else this._controller=new O.Z(t,h);if(this._controller){var c=this._controller;c.on(S.Z.IO_ERROR,this._onIOError.bind(this)),c.on(S.Z.DEMUX_ERROR,this._onDemuxError.bind(this)),c.on(S.Z.INIT_SEGMENT,this._onInitSegment.bind(this)),c.on(S.Z.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),c.on(S.Z.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),c.on(S.Z.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),c.on(S.Z.MEDIA_INFO,this._onMediaInfo.bind(this)),c.on(S.Z.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),c.on(S.Z.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),c.on(S.Z.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),c.on(S.Z.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return s.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),A.Z.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},s.prototype.on=function(t,h){this._emitter.addListener(t,h)},s.prototype.off=function(t,h){this._emitter.removeListener(t,h)},s.prototype.hasWorker=function(){return this._worker!=null},s.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},s.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},s.prototype.seek=function(t){this._worker?this._worker.postMessage({cmd:"seek",param:t}):this._controller.seek(t)},s.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},s.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},s.prototype._onInitSegment=function(t,h){var c=this;Promise.resolve().then(function(){c._emitter.emit(S.Z.INIT_SEGMENT,t,h)})},s.prototype._onMediaSegment=function(t,h){var c=this;Promise.resolve().then(function(){c._emitter.emit(S.Z.MEDIA_SEGMENT,t,h)})},s.prototype._onLoadingComplete=function(){var t=this;Promise.resolve().then(function(){t._emitter.emit(S.Z.LOADING_COMPLETE)})},s.prototype._onRecoveredEarlyEof=function(){var t=this;Promise.resolve().then(function(){t._emitter.emit(S.Z.RECOVERED_EARLY_EOF)})},s.prototype._onMediaInfo=function(t){var h=this;Promise.resolve().then(function(){h._emitter.emit(S.Z.MEDIA_INFO,t)})},s.prototype._onMetaDataArrived=function(t){var h=this;Promise.resolve().then(function(){h._emitter.emit(S.Z.METADATA_ARRIVED,t)})},s.prototype._onScriptDataArrived=function(t){var h=this;Promise.resolve().then(function(){h._emitter.emit(S.Z.SCRIPTDATA_ARRIVED,t)})},s.prototype._onStatisticsInfo=function(t){var h=this;Promise.resolve().then(function(){h._emitter.emit(S.Z.STATISTICS_INFO,t)})},s.prototype._onIOError=function(t,h){var c=this;Promise.resolve().then(function(){c._emitter.emit(S.Z.IO_ERROR,t,h)})},s.prototype._onDemuxError=function(t,h){var c=this;Promise.resolve().then(function(){c._emitter.emit(S.Z.DEMUX_ERROR,t,h)})},s.prototype._onRecommendSeekpoint=function(t){var h=this;Promise.resolve().then(function(){h._emitter.emit(S.Z.RECOMMEND_SEEKPOINT,t)})},s.prototype._onLoggingConfigChanged=function(t){this._worker&&this._worker.postMessage({cmd:"logging_config",param:t})},s.prototype._onWorkerMessage=function(t){var h=t.data,c=h.data;if(h.msg==="destroyed"||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(h.msg){case S.Z.INIT_SEGMENT:case S.Z.MEDIA_SEGMENT:this._emitter.emit(h.msg,c.type,c.data);break;case S.Z.LOADING_COMPLETE:case S.Z.RECOVERED_EARLY_EOF:this._emitter.emit(h.msg);break;case S.Z.MEDIA_INFO:Object.setPrototypeOf(c,P.Z.prototype),this._emitter.emit(h.msg,c);break;case S.Z.METADATA_ARRIVED:case S.Z.SCRIPTDATA_ARRIVED:case S.Z.STATISTICS_INFO:this._emitter.emit(h.msg,c);break;case S.Z.IO_ERROR:case S.Z.DEMUX_ERROR:this._emitter.emit(h.msg,c.type,c.info);break;case S.Z.RECOMMEND_SEEKPOINT:this._emitter.emit(h.msg,c);break;case"logcat_callback":L.Z.emitter.emit("log",c.type,c.logcat)}},s}(),o={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},u=T(51),d=T(29),l=function(){function s(t){this.TAG="MSEController",this._config=t,this._emitter=new(M()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new u.Vn}return s.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},s.prototype.on=function(t,h){this._emitter.addListener(t,h)},s.prototype.off=function(t,h){this._emitter.removeListener(t,h)},s.prototype.attachMediaElement=function(t){if(this._mediaSource)throw new d.rT("MediaSource has been attached to an HTMLMediaElement!");var h=this._mediaSource=new window.MediaSource;h.addEventListener("sourceopen",this.e.onSourceOpen),h.addEventListener("sourceended",this.e.onSourceEnded),h.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=t,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),t.src=this._mediaSourceObjectURL},s.prototype.detachMediaElement=function(){if(this._mediaSource){var t=this._mediaSource;for(var h in this._sourceBuffers){var c=this._pendingSegments[h];c.splice(0,c.length),this._pendingSegments[h]=null,this._pendingRemoveRanges[h]=null,this._lastInitSegments[h]=null;var v=this._sourceBuffers[h];if(v){if(t.readyState!=="closed"){try{t.removeSourceBuffer(v)}catch(w){L.Z.e(this.TAG,w.message)}v.removeEventListener("error",this.e.onSourceBufferError),v.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[h]=null,this._sourceBuffers[h]=null}}if(t.readyState==="open")try{t.endOfStream()}catch(w){L.Z.e(this.TAG,w.message)}t.removeEventListener("sourceopen",this.e.onSourceOpen),t.removeEventListener("sourceended",this.e.onSourceEnded),t.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},s.prototype.appendInitSegment=function(t,h){if(!this._mediaSource||this._mediaSource.readyState!=="open")return this._pendingSourceBufferInit.push(t),void this._pendingSegments[t.type].push(t);var c=t,v=""+c.container;c.codec&&c.codec.length>0&&(v+=";codecs="+c.codec);var w=!1;if(L.Z.v(this.TAG,"Received Initialization Segment, mimeType: "+v),this._lastInitSegments[c.type]=c,v!==this._mimeTypes[c.type]){if(this._mimeTypes[c.type])L.Z.v(this.TAG,"Notice: "+c.type+" mimeType changed, origin: "+this._mimeTypes[c.type]+", target: "+v);else{w=!0;try{var C=this._sourceBuffers[c.type]=this._mediaSource.addSourceBuffer(v);C.addEventListener("error",this.e.onSourceBufferError),C.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(x){return L.Z.e(this.TAG,x.message),void this._emitter.emit(o.ERROR,{code:x.code,msg:x.message})}}this._mimeTypes[c.type]=v}h||this._pendingSegments[c.type].push(c),w||this._sourceBuffers[c.type]&&!this._sourceBuffers[c.type].updating&&this._doAppendSegments(),D.Z.safari&&c.container==="audio/mpeg"&&c.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=c.mediaDuration/1e3,this._updateMediaSourceDuration())},s.prototype.appendMediaSegment=function(t){var h=t;this._pendingSegments[h.type].push(h),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var c=this._sourceBuffers[h.type];!c||c.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},s.prototype.seek=function(t){for(var h in this._sourceBuffers)if(this._sourceBuffers[h]){var c=this._sourceBuffers[h];if(this._mediaSource.readyState==="open")try{c.abort()}catch(F){L.Z.e(this.TAG,F.message)}this._idrList.clear();var v=this._pendingSegments[h];if(v.splice(0,v.length),this._mediaSource.readyState!=="closed"){for(var w=0;w=1&&t-v.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},s.prototype._doCleanupSourceBuffer=function(){var t=this._mediaElement.currentTime;for(var h in this._sourceBuffers){var c=this._sourceBuffers[h];if(c){for(var v=c.buffered,w=!1,C=0;C=this._config.autoCleanupMaxBackwardDuration){w=!0;var F=t-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[h].push({start:x,end:F})}}else G0&&(isNaN(h)||c>h)&&(L.Z.v(this.TAG,"Update MediaSource duration from "+h+" to "+c),this._mediaSource.duration=c),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},s.prototype._doRemoveRanges=function(){for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating)for(var h=this._sourceBuffers[t],c=this._pendingRemoveRanges[t];c.length&&!h.updating;){var v=c.shift();h.remove(v.start,v.end)}},s.prototype._doAppendSegments=function(){var t=this._pendingSegments;for(var h in t)if(this._sourceBuffers[h]&&!this._sourceBuffers[h].updating&&t[h].length>0){var c=t[h].shift();if(c.timestampOffset){var v=this._sourceBuffers[h].timestampOffset,w=c.timestampOffset/1e3;Math.abs(v-w)>.1&&(L.Z.v(this.TAG,"Update MPEG audio timestampOffset from "+v+" to "+w),this._sourceBuffers[h].timestampOffset=w),delete c.timestampOffset}if(!c.data||c.data.byteLength===0)continue;try{this._sourceBuffers[h].appendBuffer(c.data),this._isBufferFull=!1,h==="video"&&c.hasOwnProperty("info")&&this._idrList.appendArray(c.info.syncPoints)}catch(C){this._pendingSegments[h].unshift(c),C.code===22?(this._isBufferFull||this._emitter.emit(o.BUFFER_FULL),this._isBufferFull=!0):(L.Z.e(this.TAG,C.message),this._emitter.emit(o.ERROR,{code:C.code,msg:C.message}))}}},s.prototype._onSourceOpen=function(){if(L.Z.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var h=t.shift();this.appendInitSegment(h,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(o.SOURCE_OPEN)},s.prototype._onSourceEnded=function(){L.Z.v(this.TAG,"MediaSource onSourceEnded")},s.prototype._onSourceClose=function(){L.Z.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))},s.prototype._hasPendingSegments=function(){var t=this._pendingSegments;return t.video.length>0||t.audio.length>0},s.prototype._hasPendingRemoveRanges=function(){var t=this._pendingRemoveRanges;return t.video.length>0||t.audio.length>0},s.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(o.UPDATE_END)},s.prototype._onSourceBufferError=function(t){L.Z.e(this.TAG,"SourceBuffer Error: "+t)},s}(),k=T(600),i={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},e={NETWORK_EXCEPTION:m.nm.EXCEPTION,NETWORK_STATUS_CODE_INVALID:m.nm.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:m.nm.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:m.nm.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:k.Z.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:k.Z.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:k.Z.CODEC_UNSUPPORTED},r=function(){function s(t,h){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(M()),this._config=p(),typeof h=="object"&&Object.assign(this._config,h),t.type.toLowerCase()!=="flv")throw new d.OC("FlvPlayer requires an flv MediaDataSource input!");t.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=t,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 c=D.Z.chrome&&(D.Z.version.major<50||D.Z.version.major===50&&D.Z.version.build<2661);this._alwaysSeekKeyframe=!!(c||D.Z.msedge||D.Z.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return s.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},s.prototype.on=function(t,h){var c=this;t===I.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){c._emitter.emit(I.MEDIA_INFO,c.mediaInfo)}):t===I.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){c._emitter.emit(I.STATISTICS_INFO,c.statisticsInfo)}),this._emitter.addListener(t,h)},s.prototype.off=function(t,h){this._emitter.removeListener(t,h)},s.prototype.attachMediaElement=function(t){var h=this;if(this._mediaElement=t,t.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),t.addEventListener("seeking",this.e.onvSeeking),t.addEventListener("canplay",this.e.onvCanPlay),t.addEventListener("stalled",this.e.onvStalled),t.addEventListener("progress",this.e.onvProgress),this._msectl=new l(this._config),this._msectl.on(o.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(o.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(o.SOURCE_OPEN,function(){h._mseSourceOpened=!0,h._hasPendingLoad&&(h._hasPendingLoad=!1,h.load())}),this._msectl.on(o.ERROR,function(c){h._emitter.emit(I.ERROR,i.MEDIA_ERROR,e.MEDIA_MSE_ERROR,c)}),this._msectl.attachMediaElement(t),this._pendingSeekTime!=null)try{t.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(c){}},s.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)},s.prototype.load=function(){var t=this;if(!this._mediaElement)throw new d.rT("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new d.rT("FlvPlayer.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 y(this._mediaDataSource,this._config),this._transmuxer.on(S.Z.INIT_SEGMENT,function(h,c){t._msectl.appendInitSegment(c)}),this._transmuxer.on(S.Z.MEDIA_SEGMENT,function(h,c){if(t._msectl.appendMediaSegment(c),t._config.lazyLoad&&!t._config.isLive){var v=t._mediaElement.currentTime;c.info.endDts>=1e3*(v+t._config.lazyLoadMaxDuration)&&t._progressChecker==null&&(L.Z.v(t.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),t._suspendTransmuxer())}}),this._transmuxer.on(S.Z.LOADING_COMPLETE,function(){t._msectl.endOfStream(),t._emitter.emit(I.LOADING_COMPLETE)}),this._transmuxer.on(S.Z.RECOVERED_EARLY_EOF,function(){t._emitter.emit(I.RECOVERED_EARLY_EOF)}),this._transmuxer.on(S.Z.IO_ERROR,function(h,c){t._emitter.emit(I.ERROR,i.NETWORK_ERROR,h,c)}),this._transmuxer.on(S.Z.DEMUX_ERROR,function(h,c){t._emitter.emit(I.ERROR,i.MEDIA_ERROR,h,{code:-1,msg:c})}),this._transmuxer.on(S.Z.MEDIA_INFO,function(h){t._mediaInfo=h,t._emitter.emit(I.MEDIA_INFO,Object.assign({},h))}),this._transmuxer.on(S.Z.METADATA_ARRIVED,function(h){t._emitter.emit(I.METADATA_ARRIVED,h)}),this._transmuxer.on(S.Z.SCRIPTDATA_ARRIVED,function(h){t._emitter.emit(I.SCRIPTDATA_ARRIVED,h)}),this._transmuxer.on(S.Z.STATISTICS_INFO,function(h){t._statisticsInfo=t._fillStatisticsInfo(h),t._emitter.emit(I.STATISTICS_INFO,Object.assign({},t._statisticsInfo))}),this._transmuxer.on(S.Z.RECOMMEND_SEEKPOINT,function(h){t._mediaElement&&!t._config.accurateSeek&&(t._requestSetTime=!0,t._mediaElement.currentTime=h/1e3)}),this._transmuxer.open()))},s.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)},s.prototype.play=function(){return this._mediaElement.play()},s.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(s.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(t){this._mediaElement.volume=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(t){this._mediaElement.muted=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(t){this._mediaElement?this._internalSeek(t):this._pendingSeekTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),s.prototype._fillStatisticsInfo=function(t){if(t.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return t;var h=!0,c=0,v=0;if(this._mediaElement.getVideoPlaybackQuality){var w=this._mediaElement.getVideoPlaybackQuality();c=w.totalVideoFrames,v=w.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(c=this._mediaElement.webkitDecodedFrameCount,v=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(t.decodedFrames=c,t.droppedFrames=v),t},s.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var t=this._mediaElement.buffered,h=this._mediaElement.currentTime,c=0,v=0;v=h+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(L.Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},s.prototype._onmseBufferFull=function(){L.Z.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},s.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},s.prototype._checkProgressAndResume=function(){for(var t=this._mediaElement.currentTime,h=this._mediaElement.buffered,c=!1,v=0;v=w&&t=C-this._config.lazyLoadRecoverDuration&&(c=!0);break}}c&&(window.clearInterval(this._progressChecker),this._progressChecker=null,c&&(L.Z.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},s.prototype._isTimepointBuffered=function(t){for(var h=this._mediaElement.buffered,c=0;c=v&&t0){var w=this._mediaElement.buffered.start(0);(w<1&&t0&&h.currentTime0){var v=c.start(0);if(v<1&&h0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},s.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},s.prototype.play=function(){return this._mediaElement.play()},s.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(s.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(t){this._mediaElement.volume=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(t){this._mediaElement.muted=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(t){this._mediaElement?this._mediaElement.currentTime=t:this._pendingSeekTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mediaInfo",{get:function(){var t={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"statisticsInfo",{get:function(){var t={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return t;var h=!0,c=0,v=0;if(this._mediaElement.getVideoPlaybackQuality){var w=this._mediaElement.getVideoPlaybackQuality();c=w.totalVideoFrames,v=w.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(c=this._mediaElement.webkitDecodedFrameCount,v=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(t.decodedFrames=c,t.droppedFrames=v),t},enumerable:!1,configurable:!0}),s.prototype._onvLoadedMetadata=function(t){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(I.MEDIA_INFO,this.mediaInfo)},s.prototype._reportStatisticsInfo=function(){this._emitter.emit(I.STATISTICS_INFO,this.statisticsInfo)},s}();N.Z.install();var a={createPlayer:function(s,t){var h=s;if(h==null||typeof h!="object")throw new d.OC("MediaDataSource must be an javascript object!");if(!h.hasOwnProperty("type"))throw new d.OC("MediaDataSource must has type field to indicate video file type!");switch(h.type){case"flv":return new r(h,t);default:return new n(h,t)}},isSupported:function(){return g.supportMSEH264Playback()},getFeatureList:function(){return g.getFeatureList()}};a.BaseLoader=m.fp,a.LoaderStatus=m.GM,a.LoaderErrors=m.nm,a.Events=I,a.ErrorTypes=i,a.ErrorDetails=e,a.FlvPlayer=r,a.NativePlayer=n,a.LoggingControl=A.Z,Object.defineProperty(a,"version",{enumerable:!0,get:function(){return"1.6.2"}});var _=a},324:function(W,K,T){W.exports=T(60).default},191:function(W,K,T){"use strict";T.d(K,{Z:function(){return P}});var N,Z=T(300),f=function(){function y(){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 y.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},y.prototype.addBytes=function(o){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=o,this._totalBytes+=o):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=o,this._totalBytes+=o):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=o,this._totalBytes+=o,this._lastCheckpoint=this._now())},Object.defineProperty(y.prototype,"currentKBps",{get:function(){this.addBytes(0);var o=(this._now()-this._lastCheckpoint)/1e3;return o==0&&(o=1),this._intervalBytes/o/1024},enumerable:!1,configurable:!0}),Object.defineProperty(y.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(y.prototype,"averageKBps",{get:function(){var o=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/o/1024},enumerable:!1,configurable:!0}),y}(),p=T(939),g=T(538),m=T(29),E=(N=function(y,o){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var l in d)Object.prototype.hasOwnProperty.call(d,l)&&(u[l]=d[l])})(y,o)},function(y,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function u(){this.constructor=y}N(y,o),y.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)}),M=function(y){function o(u,d){var l=y.call(this,"fetch-stream-loader")||this;return l.TAG="FetchStreamLoader",l._seekHandler=u,l._config=d,l._needStash=!0,l._requestAbort=!1,l._contentLength=null,l._receivedLength=0,l}return E(o,y),o.isSupported=function(){try{var u=g.Z.msedge&&g.Z.version.minor>=15048,d=!g.Z.msedge||u;return self.fetch&&self.ReadableStream&&d}catch(l){return!1}},o.prototype.destroy=function(){this.isWorking()&&this.abort(),y.prototype.destroy.call(this)},o.prototype.open=function(u,d){var l=this;this._dataSource=u,this._range=d;var k=u.url;this._config.reuseRedirectedURL&&u.redirectedURL!=null&&(k=u.redirectedURL);var i=this._seekHandler.getConfig(k,d),e=new self.Headers;if(typeof i.headers=="object"){var r=i.headers;for(var n in r)r.hasOwnProperty(n)&&e.append(n,r[n])}var a={method:"GET",headers:e,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var n in this._config.headers)e.append(n,this._config.headers[n]);u.cors===!1&&(a.mode="same-origin"),u.withCredentials&&(a.credentials="include"),u.referrerPolicy&&(a.referrerPolicy=u.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,a.signal=this._abortController.signal),this._status=p.GM.kConnecting,self.fetch(i.url,a).then(function(_){if(l._requestAbort)return l._status=p.GM.kIdle,void _.body.cancel();if(_.ok&&_.status>=200&&_.status<=299){if(_.url!==i.url&&l._onURLRedirect){var s=l._seekHandler.removeURLParameters(_.url);l._onURLRedirect(s)}var t=_.headers.get("Content-Length");return t!=null&&(l._contentLength=parseInt(t),l._contentLength!==0&&l._onContentLengthKnown&&l._onContentLengthKnown(l._contentLength)),l._pump.call(l,_.body.getReader())}if(l._status=p.GM.kError,!l._onError)throw new m.OZ("FetchStreamLoader: Http code invalid, "+_.status+" "+_.statusText);l._onError(p.nm.HTTP_STATUS_CODE_INVALID,{code:_.status,msg:_.statusText})}).catch(function(_){if(!l._abortController||!l._abortController.signal.aborted){if(l._status=p.GM.kError,!l._onError)throw _;l._onError(p.nm.EXCEPTION,{code:-1,msg:_.message})}})},o.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==p.GM.kBuffering||!g.Z.chrome)&&this._abortController)try{this._abortController.abort()}catch(u){}},o.prototype._pump=function(u){var d=this;return u.read().then(function(l){if(l.done)if(d._contentLength!==null&&d._receivedLength299)){if(this._status=p.GM.kError,!this._onError)throw new m.OZ("MozChunkedLoader: Http code invalid, "+d.status+" "+d.statusText);this._onError(p.nm.HTTP_STATUS_CODE_INVALID,{code:d.status,msg:d.statusText})}else this._status=p.GM.kBuffering}},o.prototype._onProgress=function(u){if(this._status!==p.GM.kError){this._contentLength===null&&u.total!==null&&u.total!==0&&(this._contentLength=u.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var d=u.target.response,l=this._range.from+this._receivedLength;this._receivedLength+=d.byteLength,this._onDataArrival&&this._onDataArrival(d,l,this._receivedLength)}},o.prototype._onLoadEnd=function(u){this._requestAbort!==!0?this._status!==p.GM.kError&&(this._status=p.GM.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},o.prototype._onXhrError=function(u){this._status=p.GM.kError;var d=0,l=null;if(this._contentLength&&u.loaded=this._contentLength&&(l=this._range.from+this._contentLength-1),this._currentRequestRange={from:d,to:l},this._internalOpen(this._dataSource,this._currentRequestRange)},o.prototype._internalOpen=function(u,d){this._lastTimeLoaded=0;var l=u.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?l=this._currentRedirectedURL:u.redirectedURL!=null&&(l=u.redirectedURL));var k=this._seekHandler.getConfig(l,d);this._currentRequestURL=k.url;var i=this._xhr=new XMLHttpRequest;if(i.open("GET",k.url,!0),i.responseType="arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onload=this._onLoad.bind(this),i.onerror=this._onXhrError.bind(this),u.withCredentials&&(i.withCredentials=!0),typeof k.headers=="object"){var e=k.headers;for(var r in e)e.hasOwnProperty(r)&&i.setRequestHeader(r,e[r])}if(typeof this._config.headers=="object"){e=this._config.headers;for(var r in e)e.hasOwnProperty(r)&&i.setRequestHeader(r,e[r])}i.send()},o.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=p.GM.kComplete},o.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)},o.prototype._onReadyStateChange=function(u){var d=u.target;if(d.readyState===2){if(d.responseURL!=null){var l=this._seekHandler.removeURLParameters(d.responseURL);d.responseURL!==this._currentRequestURL&&l!==this._currentRedirectedURL&&(this._currentRedirectedURL=l,this._onURLRedirect&&this._onURLRedirect(l))}if(d.status>=200&&d.status<=299){if(this._waitForTotalLength)return;this._status=p.GM.kBuffering}else{if(this._status=p.GM.kError,!this._onError)throw new m.OZ("RangeLoader: Http code invalid, "+d.status+" "+d.statusText);this._onError(p.nm.HTTP_STATUS_CODE_INVALID,{code:d.status,msg:d.statusText})}}},o.prototype._onProgress=function(u){if(this._status!==p.GM.kError){if(this._contentLength===null){var d=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,d=!0;var l=u.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,d)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var k=u.loaded-this._lastTimeLoaded;this._lastTimeLoaded=u.loaded,this._speedSampler.addBytes(k)}},o.prototype._normalizeSpeed=function(u){var d=this._chunkSizeKBList,l=d.length-1,k=0,i=0,e=l;if(u=d[k]&&u=3&&(d=this._speedSampler.currentKBps)),d!==0){var l=this._normalizeSpeed(d);this._currentSpeedNormalized!==l&&(this._currentSpeedNormalized=l,this._currentChunkSizeKB=l)}var k=u.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=k.byteLength;var e=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var i=d.split("&"),e=0;e0;r[0]!==this._startName&&r[0]!==this._endName&&(n&&(k+="&"),k+=i[e])}return k.length===0?u:u+"?"+k},y}(),P=function(){function y(o,u,d){this.TAG="IOController",this._config=u,this._extraData=d,this._stashInitialSize=393216,u.stashInitialSize!=null&&u.stashInitialSize>0&&(this._stashInitialSize=u.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,u.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=o,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(o.url),this._refTotalLength=o.filesize?o.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new f,this._speedNormalizeList=[64,128,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 y.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},y.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},y.prototype.isPaused=function(){return this._paused},Object.defineProperty(y.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"extraData",{get:function(){return this._extraData},set:function(o){this._extraData=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(o){this._onDataArrival=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(o){this._onSeeked=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onError",{get:function(){return this._onError},set:function(o){this._onError=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onComplete",{get:function(){return this._onComplete},set:function(o){this._onComplete=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(o){this._onRedirect=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(o){this._onRecoveredEarlyEof=o},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"currentSpeed",{get:function(){return this._loaderClass===H?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),y.prototype._selectSeekHandler=function(){var o=this._config;if(o.seekType==="range")this._seekHandler=new O(this._config.rangeLoadZeroStart);else if(o.seekType==="param"){var u=o.seekParamStart||"bstart",d=o.seekParamEnd||"bend";this._seekHandler=new S(u,d)}else{if(o.seekType!=="custom")throw new m.OC("Invalid seekType in config: "+o.seekType);if(typeof o.customSeekHandler!="function")throw new m.OC("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new o.customSeekHandler}},y.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=A;else if(M.isSupported())this._loaderClass=M;else if(D.isSupported())this._loaderClass=D;else{if(!H.isSupported())throw new m.OZ("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=H}},y.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)},y.prototype.open=function(o){this._currentRange={from:0,to:-1},o&&(this._currentRange.from=o),this._speedSampler.reset(),o||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},y.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},y.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)},y.prototype.resume=function(){if(this._paused){this._paused=!1;var o=this._resumeFrom;this._resumeFrom=0,this._internalSeek(o,!0)}},y.prototype.seek=function(o){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(o,!0)},y.prototype._internalSeek=function(o,u){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(u),this._loader.destroy(),this._loader=null;var d={from:o,to:-1};this._currentRange={from:d.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,d),this._onSeeked&&this._onSeeked()},y.prototype.updateUrl=function(o){if(!o||typeof o!="string"||o.length===0)throw new m.OC("Url must be a non-empty string!");this._dataSource.url=o},y.prototype._expandBuffer=function(o){for(var u=this._stashSize;u+10485760){var l=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(d,0,u).set(l,0)}this._stashBuffer=d,this._bufferSize=u}},y.prototype._normalizeSpeed=function(o){var u=this._speedNormalizeList,d=u.length-1,l=0,k=0,i=d;if(o=u[l]&&o=512&&o<=1024?Math.floor(1.5*o):2*o)>8192&&(u=8192);var d=1024*u+1048576;this._bufferSize0){var i=this._stashBuffer.slice(0,this._stashUsed);(n=this._dispatchChunks(i,this._stashByteStart))0&&(a=new Uint8Array(i,n),r.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=n):(this._stashUsed=0,this._stashByteStart+=n),this._stashUsed+o.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+o.byteLength),r=new Uint8Array(this._stashBuffer,0,this._bufferSize)),r.set(new Uint8Array(o),this._stashUsed),this._stashUsed+=o.byteLength}else(n=this._dispatchChunks(o,u))this._bufferSize&&(this._expandBuffer(e),r=new Uint8Array(this._stashBuffer,0,this._bufferSize)),r.set(new Uint8Array(o,n),0),this._stashUsed+=e,this._stashByteStart=u+n);else if(this._stashUsed===0){var e;(n=this._dispatchChunks(o,u))this._bufferSize&&this._expandBuffer(e),(r=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(o,n),0),this._stashUsed+=e,this._stashByteStart=u+n)}else{var r,n;if(this._stashUsed+o.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+o.byteLength),(r=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(o),this._stashUsed),this._stashUsed+=o.byteLength,(n=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var a=new Uint8Array(this._stashBuffer,n);r.set(a,0)}this._stashUsed-=n,this._stashByteStart+=n}}},y.prototype._flushStashBuffer=function(o){if(this._stashUsed>0){var u=this._stashBuffer.slice(0,this._stashUsed),d=this._dispatchChunks(u,this._stashByteStart),l=u.byteLength-d;if(d0){var k=new Uint8Array(this._stashBuffer,0,this._bufferSize),i=new Uint8Array(u,d);k.set(i,0),this._stashUsed=i.byteLength,this._stashByteStart+=d}return 0}Z.Z.w(this.TAG,l+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,l}return 0},y.prototype._onLoaderComplete=function(o,u){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},y.prototype._onLoaderError=function(o,u){switch(Z.Z.e(this.TAG,"Loader error, code = "+u.code+", msg = "+u.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,o=p.nm.UNRECOVERABLE_EARLY_EOF),o){case p.nm.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var d=this._currentRange.to+1;return void(d=0&&/(rv)(?::| )([\w.]+)/.exec(N)||N.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(N)||[],f=/(ipad)/.exec(N)||/(ipod)/.exec(N)||/(windows phone)/.exec(N)||/(iphone)/.exec(N)||/(kindle)/.exec(N)||/(android)/.exec(N)||/(windows)/.exec(N)||/(mac)/.exec(N)||/(linux)/.exec(N)||/(cros)/.exec(N)||[],p={browser:Z[5]||Z[3]||Z[1]||"",version:Z[2]||Z[4]||"0",majorVersion:Z[4]||Z[2]||"0",platform:f[0]||""},g={};if(p.browser){g[p.browser]=!0;var m=p.majorVersion.split(".");g.version={major:parseInt(p.majorVersion,10),string:p.version},m.length>1&&(g.version.minor=parseInt(m[1],10)),m.length>2&&(g.version.build=parseInt(m[2],10))}if(p.platform&&(g[p.platform]=!0),(g.chrome||g.opr||g.safari)&&(g.webkit=!0),g.rv||g.iemobile){g.rv&&delete g.rv;var E="msie";p.browser=E,g.msie=!0}if(g.edge){delete g.edge;var M="msedge";p.browser=M,g.msedge=!0}if(g.opr){var L="opera";p.browser=L,g.opera=!0}if(g.safari&&g.android){var D="android";p.browser=D,g.android=!0}for(var I in g.name=p.browser,g.platform=p.platform,T)T.hasOwnProperty(I)&&delete T[I];Object.assign(T,g)})(),K.Z=T},29:function(W,K,T){"use strict";T.d(K,{OZ:function(){return f},rT:function(){return p},OC:function(){return g},do:function(){return m}});var N,Z=(N=function(E,M){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,D){L.__proto__=D}||function(L,D){for(var I in D)Object.prototype.hasOwnProperty.call(D,I)&&(L[I]=D[I])})(E,M)},function(E,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");function L(){this.constructor=E}N(E,M),E.prototype=M===null?Object.create(M):(L.prototype=M.prototype,new L)}),f=function(){function E(M){this._message=M}return Object.defineProperty(E.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),E.prototype.toString=function(){return this.name+": "+this.message},E}(),p=function(E){function M(L){return E.call(this,L)||this}return Z(M,E),Object.defineProperty(M.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),M}(f),g=function(E){function M(L){return E.call(this,L)||this}return Z(M,E),Object.defineProperty(M.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),M}(f),m=function(E){function M(L){return E.call(this,L)||this}return Z(M,E),Object.defineProperty(M.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),M}(f)},300:function(W,K,T){"use strict";var N=T(716),Z=T.n(N),f=function(){function p(){}return p.e=function(g,m){g&&!p.FORCE_GLOBAL_TAG||(g=p.GLOBAL_TAG);var E="["+g+"] > "+m;p.ENABLE_CALLBACK&&p.emitter.emit("log","error",E),p.ENABLE_ERROR&&(console.error?console.error(E):console.warn?console.warn(E):console.log(E))},p.i=function(g,m){g&&!p.FORCE_GLOBAL_TAG||(g=p.GLOBAL_TAG);var E="["+g+"] > "+m;p.ENABLE_CALLBACK&&p.emitter.emit("log","info",E),p.ENABLE_INFO&&(console.info?console.info(E):console.log(E))},p.w=function(g,m){g&&!p.FORCE_GLOBAL_TAG||(g=p.GLOBAL_TAG);var E="["+g+"] > "+m;p.ENABLE_CALLBACK&&p.emitter.emit("log","warn",E),p.ENABLE_WARN&&(console.warn?console.warn(E):console.log(E))},p.d=function(g,m){g&&!p.FORCE_GLOBAL_TAG||(g=p.GLOBAL_TAG);var E="["+g+"] > "+m;p.ENABLE_CALLBACK&&p.emitter.emit("log","debug",E),p.ENABLE_DEBUG&&(console.debug?console.debug(E):console.log(E))},p.v=function(g,m){g&&!p.FORCE_GLOBAL_TAG||(g=p.GLOBAL_TAG);var E="["+g+"] > "+m;p.ENABLE_CALLBACK&&p.emitter.emit("log","verbose",E),p.ENABLE_VERBOSE&&console.log(E)},p}();f.GLOBAL_TAG="flv.js",f.FORCE_GLOBAL_TAG=!1,f.ENABLE_ERROR=!0,f.ENABLE_INFO=!0,f.ENABLE_WARN=!0,f.ENABLE_DEBUG=!0,f.ENABLE_VERBOSE=!0,f.ENABLE_CALLBACK=!1,f.emitter=new(Z()),K.Z=f},846:function(W,K,T){"use strict";var N=T(716),Z=T.n(N),f=T(300),p=function(){function g(){}return Object.defineProperty(g,"forceGlobalTag",{get:function(){return f.Z.FORCE_GLOBAL_TAG},set:function(m){f.Z.FORCE_GLOBAL_TAG=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"globalTag",{get:function(){return f.Z.GLOBAL_TAG},set:function(m){f.Z.GLOBAL_TAG=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableAll",{get:function(){return f.Z.ENABLE_VERBOSE&&f.Z.ENABLE_DEBUG&&f.Z.ENABLE_INFO&&f.Z.ENABLE_WARN&&f.Z.ENABLE_ERROR},set:function(m){f.Z.ENABLE_VERBOSE=m,f.Z.ENABLE_DEBUG=m,f.Z.ENABLE_INFO=m,f.Z.ENABLE_WARN=m,f.Z.ENABLE_ERROR=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableDebug",{get:function(){return f.Z.ENABLE_DEBUG},set:function(m){f.Z.ENABLE_DEBUG=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableVerbose",{get:function(){return f.Z.ENABLE_VERBOSE},set:function(m){f.Z.ENABLE_VERBOSE=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableInfo",{get:function(){return f.Z.ENABLE_INFO},set:function(m){f.Z.ENABLE_INFO=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableWarn",{get:function(){return f.Z.ENABLE_WARN},set:function(m){f.Z.ENABLE_WARN=m,g._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(g,"enableError",{get:function(){return f.Z.ENABLE_ERROR},set:function(m){f.Z.ENABLE_ERROR=m,g._notifyChange()},enumerable:!1,configurable:!0}),g.getConfig=function(){return{globalTag:f.Z.GLOBAL_TAG,forceGlobalTag:f.Z.FORCE_GLOBAL_TAG,enableVerbose:f.Z.ENABLE_VERBOSE,enableDebug:f.Z.ENABLE_DEBUG,enableInfo:f.Z.ENABLE_INFO,enableWarn:f.Z.ENABLE_WARN,enableError:f.Z.ENABLE_ERROR,enableCallback:f.Z.ENABLE_CALLBACK}},g.applyConfig=function(m){f.Z.GLOBAL_TAG=m.globalTag,f.Z.FORCE_GLOBAL_TAG=m.forceGlobalTag,f.Z.ENABLE_VERBOSE=m.enableVerbose,f.Z.ENABLE_DEBUG=m.enableDebug,f.Z.ENABLE_INFO=m.enableInfo,f.Z.ENABLE_WARN=m.enableWarn,f.Z.ENABLE_ERROR=m.enableError,f.Z.ENABLE_CALLBACK=m.enableCallback},g._notifyChange=function(){var m=g.emitter;if(m.listenerCount("change")>0){var E=g.getConfig();m.emit("change",E)}},g.registerListener=function(m){g.emitter.addListener("change",m)},g.removeListener=function(m){g.emitter.removeListener("change",m)},g.addLogListener=function(m){f.Z.emitter.addListener("log",m),f.Z.emitter.listenerCount("log")>0&&(f.Z.ENABLE_CALLBACK=!0,g._notifyChange())},g.removeLogListener=function(m){f.Z.emitter.removeListener("log",m),f.Z.emitter.listenerCount("log")===0&&(f.Z.ENABLE_CALLBACK=!1,g._notifyChange())},g}();p.emitter=new(Z()),K.Z=p},219:function(W,K,T){"use strict";var N=function(){function Z(){}return Z.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(f,p){return f.__proto__=p,f},Object.assign=Object.assign||function(f){if(f==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(f),g=1;g