lcny-vue3-antd-admin/dist/assets/VideoFlv.994a68d0.js

10 lines
154 KiB
JavaScript

import{dz as Ie,d as De,bw as Me,r as xe,e as ye,D as Pe,dt as we,E as Fe,_ as Be,j as Ue,P as Ee,o as ke,f as je,k as Ne,h as Se,aw as Ge,m as Le,s as Ke}from"./index.600742c0.js";import Ve from"./LinkModal.f5be8bd4.js";import"ant-design-vue";import"./model-close-icon.706a0490.js";var be={exports:{}};(function(H,oe){(function(le,Y){H.exports=Y()})(self,function(){return function(){var z={"./node_modules/es6-promise/dist/es6-promise.js":function(I,L,p){/*!
* @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
*/(function(E,h){I.exports=h()})(this,function(){function E(A){var O=typeof A;return A!==null&&(O==="object"||O==="function")}function h(A){return typeof A=="function"}var u=void 0;Array.isArray?u=Array.isArray:u=function(A){return Object.prototype.toString.call(A)==="[object Array]"};var o=u,d=0,r=void 0,a=void 0,l=function(O,C){g[d]=O,g[d+1]=C,d+=2,d===2&&(a?a(S):b())};function i(A){a=A}function t(A){l=A}var s=typeof window!="undefined"?window:void 0,n=s||{},e=n.MutationObserver||n.WebKitMutationObserver,f=typeof self=="undefined"&&typeof process!="undefined"&&{}.toString.call(process)==="[object process]",_=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function c(){return function(){return process.nextTick(S)}}function v(){return typeof r!="undefined"?function(){r(S)}:m()}function y(){var A=0,O=new e(S),C=document.createTextNode("");return O.observe(C,{characterData:!0}),function(){C.data=A=++A%2}}function x(){var A=new MessageChannel;return A.port1.onmessage=S,function(){return A.port2.postMessage(0)}}function m(){var A=setTimeout;return function(){return A(S,1)}}var g=new Array(1e3);function S(){for(var A=0;A<d;A+=2){var O=g[A],C=g[A+1];O(C),g[A]=void 0,g[A+1]=void 0}d=0}function R(){try{var A=Function("return this")().require("vertx");return r=A.runOnLoop||A.runOnContext,v()}catch(O){return m()}}var b=void 0;f?b=c():e?b=y():_?b=x():s===void 0?b=R():b=m();function T(A,O){var C=this,D=new this.constructor(w);D[U]===void 0&&de(D);var F=C._state;if(F){var k=arguments[F-1];l(function(){return ue(F,D,k,C._result)})}else $(C,D,A,O);return D}function B(A){var O=this;if(A&&typeof A=="object"&&A.constructor===O)return A;var C=new O(w);return J(C,A),C}var U=Math.random().toString(36).substring(2);function w(){}var j=void 0,K=1,P=2;function N(){return new TypeError("You cannot resolve a promise with itself")}function te(){return new TypeError("A promises callback cannot return that same promise.")}function G(A,O,C,D){try{A.call(O,C,D)}catch(F){return F}}function V(A,O,C){l(function(D){var F=!1,k=G(C,O,function(X){F||(F=!0,O!==X?J(D,X):W(D,X))},function(X){F||(F=!0,M(D,X))},"Settle: "+(D._label||" unknown promise"));!F&&k&&(F=!0,M(D,k))},A)}function q(A,O){O._state===K?W(A,O._result):O._state===P?M(A,O._result):$(O,void 0,function(C){return J(A,C)},function(C){return M(A,C)})}function Q(A,O,C){O.constructor===A.constructor&&C===T&&O.constructor.resolve===B?q(A,O):C===void 0?W(A,O):h(C)?V(A,O,C):W(A,O)}function J(A,O){if(A===O)M(A,N());else if(E(O)){var C=void 0;try{C=O.then}catch(D){M(A,D);return}Q(A,O,C)}else W(A,O)}function ne(A){A._onerror&&A._onerror(A._result),re(A)}function W(A,O){A._state===j&&(A._result=O,A._state=K,A._subscribers.length!==0&&l(re,A))}function M(A,O){A._state===j&&(A._state=P,A._result=O,l(ne,A))}function $(A,O,C,D){var F=A._subscribers,k=F.length;A._onerror=null,F[k]=O,F[k+K]=C,F[k+P]=D,k===0&&A._state&&l(re,A)}function re(A){var O=A._subscribers,C=A._state;if(O.length!==0){for(var D=void 0,F=void 0,k=A._result,X=0;X<O.length;X+=3)D=O[X],F=O[X+C],D?ue(C,D,F,k):F(k);A._subscribers.length=0}}function ue(A,O,C,D){var F=h(C),k=void 0,X=void 0,he=!0;if(F){try{k=C(D)}catch(me){he=!1,X=me}if(O===k){M(O,te());return}}else k=D;O._state!==j||(F&&he?J(O,k):he===!1?M(O,X):A===K?W(O,k):A===P&&M(O,k))}function se(A,O){try{O(function(D){J(A,D)},function(D){M(A,D)})}catch(C){M(A,C)}}var ae=0;function fe(){return ae++}function de(A){A[U]=ae++,A._state=void 0,A._result=void 0,A._subscribers=[]}function ie(){return new Error("Array Methods must be provided an Array")}var ee=function(){function A(O,C){this._instanceConstructor=O,this.promise=new O(w),this.promise[U]||de(this.promise),o(C)?(this.length=C.length,this._remaining=C.length,this._result=new Array(this.length),this.length===0?W(this.promise,this._result):(this.length=this.length||0,this._enumerate(C),this._remaining===0&&W(this.promise,this._result))):M(this.promise,ie())}return A.prototype._enumerate=function(C){for(var D=0;this._state===j&&D<C.length;D++)this._eachEntry(C[D],D)},A.prototype._eachEntry=function(C,D){var F=this._instanceConstructor,k=F.resolve;if(k===B){var X=void 0,he=void 0,me=!1;try{X=C.then}catch(ge){me=!0,he=ge}if(X===T&&C._state!==j)this._settledAt(C._state,D,C._result);else if(typeof X!="function")this._remaining--,this._result[D]=C;else if(F===Z){var ve=new F(w);me?M(ve,he):Q(ve,C,X),this._willSettleAt(ve,D)}else this._willSettleAt(new F(function(ge){return ge(C)}),D)}else this._willSettleAt(k(C),D)},A.prototype._settledAt=function(C,D,F){var k=this.promise;k._state===j&&(this._remaining--,C===P?M(k,F):this._result[D]=F),this._remaining===0&&W(k,this._result)},A.prototype._willSettleAt=function(C,D){var F=this;$(C,void 0,function(k){return F._settledAt(K,D,k)},function(k){return F._settledAt(P,D,k)})},A}();function _e(A){return new ee(this,A).promise}function pe(A){var O=this;return o(A)?new O(function(C,D){for(var F=A.length,k=0;k<F;k++)O.resolve(A[k]).then(C,D)}):new O(function(C,D){return D(new TypeError("You must pass an array to race."))})}function Re(A){var O=this,C=new O(w);return M(C,A),C}function Oe(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ce(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Z=function(){function A(O){this[U]=fe(),this._result=this._state=void 0,this._subscribers=[],w!==O&&(typeof O!="function"&&Oe(),this instanceof A?se(this,O):Ce())}return A.prototype.catch=function(C){return this.then(null,C)},A.prototype.finally=function(C){var D=this,F=D.constructor;return h(C)?D.then(function(k){return F.resolve(C()).then(function(){return k})},function(k){return F.resolve(C()).then(function(){throw k})}):D.then(C,C)},A}();Z.prototype.then=T,Z.all=_e,Z.race=pe,Z.resolve=B,Z.reject=Re,Z._setScheduler=i,Z._setAsap=t,Z._asap=l;function Te(){var A=void 0;if(typeof p.g!="undefined")A=p.g;else if(typeof self!="undefined")A=self;else try{A=Function("return this")()}catch(D){throw new Error("polyfill failed because global object is unavailable in this environment")}var O=A.Promise;if(O){var C=null;try{C=Object.prototype.toString.call(O.resolve())}catch(D){}if(C==="[object Promise]"&&!O.cast)return}A.Promise=Z}return Z.polyfill=Te,Z.Promise=Z,Z})},"./node_modules/events/events.js":function(I){var L=typeof Reflect=="object"?Reflect:null,p=L&&typeof L.apply=="function"?L.apply:function(m,g,S){return Function.prototype.apply.call(m,g,S)},E;L&&typeof L.ownKeys=="function"?E=L.ownKeys:Object.getOwnPropertySymbols?E=function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:E=function(m){return Object.getOwnPropertyNames(m)};function h(x){console&&console.warn&&console.warn(x)}var u=Number.isNaN||function(m){return m!==m};function o(){o.init.call(this)}I.exports=o,I.exports.once=c,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var d=10;function r(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(x){if(typeof x!="number"||x<0||u(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");d=x}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||u(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this};function a(x){return x._maxListeners===void 0?o.defaultMaxListeners:x._maxListeners}o.prototype.getMaxListeners=function(){return a(this)},o.prototype.emit=function(m){for(var g=[],S=1;S<arguments.length;S++)g.push(arguments[S]);var R=m==="error",b=this._events;if(b!==void 0)R=R&&b.error===void 0;else if(!R)return!1;if(R){var T;if(g.length>0&&(T=g[0]),T instanceof Error)throw T;var B=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw B.context=T,B}var U=b[m];if(U===void 0)return!1;if(typeof U=="function")p(U,this,g);else for(var w=U.length,j=e(U,w),S=0;S<w;++S)p(j[S],this,g);return!0};function l(x,m,g,S){var R,b,T;if(r(g),b=x._events,b===void 0?(b=x._events=Object.create(null),x._eventsCount=0):(b.newListener!==void 0&&(x.emit("newListener",m,g.listener?g.listener:g),b=x._events),T=b[m]),T===void 0)T=b[m]=g,++x._eventsCount;else if(typeof T=="function"?T=b[m]=S?[g,T]:[T,g]:S?T.unshift(g):T.push(g),R=a(x),R>0&&T.length>R&&!T.warned){T.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=x,B.type=m,B.count=T.length,h(B)}return x}o.prototype.addListener=function(m,g){return l(this,m,g,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(m,g){return l(this,m,g,!0)};function i(){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 t(x,m,g){var S={fired:!1,wrapFn:void 0,target:x,type:m,listener:g},R=i.bind(S);return R.listener=g,S.wrapFn=R,R}o.prototype.once=function(m,g){return r(g),this.on(m,t(this,m,g)),this},o.prototype.prependOnceListener=function(m,g){return r(g),this.prependListener(m,t(this,m,g)),this},o.prototype.removeListener=function(m,g){var S,R,b,T,B;if(r(g),R=this._events,R===void 0)return this;if(S=R[m],S===void 0)return this;if(S===g||S.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete R[m],R.removeListener&&this.emit("removeListener",m,S.listener||g));else if(typeof S!="function"){for(b=-1,T=S.length-1;T>=0;T--)if(S[T]===g||S[T].listener===g){B=S[T].listener,b=T;break}if(b<0)return this;b===0?S.shift():f(S,b),S.length===1&&(R[m]=S[0]),R.removeListener!==void 0&&this.emit("removeListener",m,B||g)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(m){var g,S,R;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[m]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[m]),this;if(arguments.length===0){var b=Object.keys(S),T;for(R=0;R<b.length;++R)T=b[R],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(g=S[m],typeof g=="function")this.removeListener(m,g);else if(g!==void 0)for(R=g.length-1;R>=0;R--)this.removeListener(m,g[R]);return this};function s(x,m,g){var S=x._events;if(S===void 0)return[];var R=S[m];return R===void 0?[]:typeof R=="function"?g?[R.listener||R]:[R]:g?_(R):e(R,R.length)}o.prototype.listeners=function(m){return s(this,m,!0)},o.prototype.rawListeners=function(m){return s(this,m,!1)},o.listenerCount=function(x,m){return typeof x.listenerCount=="function"?x.listenerCount(m):n.call(x,m)},o.prototype.listenerCount=n;function n(x){var m=this._events;if(m!==void 0){var g=m[x];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?E(this._events):[]};function e(x,m){for(var g=new Array(m),S=0;S<m;++S)g[S]=x[S];return g}function f(x,m){for(;m+1<x.length;m++)x[m]=x[m+1];x.pop()}function _(x){for(var m=new Array(x.length),g=0;g<m.length;++g)m[g]=x[g].listener||x[g];return m}function c(x,m){return new Promise(function(g,S){function R(T){x.removeListener(m,b),S(T)}function b(){typeof x.removeListener=="function"&&x.removeListener("error",R),g([].slice.call(arguments))}y(x,m,b,{once:!0}),m!=="error"&&v(x,R,{once:!0})})}function v(x,m,g){typeof x.on=="function"&&y(x,"error",m,g)}function y(x,m,g,S){if(typeof x.on=="function")S.once?x.once(m,g):x.on(m,g);else if(typeof x.addEventListener=="function")x.addEventListener(m,function R(b){S.once&&x.removeEventListener(m,R),g(b)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}},"./node_modules/webworkify-webpack/index.js":function(I,L,p){function E(i){var t={};function s(e){if(t[e])return t[e].exports;var f=t[e]={i:e,l:!1,exports:{}};return i[e].call(f.exports,f,f.exports,s),f.l=!0,f.exports}s.m=i,s.c=t,s.i=function(e){return e},s.d=function(e,f,_){s.o(e,f)||Object.defineProperty(e,f,{configurable:!1,enumerable:!0,get:_})},s.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},s.n=function(e){var f=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(f,"a",f),f},s.o=function(e,f){return Object.prototype.hasOwnProperty.call(e,f)},s.p="/",s.oe=function(e){throw console.error(e),e};var n=s(s.s=ENTRY_MODULE);return n.default||n}var h="[\\.|\\-|\\+|\\w|/|@]+",u="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function o(i){return(i+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function d(i){return!isNaN(1*i)}function r(i,t,s){var n={};n[s]=[];var e=t.toString(),f=e.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!f)return n;for(var _=f[1],c=new RegExp("(\\\\n|\\W)"+o(_)+u,"g"),v;v=c.exec(e);)v[3]!=="dll-reference"&&n[s].push(v[3]);for(c=new RegExp("\\("+o(_)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+u,"g");v=c.exec(e);)i[v[2]]||(n[s].push(v[1]),i[v[2]]=p(v[1]).m),n[v[2]]=n[v[2]]||[],n[v[2]].push(v[4]);for(var y=Object.keys(n),x=0;x<y.length;x++)for(var m=0;m<n[y[x]].length;m++)d(n[y[x]][m])&&(n[y[x]][m]=1*n[y[x]][m]);return n}function a(i){var t=Object.keys(i);return t.reduce(function(s,n){return s||i[n].length>0},!1)}function l(i,t){for(var s={main:[t]},n={main:[]},e={main:{}};a(s);)for(var f=Object.keys(s),_=0;_<f.length;_++){var c=f[_],v=s[c],y=v.pop();if(e[c]=e[c]||{},!(e[c][y]||!i[c][y])){e[c][y]=!0,n[c]=n[c]||[],n[c].push(y);for(var x=r(i,i[c][y],c),m=Object.keys(x),g=0;g<m.length;g++)s[m[g]]=s[m[g]]||[],s[m[g]]=s[m[g]].concat(x[m[g]])}}return n}I.exports=function(i,t){t=t||{};var s={main:p.m},n=t.all?{main:Object.keys(s.main)}:l(s,i),e="";Object.keys(n).filter(function(y){return y!=="main"}).forEach(function(y){for(var x=0;n[y][x];)x++;n[y].push(x),s[y][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",e=e+"var "+y+" = ("+E.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+n[y].map(function(m){return""+JSON.stringify(m)+": "+s[y][m].toString()}).join(",")+`});
`}),e=e+"new (("+E.toString().replace("ENTRY_MODULE",JSON.stringify(i))+")({"+n.main.map(function(y){return""+JSON.stringify(y)+": "+s.main[y].toString()}).join(",")+"}))(self);";var f=new window.Blob([e],{type:"text/javascript"});if(t.bare)return f;var _=window.URL||window.webkitURL||window.mozURL||window.msURL,c=_.createObjectURL(f),v=new window.Worker(c);return v.objectURL=c,v}},"./src/config.js":function(I,L,p){p.r(L),p.d(L,{defaultConfig:function(){return E},createDefaultConfig:function(){return h}});var E={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,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 h(){return Object.assign({},E)}},"./src/core/features.js":function(I,L,p){p.r(L);var E=p("./src/io/io-controller.js"),h=p("./src/config.js"),u=function(){function o(){}return o.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},o.supportNetworkStreamIO=function(){var d=new E.default({},(0,h.createDefaultConfig)()),r=d.loaderType;return d.destroy(),r=="fetch-stream-loader"||r=="xhr-moz-chunked-loader"},o.getNetworkLoaderTypeName=function(){var d=new E.default({},(0,h.createDefaultConfig)()),r=d.loaderType;return d.destroy(),r},o.supportNativeMediaPlayback=function(d){o.videoElement==null&&(o.videoElement=window.document.createElement("video"));var r=o.videoElement.canPlayType(d);return r==="probably"||r=="maybe"},o.getFeatureList=function(){var d={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return d.mseFlvPlayback=o.supportMSEH264Playback(),d.networkStreamIO=o.supportNetworkStreamIO(),d.networkLoaderName=o.getNetworkLoaderTypeName(),d.mseLiveFlvPlayback=d.mseFlvPlayback&&d.networkStreamIO,d.nativeMP4H264Playback=o.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),d.nativeWebmVP8Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),d.nativeWebmVP9Playback=o.supportNativeMediaPlayback('video/webm; codecs="vp9"'),d},o}();L.default=u},"./src/core/media-info.js":function(I,L,p){p.r(L);var E=function(){function h(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return h.prototype.isComplete=function(){var u=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,o=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&u&&o},h.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},h.prototype.getNearestKeyframe=function(u){if(this.keyframesIndex==null)return null;var o=this.keyframesIndex,d=this._search(o.times,u);return{index:d,milliseconds:o.times[d],fileposition:o.filepositions[d]}},h.prototype._search=function(u,o){var d=0,r=u.length-1,a=0,l=0,i=r;for(o<u[0]&&(d=0,l=i+1);l<=i;)if(a=l+Math.floor((i-l)/2),a===r||o>=u[a]&&o<u[a+1]){d=a;break}else u[a]<o?l=a+1:i=a-1;return d},h}();L.default=E},"./src/core/media-segment-info.js":function(I,L,p){p.r(L),p.d(L,{SampleInfo:function(){return E},MediaSegmentInfo:function(){return h},IDRSampleList:function(){return u},MediaSegmentInfoList:function(){return o}});var E=function(){function d(r,a,l,i,t){this.dts=r,this.pts=a,this.duration=l,this.originalDts=i,this.isSyncPoint=t,this.fileposition=null}return d}(),h=function(){function d(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return d.prototype.appendSyncPoint=function(r){r.isSyncPoint=!0,this.syncPoints.push(r)},d}(),u=function(){function d(){this._list=[]}return d.prototype.clear=function(){this._list=[]},d.prototype.appendArray=function(r){var a=this._list;r.length!==0&&(a.length>0&&r[0].originalDts<a[a.length-1].originalDts&&this.clear(),Array.prototype.push.apply(a,r))},d.prototype.getLastSyncPointBeforeDts=function(r){if(this._list.length==0)return null;var a=this._list,l=0,i=a.length-1,t=0,s=0,n=i;for(r<a[0].dts&&(l=0,s=n+1);s<=n;)if(t=s+Math.floor((n-s)/2),t===i||r>=a[t].dts&&r<a[t+1].dts){l=t;break}else a[t].dts<r?s=t+1:n=t-1;return this._list[l]},d}(),o=function(){function d(r){this._type=r,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(d.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),d.prototype.isEmpty=function(){return this._list.length===0},d.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},d.prototype._searchNearestSegmentBefore=function(r){var a=this._list;if(a.length===0)return-2;var l=a.length-1,i=0,t=0,s=l,n=0;if(r<a[0].originalBeginDts)return n=-1,n;for(;t<=s;)if(i=t+Math.floor((s-t)/2),i===l||r>a[i].lastSample.originalDts&&r<a[i+1].originalBeginDts){n=i;break}else a[i].originalBeginDts<r?t=i+1:s=i-1;return n},d.prototype._searchNearestSegmentAfter=function(r){return this._searchNearestSegmentBefore(r)+1},d.prototype.append=function(r){var a=this._list,l=r,i=this._lastAppendLocation,t=0;i!==-1&&i<a.length&&l.originalBeginDts>=a[i].lastSample.originalDts&&(i===a.length-1||i<a.length-1&&l.originalBeginDts<a[i+1].originalBeginDts)?t=i+1:a.length>0&&(t=this._searchNearestSegmentBefore(l.originalBeginDts)+1),this._lastAppendLocation=t,this._list.splice(t,0,l)},d.prototype.getLastSegmentBefore=function(r){var a=this._searchNearestSegmentBefore(r);return a>=0?this._list[a]:null},d.prototype.getLastSampleBefore=function(r){var a=this.getLastSegmentBefore(r);return a!=null?a.lastSample:null},d.prototype.getLastSyncPointBefore=function(r){for(var a=this._searchNearestSegmentBefore(r),l=this._list[a].syncPoints;l.length===0&&a>0;)a--,l=this._list[a].syncPoints;return l.length>0?l[l.length-1]:null},d}()},"./src/core/mse-controller.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/core/mse-events.js"),r=p("./src/core/media-segment-info.js"),a=p("./src/utils/exception.js"),l=function(){function i(t){this.TAG="MSEController",this._config=t,this._emitter=new(h()),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 r.IDRSampleList}return i.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},i.prototype.on=function(t,s){this._emitter.addListener(t,s)},i.prototype.off=function(t,s){this._emitter.removeListener(t,s)},i.prototype.attachMediaElement=function(t){if(this._mediaSource)throw new a.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var s=this._mediaSource=new window.MediaSource;s.addEventListener("sourceopen",this.e.onSourceOpen),s.addEventListener("sourceended",this.e.onSourceEnded),s.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=t,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),t.src=this._mediaSourceObjectURL},i.prototype.detachMediaElement=function(){if(this._mediaSource){var t=this._mediaSource;for(var s in this._sourceBuffers){var n=this._pendingSegments[s];n.splice(0,n.length),this._pendingSegments[s]=null,this._pendingRemoveRanges[s]=null,this._lastInitSegments[s]=null;var e=this._sourceBuffers[s];if(e){if(t.readyState!=="closed"){try{t.removeSourceBuffer(e)}catch(f){u.default.e(this.TAG,f.message)}e.removeEventListener("error",this.e.onSourceBufferError),e.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[s]=null,this._sourceBuffers[s]=null}}if(t.readyState==="open")try{t.endOfStream()}catch(f){u.default.e(this.TAG,f.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)},i.prototype.appendInitSegment=function(t,s){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(t),this._pendingSegments[t.type].push(t);return}var n=t,e=""+n.container;n.codec&&n.codec.length>0&&(e+=";codecs="+n.codec);var f=!1;if(u.default.v(this.TAG,"Received Initialization Segment, mimeType: "+e),this._lastInitSegments[n.type]=n,e!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])u.default.v(this.TAG,"Notice: "+n.type+" mimeType changed, origin: "+this._mimeTypes[n.type]+", target: "+e);else{f=!0;try{var _=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(e);_.addEventListener("error",this.e.onSourceBufferError),_.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(c){u.default.e(this.TAG,c.message),this._emitter.emit(d.default.ERROR,{code:c.code,msg:c.message});return}}this._mimeTypes[n.type]=e}s||this._pendingSegments[n.type].push(n),f||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),o.default.safari&&n.container==="audio/mpeg"&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())},i.prototype.appendMediaSegment=function(t){var s=t;this._pendingSegments[s.type].push(s),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[s.type];n&&!n.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()},i.prototype.seek=function(t){for(var s in this._sourceBuffers)if(!!this._sourceBuffers[s]){var n=this._sourceBuffers[s];if(this._mediaSource.readyState==="open")try{n.abort()}catch(y){u.default.e(this.TAG,y.message)}this._idrList.clear();var e=this._pendingSegments[s];if(e.splice(0,e.length),this._mediaSource.readyState!=="closed"){for(var f=0;f<n.buffered.length;f++){var _=n.buffered.start(f),c=n.buffered.end(f);this._pendingRemoveRanges[s].push({start:_,end:c})}if(n.updating||this._doRemoveRanges(),o.default.safari){var v=this._lastInitSegments[s];v&&(this._pendingSegments[s].push(v),n.updating||this._doAppendSegments())}}}},i.prototype.endOfStream=function(){var t=this._mediaSource,s=this._sourceBuffers;if(!t||t.readyState!=="open"){t&&t.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}s.video&&s.video.updating||s.audio&&s.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,t.endOfStream())},i.prototype.getNearestKeyframe=function(t){return this._idrList.getLastSyncPointBeforeDts(t)},i.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var t=this._mediaElement.currentTime;for(var s in this._sourceBuffers){var n=this._sourceBuffers[s];if(n){var e=n.buffered;if(e.length>=1&&t-e.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},i.prototype._doCleanupSourceBuffer=function(){var t=this._mediaElement.currentTime;for(var s in this._sourceBuffers){var n=this._sourceBuffers[s];if(n){for(var e=n.buffered,f=!1,_=0;_<e.length;_++){var c=e.start(_),v=e.end(_);if(c<=t&&t<v+3){if(t-c>=this._config.autoCleanupMaxBackwardDuration){f=!0;var y=t-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[s].push({start:c,end:y})}}else v<t&&(f=!0,this._pendingRemoveRanges[s].push({start:c,end:v}))}f&&!n.updating&&this._doRemoveRanges()}}},i.prototype._updateMediaSourceDuration=function(){var t=this._sourceBuffers;if(!(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")&&!(t.video&&t.video.updating||t.audio&&t.audio.updating)){var s=this._mediaSource.duration,n=this._pendingMediaDuration;n>0&&(isNaN(s)||n>s)&&(u.default.v(this.TAG,"Update MediaSource duration from "+s+" to "+n),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},i.prototype._doRemoveRanges=function(){for(var t in this._pendingRemoveRanges)if(!(!this._sourceBuffers[t]||this._sourceBuffers[t].updating))for(var s=this._sourceBuffers[t],n=this._pendingRemoveRanges[t];n.length&&!s.updating;){var e=n.shift();s.remove(e.start,e.end)}},i.prototype._doAppendSegments=function(){var t=this._pendingSegments;for(var s in t)if(!(!this._sourceBuffers[s]||this._sourceBuffers[s].updating)&&t[s].length>0){var n=t[s].shift();if(n.timestampOffset){var e=this._sourceBuffers[s].timestampOffset,f=n.timestampOffset/1e3,_=Math.abs(e-f);_>.1&&(u.default.v(this.TAG,"Update MPEG audio timestampOffset from "+e+" to "+f),this._sourceBuffers[s].timestampOffset=f),delete n.timestampOffset}if(!n.data||n.data.byteLength===0)continue;try{this._sourceBuffers[s].appendBuffer(n.data),this._isBufferFull=!1,s==="video"&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(c){this._pendingSegments[s].unshift(n),c.code===22?(this._isBufferFull||this._emitter.emit(d.default.BUFFER_FULL),this._isBufferFull=!0):(u.default.e(this.TAG,c.message),this._emitter.emit(d.default.ERROR,{code:c.code,msg:c.message}))}}},i.prototype._onSourceOpen=function(){if(u.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var s=t.shift();this.appendInitSegment(s,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(d.default.SOURCE_OPEN)},i.prototype._onSourceEnded=function(){u.default.v(this.TAG,"MediaSource onSourceEnded")},i.prototype._onSourceClose=function(){u.default.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))},i.prototype._hasPendingSegments=function(){var t=this._pendingSegments;return t.video.length>0||t.audio.length>0},i.prototype._hasPendingRemoveRanges=function(){var t=this._pendingRemoveRanges;return t.video.length>0||t.audio.length>0},i.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(d.default.UPDATE_END)},i.prototype._onSourceBufferError=function(t){u.default.e(this.TAG,"SourceBuffer Error: "+t)},i}();L.default=l},"./src/core/mse-events.js":function(I,L,p){p.r(L);var E={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};L.default=E},"./src/core/transmuxer.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./node_modules/webworkify-webpack/index.js"),o=p.n(u),d=p("./src/utils/logger.js"),r=p("./src/utils/logging-control.js"),a=p("./src/core/transmuxing-controller.js"),l=p("./src/core/transmuxing-events.js"),i=p("./src/core/media-info.js"),t=function(){function s(n,e){if(this.TAG="Transmuxer",this._emitter=new(h()),e.enableWorker&&typeof Worker!="undefined")try{this._worker=o()("./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[n,e]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},r.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:r.default.getConfig()})}catch(_){d.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new a.default(n,e)}else this._controller=new a.default(n,e);if(this._controller){var f=this._controller;f.on(l.default.IO_ERROR,this._onIOError.bind(this)),f.on(l.default.DEMUX_ERROR,this._onDemuxError.bind(this)),f.on(l.default.INIT_SEGMENT,this._onInitSegment.bind(this)),f.on(l.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),f.on(l.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),f.on(l.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),f.on(l.default.MEDIA_INFO,this._onMediaInfo.bind(this)),f.on(l.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),f.on(l.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),f.on(l.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),f.on(l.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return s.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),r.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},s.prototype.on=function(n,e){this._emitter.addListener(n,e)},s.prototype.off=function(n,e){this._emitter.removeListener(n,e)},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(n){this._worker?this._worker.postMessage({cmd:"seek",param:n}):this._controller.seek(n)},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(n,e){var f=this;Promise.resolve().then(function(){f._emitter.emit(l.default.INIT_SEGMENT,n,e)})},s.prototype._onMediaSegment=function(n,e){var f=this;Promise.resolve().then(function(){f._emitter.emit(l.default.MEDIA_SEGMENT,n,e)})},s.prototype._onLoadingComplete=function(){var n=this;Promise.resolve().then(function(){n._emitter.emit(l.default.LOADING_COMPLETE)})},s.prototype._onRecoveredEarlyEof=function(){var n=this;Promise.resolve().then(function(){n._emitter.emit(l.default.RECOVERED_EARLY_EOF)})},s.prototype._onMediaInfo=function(n){var e=this;Promise.resolve().then(function(){e._emitter.emit(l.default.MEDIA_INFO,n)})},s.prototype._onMetaDataArrived=function(n){var e=this;Promise.resolve().then(function(){e._emitter.emit(l.default.METADATA_ARRIVED,n)})},s.prototype._onScriptDataArrived=function(n){var e=this;Promise.resolve().then(function(){e._emitter.emit(l.default.SCRIPTDATA_ARRIVED,n)})},s.prototype._onStatisticsInfo=function(n){var e=this;Promise.resolve().then(function(){e._emitter.emit(l.default.STATISTICS_INFO,n)})},s.prototype._onIOError=function(n,e){var f=this;Promise.resolve().then(function(){f._emitter.emit(l.default.IO_ERROR,n,e)})},s.prototype._onDemuxError=function(n,e){var f=this;Promise.resolve().then(function(){f._emitter.emit(l.default.DEMUX_ERROR,n,e)})},s.prototype._onRecommendSeekpoint=function(n){var e=this;Promise.resolve().then(function(){e._emitter.emit(l.default.RECOMMEND_SEEKPOINT,n)})},s.prototype._onLoggingConfigChanged=function(n){this._worker&&this._worker.postMessage({cmd:"logging_config",param:n})},s.prototype._onWorkerMessage=function(n){var e=n.data,f=e.data;if(e.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(e.msg){case l.default.INIT_SEGMENT:case l.default.MEDIA_SEGMENT:this._emitter.emit(e.msg,f.type,f.data);break;case l.default.LOADING_COMPLETE:case l.default.RECOVERED_EARLY_EOF:this._emitter.emit(e.msg);break;case l.default.MEDIA_INFO:Object.setPrototypeOf(f,i.default.prototype),this._emitter.emit(e.msg,f);break;case l.default.METADATA_ARRIVED:case l.default.SCRIPTDATA_ARRIVED:case l.default.STATISTICS_INFO:this._emitter.emit(e.msg,f);break;case l.default.IO_ERROR:case l.default.DEMUX_ERROR:this._emitter.emit(e.msg,f.type,f.info);break;case l.default.RECOMMEND_SEEKPOINT:this._emitter.emit(e.msg,f);break;case"logcat_callback":d.default.emitter.emit("log",f.type,f.logcat);break}},s}();L.default=t},"./src/core/transmuxing-controller.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/core/media-info.js"),r=p("./src/demux/flv-demuxer.js"),a=p("./src/remux/mp4-remuxer.js"),l=p("./src/demux/demux-errors.js"),i=p("./src/io/io-controller.js"),t=p("./src/core/transmuxing-events.js"),s=function(){function n(e,f){this.TAG="TransmuxingController",this._emitter=new(h()),this._config=f,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),typeof e.cors!="boolean"&&(e.cors=!0),typeof e.withCredentials!="boolean"&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var _=0;this._mediaDataSource.segments.forEach(function(c){c.timestampBase=_,_+=c.duration,c.cors=e.cors,c.withCredentials=e.withCredentials,f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy)}),!isNaN(_)&&this._mediaDataSource.duration!==_&&(this._mediaDataSource.duration=_),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return n.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},n.prototype.on=function(e,f){this._emitter.addListener(e,f)},n.prototype.off=function(e,f){this._emitter.removeListener(e,f)},n.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},n.prototype._loadSegment=function(e,f){this._currentSegmentIndex=e;var _=this._mediaDataSource.segments[e],c=this._ioctl=new i.default(_,this._config,e);c.onError=this._onIOException.bind(this),c.onSeeked=this._onIOSeeked.bind(this),c.onComplete=this._onIOComplete.bind(this),c.onRedirect=this._onIORedirect.bind(this),c.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),f?this._demuxer.bindDataSource(this._ioctl):c.onDataArrival=this._onInitChunkArrival.bind(this),c.open(f)},n.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},n.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},n.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},n.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},n.prototype.seek=function(e){if(!(this._mediaInfo==null||!this._mediaInfo.isSeekable())){var f=this._searchSegmentIndexContains(e);if(f===this._currentSegmentIndex){var _=this._mediaInfo.segments[f];if(_==null)this._pendingSeekTime=e;else{var c=_.getNearestKeyframe(e);this._remuxer.seek(c.milliseconds),this._ioctl.seek(c.fileposition),this._pendingResolveSeekPoint=c.milliseconds}}else{var v=this._mediaInfo.segments[f];if(v==null)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(f);else{var c=v.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[f].timestampBase,this._loadSegment(f,c.fileposition),this._pendingResolveSeekPoint=c.milliseconds,this._reportSegmentMediaInfo(f)}}this._enableStatisticsReporter()}},n.prototype._searchSegmentIndexContains=function(e){for(var f=this._mediaDataSource.segments,_=f.length-1,c=0;c<f.length;c++)if(e<f[c].timestampBase){_=c-1;break}return _},n.prototype._onInitChunkArrival=function(e,f){var _=this,c=null,v=0;if(f>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,v=this._demuxer.parseChunks(e,f);else if((c=r.default.probe(e)).match){this._demuxer=new r.default(c,this._config),this._remuxer||(this._remuxer=new a.default(this._config));var y=this._mediaDataSource;y.duration!=null&&!isNaN(y.duration)&&(this._demuxer.overridedDuration=y.duration),typeof y.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=y.hasAudio),typeof y.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=y.hasVideo),this._demuxer.timestampBase=y.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),v=this._demuxer.parseChunks(e,f)}else c=null,u.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){_._internalAbort()}),this._emitter.emit(t.default.DEMUX_ERROR,l.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),v=0;return v},n.prototype._onMediaInfo=function(e){var f=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,d.default.prototype));var _=Object.assign({},e);Object.setPrototypeOf(_,d.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=_,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var c=f._pendingSeekTime;f._pendingSeekTime=null,f.seek(c)})},n.prototype._onMetaDataArrived=function(e){this._emitter.emit(t.default.METADATA_ARRIVED,e)},n.prototype._onScriptDataArrived=function(e){this._emitter.emit(t.default.SCRIPTDATA_ARRIVED,e)},n.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},n.prototype._onIOComplete=function(e){var f=e,_=f+1;_<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(_)):(this._remuxer.flushStashedSamples(),this._emitter.emit(t.default.LOADING_COMPLETE),this._disableStatisticsReporter())},n.prototype._onIORedirect=function(e){var f=this._ioctl.extraData;this._mediaDataSource.segments[f].redirectedURL=e},n.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(t.default.RECOVERED_EARLY_EOF)},n.prototype._onIOException=function(e,f){u.default.e(this.TAG,"IOException: type = "+e+", code = "+f.code+", msg = "+f.msg),this._emitter.emit(t.default.IO_ERROR,e,f),this._disableStatisticsReporter()},n.prototype._onDemuxException=function(e,f){u.default.e(this.TAG,"DemuxException: type = "+e+", info = "+f),this._emitter.emit(t.default.DEMUX_ERROR,e,f)},n.prototype._onRemuxerInitSegmentArrival=function(e,f){this._emitter.emit(t.default.INIT_SEGMENT,e,f)},n.prototype._onRemuxerMediaSegmentArrival=function(e,f){if(this._pendingSeekTime==null&&(this._emitter.emit(t.default.MEDIA_SEGMENT,e,f),this._pendingResolveSeekPoint!=null&&e==="video")){var _=f.info.syncPoints,c=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.default.safari&&_.length>0&&_[0].originalDts===c&&(c=_[0].pts),this._emitter.emit(t.default.RECOMMEND_SEEKPOINT,c)}},n.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},n.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},n.prototype._reportSegmentMediaInfo=function(e){var f=this._mediaInfo.segments[e],_=Object.assign({},f);_.duration=this._mediaInfo.duration,_.segmentCount=this._mediaInfo.segmentCount,delete _.segments,delete _.keyframesIndex,this._emitter.emit(t.default.MEDIA_INFO,_)},n.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(t.default.STATISTICS_INFO,e)},n}();L.default=s},"./src/core/transmuxing-events.js":function(I,L,p){p.r(L);var E={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"};L.default=E},"./src/core/transmuxing-worker.js":function(I,L,p){p.r(L);var E=p("./src/utils/logging-control.js"),h=p("./src/utils/polyfill.js"),u=p("./src/core/transmuxing-controller.js"),o=p("./src/core/transmuxing-events.js"),d=function(r){var a=null,l=m.bind(this);h.default.install(),r.addEventListener("message",function(g){switch(g.data.cmd){case"init":a=new u.default(g.data.param[0],g.data.param[1]),a.on(o.default.IO_ERROR,v.bind(this)),a.on(o.default.DEMUX_ERROR,y.bind(this)),a.on(o.default.INIT_SEGMENT,i.bind(this)),a.on(o.default.MEDIA_SEGMENT,t.bind(this)),a.on(o.default.LOADING_COMPLETE,s.bind(this)),a.on(o.default.RECOVERED_EARLY_EOF,n.bind(this)),a.on(o.default.MEDIA_INFO,e.bind(this)),a.on(o.default.METADATA_ARRIVED,f.bind(this)),a.on(o.default.SCRIPTDATA_ARRIVED,_.bind(this)),a.on(o.default.STATISTICS_INFO,c.bind(this)),a.on(o.default.RECOMMEND_SEEKPOINT,x.bind(this));break;case"destroy":a&&(a.destroy(),a=null),r.postMessage({msg:"destroyed"});break;case"start":a.start();break;case"stop":a.stop();break;case"seek":a.seek(g.data.param);break;case"pause":a.pause();break;case"resume":a.resume();break;case"logging_config":{var S=g.data.param;E.default.applyConfig(S),S.enableCallback===!0?E.default.addLogListener(l):E.default.removeLogListener(l);break}}});function i(g,S){var R={msg:o.default.INIT_SEGMENT,data:{type:g,data:S}};r.postMessage(R,[S.data])}function t(g,S){var R={msg:o.default.MEDIA_SEGMENT,data:{type:g,data:S}};r.postMessage(R,[S.data])}function s(){var g={msg:o.default.LOADING_COMPLETE};r.postMessage(g)}function n(){var g={msg:o.default.RECOVERED_EARLY_EOF};r.postMessage(g)}function e(g){var S={msg:o.default.MEDIA_INFO,data:g};r.postMessage(S)}function f(g){var S={msg:o.default.METADATA_ARRIVED,data:g};r.postMessage(S)}function _(g){var S={msg:o.default.SCRIPTDATA_ARRIVED,data:g};r.postMessage(S)}function c(g){var S={msg:o.default.STATISTICS_INFO,data:g};r.postMessage(S)}function v(g,S){r.postMessage({msg:o.default.IO_ERROR,data:{type:g,info:S}})}function y(g,S){r.postMessage({msg:o.default.DEMUX_ERROR,data:{type:g,info:S}})}function x(g){r.postMessage({msg:o.default.RECOMMEND_SEEKPOINT,data:g})}function m(g,S){r.postMessage({msg:"logcat_callback",data:{type:g,logcat:S}})}};L.default=d},"./src/demux/amf-parser.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/utils/utf8-conv.js"),u=p("./src/utils/exception.js"),o=function(){var r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}(),d=function(){function r(){}return r.parseScriptData=function(a,l,i){var t={};try{var s=r.parseValue(a,l,i),n=r.parseValue(a,l+s.size,i-s.size);t[s.data]=n.data}catch(e){E.default.e("AMF",e.toString())}return t},r.parseObject=function(a,l,i){if(i<3)throw new u.IllegalStateException("Data not enough when parse ScriptDataObject");var t=r.parseString(a,l,i),s=r.parseValue(a,l+t.size,i-t.size),n=s.objectEnd;return{data:{name:t.data,value:s.data},size:t.size+s.size,objectEnd:n}},r.parseVariable=function(a,l,i){return r.parseObject(a,l,i)},r.parseString=function(a,l,i){if(i<2)throw new u.IllegalStateException("Data not enough when parse String");var t=new DataView(a,l,i),s=t.getUint16(0,!o),n;return s>0?n=(0,h.default)(new Uint8Array(a,l+2,s)):n="",{data:n,size:2+s}},r.parseLongString=function(a,l,i){if(i<4)throw new u.IllegalStateException("Data not enough when parse LongString");var t=new DataView(a,l,i),s=t.getUint32(0,!o),n;return s>0?n=(0,h.default)(new Uint8Array(a,l+4,s)):n="",{data:n,size:4+s}},r.parseDate=function(a,l,i){if(i<10)throw new u.IllegalStateException("Data size invalid when parse Date");var t=new DataView(a,l,i),s=t.getFloat64(0,!o),n=t.getInt16(8,!o);return s+=n*60*1e3,{data:new Date(s),size:8+2}},r.parseValue=function(a,l,i){if(i<1)throw new u.IllegalStateException("Data not enough when parse Value");var t=new DataView(a,l,i),s=1,n=t.getUint8(0),e,f=!1;try{switch(n){case 0:e=t.getFloat64(1,!o),s+=8;break;case 1:{var _=t.getUint8(1);e=!!_,s+=1;break}case 2:{var c=r.parseString(a,l+1,i-1);e=c.data,s+=c.size;break}case 3:{e={};var v=0;for((t.getUint32(i-4,!o)&16777215)===9&&(v=3);s<i-4;){var y=r.parseObject(a,l+s,i-s-v);if(y.objectEnd)break;e[y.data.name]=y.data.value,s+=y.size}if(s<=i-3){var x=t.getUint32(s-1,!o)&16777215;x===9&&(s+=3)}break}case 8:{e={},s+=4;var v=0;for((t.getUint32(i-4,!o)&16777215)===9&&(v=3);s<i-8;){var m=r.parseVariable(a,l+s,i-s-v);if(m.objectEnd)break;e[m.data.name]=m.data.value,s+=m.size}if(s<=i-3){var x=t.getUint32(s-1,!o)&16777215;x===9&&(s+=3)}break}case 9:e=void 0,s=1,f=!0;break;case 10:{e=[];var g=t.getUint32(1,!o);s+=4;for(var S=0;S<g;S++){var R=r.parseValue(a,l+s,i-s);e.push(R.data),s+=R.size}break}case 11:{var b=r.parseDate(a,l+1,i-1);e=b.data,s+=b.size;break}case 12:{var T=r.parseString(a,l+1,i-1);e=T.data,s+=T.size;break}default:s=i,E.default.w("AMF","Unsupported AMF value type "+n)}}catch(B){E.default.e("AMF",B.toString())}return{data:e,size:s,objectEnd:f}},r}();L.default=d},"./src/demux/demux-errors.js":function(I,L,p){p.r(L);var E={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};L.default=E},"./src/demux/exp-golomb.js":function(I,L,p){p.r(L);var E=p("./src/utils/exception.js"),h=function(){function u(o){this.TAG="ExpGolomb",this._buffer=o,this._buffer_index=0,this._total_bytes=o.byteLength,this._total_bits=o.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return u.prototype.destroy=function(){this._buffer=null},u.prototype._fillCurrentWord=function(){var o=this._total_bytes-this._buffer_index;if(o<=0)throw new E.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var d=Math.min(4,o),r=new Uint8Array(4);r.set(this._buffer.subarray(this._buffer_index,this._buffer_index+d)),this._current_word=new DataView(r.buffer).getUint32(0,!1),this._buffer_index+=d,this._current_word_bits_left=d*8},u.prototype.readBits=function(o){if(o>32)throw new E.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(o<=this._current_word_bits_left){var d=this._current_word>>>32-o;return this._current_word<<=o,this._current_word_bits_left-=o,d}var r=this._current_word_bits_left?this._current_word:0;r=r>>>32-this._current_word_bits_left;var a=o-this._current_word_bits_left;this._fillCurrentWord();var l=Math.min(a,this._current_word_bits_left),i=this._current_word>>>32-l;return this._current_word<<=l,this._current_word_bits_left-=l,r=r<<l|i,r},u.prototype.readBool=function(){return this.readBits(1)===1},u.prototype.readByte=function(){return this.readBits(8)},u.prototype._skipLeadingZero=function(){var o;for(o=0;o<this._current_word_bits_left;o++)if((this._current_word&2147483648>>>o)!==0)return this._current_word<<=o,this._current_word_bits_left-=o,o;return this._fillCurrentWord(),o+this._skipLeadingZero()},u.prototype.readUEG=function(){var o=this._skipLeadingZero();return this.readBits(o+1)-1},u.prototype.readSEG=function(){var o=this.readUEG();return o&1?o+1>>>1:-1*(o>>>1)},u}();L.default=h},"./src/demux/flv-demuxer.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/demux/amf-parser.js"),u=p("./src/demux/sps-parser.js"),o=p("./src/demux/demux-errors.js"),d=p("./src/core/media-info.js"),r=p("./src/utils/exception.js");function a(i,t){return i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3]}var l=function(){function i(t,s){this.TAG="FLVDemuxer",this._config=s,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new d.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256}()}return i.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},i.probe=function(t){var s=new Uint8Array(t),n={match:!1};if(s[0]!==70||s[1]!==76||s[2]!==86||s[3]!==1)return n;var e=(s[4]&4)>>>2!==0,f=(s[4]&1)!==0,_=a(s,5);return _<9?n:{match:!0,consumed:_,dataOffset:_,hasAudioTrack:e,hasVideoTrack:f}},i.prototype.bindDataSource=function(t){return t.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(i.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(t){this._onTrackMetadata=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(t){this._onMediaInfo=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(t){this._onMetaDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(t){this._onScriptDataArrived=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onError",{get:function(){return this._onError},set:function(t){this._onError=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(t){this._onDataAvailable=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(t){this._timestampBase=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedDuration",{get:function(){return this._duration},set:function(t){this._durationOverrided=!0,this._duration=t,this._mediaInfo.duration=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedHasAudio",{set:function(t){this._hasAudioFlagOverrided=!0,this._hasAudio=t,this._mediaInfo.hasAudio=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"overridedHasVideo",{set:function(t){this._hasVideoFlagOverrided=!0,this._hasVideo=t,this._mediaInfo.hasVideo=t},enumerable:!1,configurable:!0}),i.prototype.resetMediaInfo=function(){this._mediaInfo=new d.default},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:!1},i.prototype.parseChunks=function(t,s){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new r.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,e=this._littleEndian;if(s===0)if(t.byteLength>13){var f=i.probe(t);n=f.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,s+n!==this._dataOffset&&E.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var _=new DataView(t,n),c=_.getUint32(0,!e);c!==0&&E.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4}for(;n<t.byteLength;){this._dispatch=!0;var _=new DataView(t,n);if(n+11+4>t.byteLength)break;var v=_.getUint8(0),y=_.getUint32(0,!e)&16777215;if(n+11+y+4>t.byteLength)break;if(v!==8&&v!==9&&v!==18){E.default.w(this.TAG,"Unsupported tag type "+v+", skipped"),n+=11+y+4;continue}var x=_.getUint8(4),m=_.getUint8(5),g=_.getUint8(6),S=_.getUint8(7),R=g|m<<8|x<<16|S<<24,b=_.getUint32(7,!e)&16777215;b!==0&&E.default.w(this.TAG,"Meet tag which has StreamID != 0!");var T=n+11;switch(v){case 8:this._parseAudioData(t,T,y,R);break;case 9:this._parseVideoData(t,T,y,R,s+n);break;case 18:this._parseScriptData(t,T,y);break}var B=_.getUint32(11+y,!e);B!==11+y&&E.default.w(this.TAG,"Invalid PrevTagSize "+B),n+=11+y+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),n},i.prototype._parseScriptData=function(t,s,n){var e=h.default.parseScriptData(t,s,n);if(e.hasOwnProperty("onMetaData")){if(e.onMetaData==null||typeof e.onMetaData!="object"){E.default.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&E.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=e;var f=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},f)),typeof f.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=f.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof f.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=f.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof f.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=f.audiodatarate),typeof f.videodatarate=="number"&&(this._mediaInfo.videoDataRate=f.videodatarate),typeof f.width=="number"&&(this._mediaInfo.width=f.width),typeof f.height=="number"&&(this._mediaInfo.height=f.height),typeof f.duration=="number"){if(!this._durationOverrided){var _=Math.floor(f.duration*this._timescale);this._duration=_,this._mediaInfo.duration=_}}else this._mediaInfo.duration=0;if(typeof f.framerate=="number"){var c=Math.floor(f.framerate*1e3);if(c>0){var v=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=v,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=v}}if(typeof f.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var y=f.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(y),f.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=f,E.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(e).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},e))},i.prototype._parseKeyframesIndex=function(t){for(var s=[],n=[],e=1;e<t.times.length;e++){var f=this._timestampBase+Math.floor(t.times[e]*1e3);s.push(f),n.push(t.filepositions[e])}return{times:s,filepositions:n}},i.prototype._parseAudioData=function(t,s,n,e){if(n<=1){E.default.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(!(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)){this._littleEndian;var f=new DataView(t,s,n),_=f.getUint8(0),c=_>>>4;if(c!==2&&c!==10){this._onError(o.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+c);return}var v=0,y=(_&12)>>>2;if(y>=0&&y<=4)v=this._flvSoundRateTable[y];else{this._onError(o.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+y);return}var x=_&1,m=this._audioMetadata,g=this._audioTrack;if(m||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),m=this._audioMetadata={},m.type="audio",m.id=g.id,m.timescale=this._timescale,m.duration=this._duration,m.audioSampleRate=v,m.channelCount=x===0?1:2),c===10){var S=this._parseAACAudioData(t,s+1,n-1);if(S==null)return;if(S.packetType===0){m.config&&E.default.w(this.TAG,"Found another AudioSpecificConfig!");var R=S.data;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.config=R.config,m.refSampleDuration=1024/m.audioSampleRate*m.timescale,E.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",m);var b=this._mediaInfo;b.audioCodec=m.originalCodec,b.audioSampleRate=m.audioSampleRate,b.audioChannelCount=m.channelCount,b.hasVideo?b.videoCodec!=null&&(b.mimeType='video/x-flv; codecs="'+b.videoCodec+","+b.audioCodec+'"'):b.mimeType='video/x-flv; codecs="'+b.audioCodec+'"',b.isComplete()&&this._onMediaInfo(b)}else if(S.packetType===1){var T=this._timestampBase+e,B={unit:S.data,length:S.data.byteLength,dts:T,pts:T};g.samples.push(B),g.length+=S.data.length}else E.default.e(this.TAG,"Flv: Unsupported AAC data type "+S.packetType)}else if(c===2){if(!m.codec){var R=this._parseMP3AudioData(t,s+1,n-1,!0);if(R==null)return;m.audioSampleRate=R.samplingRate,m.channelCount=R.channelCount,m.codec=R.codec,m.originalCodec=R.originalCodec,m.refSampleDuration=1152/m.audioSampleRate*m.timescale,E.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",m);var b=this._mediaInfo;b.audioCodec=m.codec,b.audioSampleRate=m.audioSampleRate,b.audioChannelCount=m.channelCount,b.audioDataRate=R.bitRate,b.hasVideo?b.videoCodec!=null&&(b.mimeType='video/x-flv; codecs="'+b.videoCodec+","+b.audioCodec+'"'):b.mimeType='video/x-flv; codecs="'+b.audioCodec+'"',b.isComplete()&&this._onMediaInfo(b)}var U=this._parseMP3AudioData(t,s+1,n-1,!1);if(U==null)return;var T=this._timestampBase+e,w={unit:U,length:U.byteLength,dts:T,pts:T};g.samples.push(w),g.length+=U.length}}},i.prototype._parseAACAudioData=function(t,s,n){if(n<=1){E.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var e={},f=new Uint8Array(t,s,n);return e.packetType=f[0],f[0]===0?e.data=this._parseAACAudioSpecificConfig(t,s+1,n-1):e.data=f.subarray(1),e},i.prototype._parseAACAudioSpecificConfig=function(t,s,n){var e=new Uint8Array(t,s,n),f=null,_=0,c=0,v=0,y=null;if(_=c=e[0]>>>3,v=(e[0]&7)<<1|e[1]>>>7,v<0||v>=this._mpegSamplingRates.length){this._onError(o.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var x=this._mpegSamplingRates[v],m=(e[1]&120)>>>3;if(m<0||m>=8){this._onError(o.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}_===5&&(y=(e[1]&7)<<1|e[2]>>>7,(e[2]&124)>>>2);var g=self.navigator.userAgent.toLowerCase();return g.indexOf("firefox")!==-1?v>=6?(_=5,f=new Array(4),y=v-3):(_=2,f=new Array(2),y=v):g.indexOf("android")!==-1?(_=2,f=new Array(2),y=v):(_=5,y=v,f=new Array(4),v>=6?y=v-3:m===1&&(_=2,f=new Array(2),y=v)),f[0]=_<<3,f[0]|=(v&15)>>>1,f[1]=(v&15)<<7,f[1]|=(m&15)<<3,_===5&&(f[1]|=(y&15)>>>1,f[2]=(y&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplingRate:x,channelCount:m,codec:"mp4a.40."+_,originalCodec:"mp4a.40."+c}},i.prototype._parseMP3AudioData=function(t,s,n,e){if(n<4){E.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}this._littleEndian;var f=new Uint8Array(t,s,n),_=null;if(e){if(f[0]!==255)return;var c=f[1]>>>3&3,v=(f[1]&6)>>1,y=(f[2]&240)>>>4,x=(f[2]&12)>>>2,m=f[3]>>>6&3,g=m!==3?2:1,S=0,R=0,b="mp3";switch(c){case 0:S=this._mpegAudioV25SampleRateTable[x];break;case 2:S=this._mpegAudioV20SampleRateTable[x];break;case 3:S=this._mpegAudioV10SampleRateTable[x];break}switch(v){case 1:y<this._mpegAudioL3BitRateTable.length&&(R=this._mpegAudioL3BitRateTable[y]);break;case 2:y<this._mpegAudioL2BitRateTable.length&&(R=this._mpegAudioL2BitRateTable[y]);break;case 3:y<this._mpegAudioL1BitRateTable.length&&(R=this._mpegAudioL1BitRateTable[y]);break}_={bitRate:R,samplingRate:S,channelCount:g,codec:b,originalCodec:b}}else _=f;return _},i.prototype._parseVideoData=function(t,s,n,e,f){if(n<=1){E.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(!(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)){var _=new Uint8Array(t,s,n)[0],c=(_&240)>>>4,v=_&15;if(v!==7){this._onError(o.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+v);return}this._parseAVCVideoPacket(t,s+1,n-1,e,f,c)}},i.prototype._parseAVCVideoPacket=function(t,s,n,e,f,_){if(n<4){E.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var c=this._littleEndian,v=new DataView(t,s,n),y=v.getUint8(0),x=v.getUint32(0,!c)&16777215,m=x<<8>>8;if(y===0)this._parseAVCDecoderConfigurationRecord(t,s+4,n-4);else if(y===1)this._parseAVCVideoData(t,s+4,n-4,e,f,_,m);else if(y!==2){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid video packet type "+y);return}},i.prototype._parseAVCDecoderConfigurationRecord=function(t,s,n){if(n<7){E.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var e=this._videoMetadata,f=this._videoTrack,_=this._littleEndian,c=new DataView(t,s,n);e?typeof e.avcc!="undefined"&&E.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),e=this._videoMetadata={},e.type="video",e.id=f.id,e.timescale=this._timescale,e.duration=this._duration);var v=c.getUint8(0),y=c.getUint8(1);if(c.getUint8(2),c.getUint8(3),v!==1||y===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(c.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(o.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));return}var x=c.getUint8(5)&31;if(x===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else x>1&&E.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+x);for(var m=6,g=0;g<x;g++){var S=c.getUint16(m,!_);if(m+=2,S!==0){var R=new Uint8Array(t,s+m,S);m+=S;var b=u.default.parseSPS(R);if(g===0){e.codecWidth=b.codec_size.width,e.codecHeight=b.codec_size.height,e.presentWidth=b.present_size.width,e.presentHeight=b.present_size.height,e.profile=b.profile_string,e.level=b.level_string,e.bitDepth=b.bit_depth,e.chromaFormat=b.chroma_format,e.sarRatio=b.sar_ratio,e.frameRate=b.frame_rate,(b.frame_rate.fixed===!1||b.frame_rate.fps_num===0||b.frame_rate.fps_den===0)&&(e.frameRate=this._referenceFrameRate);var T=e.frameRate.fps_den,B=e.frameRate.fps_num;e.refSampleDuration=e.timescale*(T/B);for(var U=R.subarray(1,4),w="avc1.",j=0;j<3;j++){var K=U[j].toString(16);K.length<2&&(K="0"+K),w+=K}e.codec=w;var P=this._mediaInfo;P.width=e.codecWidth,P.height=e.codecHeight,P.fps=e.frameRate.fps,P.profile=e.profile,P.level=e.level,P.refFrames=b.ref_frames,P.chromaFormat=b.chroma_format_string,P.sarNum=e.sarRatio.width,P.sarDen=e.sarRatio.height,P.videoCodec=w,P.hasAudio?P.audioCodec!=null&&(P.mimeType='video/x-flv; codecs="'+P.videoCodec+","+P.audioCodec+'"'):P.mimeType='video/x-flv; codecs="'+P.videoCodec+'"',P.isComplete()&&this._onMediaInfo(P)}}}var N=c.getUint8(m);if(N===0){this._onError(o.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else N>1&&E.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+N);m++;for(var g=0;g<N;g++){var S=c.getUint16(m,!_);m+=2,S!==0&&(m+=S)}e.avcc=new Uint8Array(n),e.avcc.set(new Uint8Array(t,s,n),0),E.default.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",e)},i.prototype._parseAVCVideoData=function(t,s,n,e,f,_,c){for(var v=this._littleEndian,y=new DataView(t,s,n),x=[],m=0,g=0,S=this._naluLengthSize,R=this._timestampBase+e,b=_===1;g<n;){if(g+4>=n){E.default.w(this.TAG,"Malformed Nalu near timestamp "+R+", offset = "+g+", dataSize = "+n);break}var T=y.getUint32(g,!v);if(S===3&&(T>>>=8),T>n-S){E.default.w(this.TAG,"Malformed Nalus near timestamp "+R+", NaluSize > DataSize!");return}var B=y.getUint8(g+S)&31;B===5&&(b=!0);var U=new Uint8Array(t,s+g,S+T),w={type:B,data:U};x.push(w),m+=U.byteLength,g+=S+T}if(x.length){var j=this._videoTrack,K={units:x,length:m,isKeyframe:b,dts:R,cts:c,pts:R+c};b&&(K.fileposition=f),j.samples.push(K),j.length+=m}},i}();L.default=l},"./src/demux/sps-parser.js":function(I,L,p){p.r(L);var E=p("./src/demux/exp-golomb.js"),h=function(){function u(){}return u._ebsp2rbsp=function(o){for(var d=o,r=d.byteLength,a=new Uint8Array(r),l=0,i=0;i<r;i++)i>=2&&d[i]===3&&d[i-1]===0&&d[i-2]===0||(a[l]=d[i],l++);return new Uint8Array(a.buffer,0,l)},u.parseSPS=function(o){var d=u._ebsp2rbsp(o),r=new E.default(d);r.readByte();var a=r.readByte();r.readByte();var l=r.readByte();r.readUEG();var i=u.getProfileString(a),t=u.getLevelString(l),s=1,n=420,e=[0,420,422,444],f=8;if((a===100||a===110||a===122||a===244||a===44||a===83||a===86||a===118||a===128||a===138||a===144)&&(s=r.readUEG(),s===3&&r.readBits(1),s<=3&&(n=e[s]),f=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var _=s!==3?8:12,c=0;c<_;c++)r.readBool()&&(c<6?u._skipScalingList(r,16):u._skipScalingList(r,64));r.readUEG();var v=r.readUEG();if(v===0)r.readUEG();else if(v===1){r.readBits(1),r.readSEG(),r.readSEG();for(var y=r.readUEG(),c=0;c<y;c++)r.readSEG()}var x=r.readUEG();r.readBits(1);var m=r.readUEG(),g=r.readUEG(),S=r.readBits(1);S===0&&r.readBits(1),r.readBits(1);var R=0,b=0,T=0,B=0,U=r.readBool();U&&(R=r.readUEG(),b=r.readUEG(),T=r.readUEG(),B=r.readUEG());var w=1,j=1,K=0,P=!0,N=0,te=0,G=r.readBool();if(G){if(r.readBool()){var V=r.readByte(),q=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];V>0&&V<16?(w=q[V-1],j=Q[V-1]):V===255&&(w=r.readByte()<<8|r.readByte(),j=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var J=r.readBits(32),ne=r.readBits(32);P=r.readBool(),N=ne,te=J*2,K=N/te}}var W=1;(w!==1||j!==1)&&(W=w/j);var M=0,$=0;if(s===0)M=1,$=2-S;else{var re=s===3?1:2,ue=s===1?2:1;M=re,$=ue*(2-S)}var se=(m+1)*16,ae=(2-S)*((g+1)*16);se-=(R+b)*M,ae-=(T+B)*$;var fe=Math.ceil(se*W);return r.destroy(),r=null,{profile_string:i,level_string:t,bit_depth:f,ref_frames:x,chroma_format:n,chroma_format_string:u.getChromaFormatString(n),frame_rate:{fixed:P,fps:K,fps_den:te,fps_num:N},sar_ratio:{width:w,height:j},codec_size:{width:se,height:ae},present_size:{width:fe,height:ae}}},u._skipScalingList=function(o,d){for(var r=8,a=8,l=0,i=0;i<d;i++)a!==0&&(l=o.readSEG(),a=(r+l+256)%256),r=a===0?r:a},u.getProfileString=function(o){switch(o){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},u.getLevelString=function(o){return(o/10).toFixed(1)},u.getChromaFormatString=function(o){switch(o){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},u}();L.default=h},"./src/flv.js":function(I,L,p){p.r(L);var E=p("./src/utils/polyfill.js"),h=p("./src/core/features.js"),u=p("./src/io/loader.js"),o=p("./src/player/flv-player.js"),d=p("./src/player/native-player.js"),r=p("./src/player/player-events.js"),a=p("./src/player/player-errors.js"),l=p("./src/utils/logging-control.js"),i=p("./src/utils/exception.js");E.default.install();function t(f,_){var c=f;if(c==null||typeof c!="object")throw new i.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!c.hasOwnProperty("type"))throw new i.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");switch(c.type){case"flv":return new o.default(c,_);default:return new d.default(c,_)}}function s(){return h.default.supportMSEH264Playback()}function n(){return h.default.getFeatureList()}var e={};e.createPlayer=t,e.isSupported=s,e.getFeatureList=n,e.BaseLoader=u.BaseLoader,e.LoaderStatus=u.LoaderStatus,e.LoaderErrors=u.LoaderErrors,e.Events=r.default,e.ErrorTypes=a.ErrorTypes,e.ErrorDetails=a.ErrorDetails,e.FlvPlayer=o.default,e.NativePlayer=d.default,e.LoggingControl=l.default,Object.defineProperty(e,"version",{enumerable:!0,get:function(){return"1.6.2"}}),L.default=e},"./src/index.js":function(I,L,p){I.exports=p("./src/flv.js").default},"./src/io/fetch-stream-loader.js":function(I,L,p){p.r(L);var E=p("./src/utils/browser.js"),h=p("./src/io/loader.js"),u=p("./src/utils/exception.js"),o=function(){var r=function(a,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])},r(a,l)};return function(a,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(a,l);function i(){this.constructor=a}a.prototype=l===null?Object.create(l):(i.prototype=l.prototype,new i)}}(),d=function(r){o(a,r);function a(l,i){var t=r.call(this,"fetch-stream-loader")||this;return t.TAG="FetchStreamLoader",t._seekHandler=l,t._config=i,t._needStash=!0,t._requestAbort=!1,t._contentLength=null,t._receivedLength=0,t}return a.isSupported=function(){try{var l=E.default.msedge&&E.default.version.minor>=15048,i=E.default.msedge?l:!0;return self.fetch&&self.ReadableStream&&i}catch(t){return!1}},a.prototype.destroy=function(){this.isWorking()&&this.abort(),r.prototype.destroy.call(this)},a.prototype.open=function(l,i){var t=this;this._dataSource=l,this._range=i;var s=l.url;this._config.reuseRedirectedURL&&l.redirectedURL!=null&&(s=l.redirectedURL);var n=this._seekHandler.getConfig(s,i),e=new self.Headers;if(typeof n.headers=="object"){var f=n.headers;for(var _ in f)f.hasOwnProperty(_)&&e.append(_,f[_])}var c={method:"GET",headers:e,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var _ in this._config.headers)e.append(_,this._config.headers[_]);l.cors===!1&&(c.mode="same-origin"),l.withCredentials&&(c.credentials="include"),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,c.signal=this._abortController.signal),this._status=h.LoaderStatus.kConnecting,self.fetch(n.url,c).then(function(v){if(t._requestAbort){t._status=h.LoaderStatus.kIdle,v.body.cancel();return}if(v.ok&&v.status>=200&&v.status<=299){if(v.url!==n.url&&t._onURLRedirect){var y=t._seekHandler.removeURLParameters(v.url);t._onURLRedirect(y)}var x=v.headers.get("Content-Length");return x!=null&&(t._contentLength=parseInt(x),t._contentLength!==0&&t._onContentLengthKnown&&t._onContentLengthKnown(t._contentLength)),t._pump.call(t,v.body.getReader())}else if(t._status=h.LoaderStatus.kError,t._onError)t._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:v.status,msg:v.statusText});else throw new u.RuntimeException("FetchStreamLoader: Http code invalid, "+v.status+" "+v.statusText)}).catch(function(v){if(!(t._abortController&&t._abortController.signal.aborted))if(t._status=h.LoaderStatus.kError,t._onError)t._onError(h.LoaderErrors.EXCEPTION,{code:-1,msg:v.message});else throw v})},a.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==h.LoaderStatus.kBuffering||!E.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(l){}},a.prototype._pump=function(l){var i=this;return l.read().then(function(t){if(t.done)if(i._contentLength!==null&&i._receivedLength<i._contentLength){i._status=h.LoaderStatus.kError;var s=h.LoaderErrors.EARLY_EOF,n={code:-1,msg:"Fetch stream meet Early-EOF"};if(i._onError)i._onError(s,n);else throw new u.RuntimeException(n.msg)}else i._status=h.LoaderStatus.kComplete,i._onComplete&&i._onComplete(i._range.from,i._range.from+i._receivedLength-1);else{if(i._abortController&&i._abortController.signal.aborted){i._status=h.LoaderStatus.kComplete;return}else if(i._requestAbort===!0)return i._status=h.LoaderStatus.kComplete,l.cancel();i._status=h.LoaderStatus.kBuffering;var e=t.value.buffer,f=i._range.from+i._receivedLength;i._receivedLength+=e.byteLength,i._onDataArrival&&i._onDataArrival(e,f,i._receivedLength),i._pump(l)}}).catch(function(t){if(i._abortController&&i._abortController.signal.aborted){i._status=h.LoaderStatus.kComplete;return}if(!(t.code===11&&E.default.msedge)){i._status=h.LoaderStatus.kError;var s=0,n=null;if((t.code===19||t.message==="network error")&&(i._contentLength===null||i._contentLength!==null&&i._receivedLength<i._contentLength)?(s=h.LoaderErrors.EARLY_EOF,n={code:t.code,msg:"Fetch stream meet Early-EOF"}):(s=h.LoaderErrors.EXCEPTION,n={code:t.code,msg:t.message}),i._onError)i._onError(s,n);else throw new u.RuntimeException(n.msg)}})},a}(h.BaseLoader);L.default=d},"./src/io/io-controller.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/io/speed-sampler.js"),u=p("./src/io/loader.js"),o=p("./src/io/fetch-stream-loader.js"),d=p("./src/io/xhr-moz-chunked-loader.js"),r=p("./src/io/xhr-range-loader.js"),a=p("./src/io/websocket-loader.js"),l=p("./src/io/range-seek-handler.js"),i=p("./src/io/param-seek-handler.js"),t=p("./src/utils/exception.js"),s=function(){function n(e,f,_){this.TAG="IOController",this._config=f,this._extraData=_,this._stashInitialSize=1024*384,f.stashInitialSize!=null&&f.stashInitialSize>0&&(this._stashInitialSize=f.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,f.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new h.default,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 n.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},n.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},n.prototype.isPaused=function(){return this._paused},Object.defineProperty(n.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentSpeed",{get:function(){return this._loaderClass===r.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),n.prototype._selectSeekHandler=function(){var e=this._config;if(e.seekType==="range")this._seekHandler=new l.default(this._config.rangeLoadZeroStart);else if(e.seekType==="param"){var f=e.seekParamStart||"bstart",_=e.seekParamEnd||"bend";this._seekHandler=new i.default(f,_)}else if(e.seekType==="custom"){if(typeof e.customSeekHandler!="function")throw new t.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}else throw new t.InvalidArgumentException("Invalid seekType in config: "+e.seekType)},n.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=a.default;else if(o.default.isSupported())this._loaderClass=o.default;else if(d.default.isSupported())this._loaderClass=d.default;else if(r.default.isSupported())this._loaderClass=r.default;else throw new t.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!")},n.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)},n.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},n.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},n.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)},n.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},n.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},n.prototype._internalSeek=function(e,f){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(f),this._loader.destroy(),this._loader=null;var _={from:e,to:-1};this._currentRange={from:_.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,_),this._onSeeked&&this._onSeeked()},n.prototype.updateUrl=function(e){if(!e||typeof e!="string"||e.length===0)throw new t.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},n.prototype._expandBuffer=function(e){for(var f=this._stashSize;f+1024*1024*1<e;)f*=2;if(f+=1024*1024*1,f!==this._bufferSize){var _=new ArrayBuffer(f);if(this._stashUsed>0){var c=new Uint8Array(this._stashBuffer,0,this._stashUsed),v=new Uint8Array(_,0,f);v.set(c,0)}this._stashBuffer=_,this._bufferSize=f}},n.prototype._normalizeSpeed=function(e){var f=this._speedNormalizeList,_=f.length-1,c=0,v=0,y=_;if(e<f[0])return f[0];for(;v<=y;){if(c=v+Math.floor((y-v)/2),c===_||e>=f[c]&&e<f[c+1])return f[c];f[c]<e?v=c+1:y=c-1}},n.prototype._adjustStashSize=function(e){var f=0;this._config.isLive||e<512?f=e:e>=512&&e<=1024?f=Math.floor(e*1.5):f=e*2,f>8192&&(f=8192);var _=f*1024+1024*1024*1;this._bufferSize<_&&this._expandBuffer(_),this._stashSize=f*1024},n.prototype._dispatchChunks=function(e,f){return this._currentRange.to=f+e.byteLength-1,this._onDataArrival(e,f)},n.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},n.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},n.prototype._onLoaderChunkArrival=function(e,f,_){if(!this._onDataArrival)throw new t.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var c=this._speedSampler.lastSecondKBps;if(c!==0){var v=this._normalizeSpeed(c);this._speedNormalized!==v&&(this._speedNormalized=v,this._adjustStashSize(v))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=f),this._stashUsed+e.byteLength<=this._stashSize){var m=new Uint8Array(this._stashBuffer,0,this._stashSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var S=this._stashBuffer.slice(0,this._stashUsed),y=this._dispatchChunks(S,this._stashByteStart);if(y<S.byteLength){if(y>0){var g=new Uint8Array(S,y);m.set(g,0),this._stashUsed=g.byteLength,this._stashByteStart+=y}}else this._stashUsed=0,this._stashByteStart+=y;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),m=new Uint8Array(this._stashBuffer,0,this._bufferSize)),m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var y=this._dispatchChunks(e,f);if(y<e.byteLength){var x=e.byteLength-y;x>this._bufferSize&&(this._expandBuffer(x),m=new Uint8Array(this._stashBuffer,0,this._bufferSize)),m.set(new Uint8Array(e,y),0),this._stashUsed+=x,this._stashByteStart=f+y}}}else if(this._stashUsed===0){var y=this._dispatchChunks(e,f);if(y<e.byteLength){var x=e.byteLength-y;x>this._bufferSize&&this._expandBuffer(x);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e,y),0),this._stashUsed+=x,this._stashByteStart=f+y}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var y=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(y<this._stashUsed&&y>0){var g=new Uint8Array(this._stashBuffer,y);m.set(g,0)}this._stashUsed-=y,this._stashByteStart+=y}}},n.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var f=this._stashBuffer.slice(0,this._stashUsed),_=this._dispatchChunks(f,this._stashByteStart),c=f.byteLength-_;if(_<f.byteLength)if(e)E.default.w(this.TAG,c+" bytes unconsumed data remain when flush buffer, dropped");else{if(_>0){var v=new Uint8Array(this._stashBuffer,0,this._bufferSize),y=new Uint8Array(f,_);v.set(y,0),this._stashUsed=y.byteLength,this._stashByteStart+=_}return 0}return this._stashUsed=0,this._stashByteStart=0,c}return 0},n.prototype._onLoaderComplete=function(e,f){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},n.prototype._onLoaderError=function(e,f){switch(E.default.e(this.TAG,"Loader error, code = "+f.code+", msg = "+f.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=u.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case u.LoaderErrors.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var _=this._currentRange.to+1;_<this._totalLength&&(E.default.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(_,!1));return}e=u.LoaderErrors.UNRECOVERABLE_EARLY_EOF;break}case u.LoaderErrors.UNRECOVERABLE_EARLY_EOF:case u.LoaderErrors.CONNECTING_TIMEOUT:case u.LoaderErrors.HTTP_STATUS_CODE_INVALID:case u.LoaderErrors.EXCEPTION:break}if(this._onError)this._onError(e,f);else throw new t.RuntimeException("IOException: "+f.msg)},n}();L.default=s},"./src/io/loader.js":function(I,L,p){p.r(L),p.d(L,{LoaderStatus:function(){return h},LoaderErrors:function(){return u},BaseLoader:function(){return o}});var E=p("./src/utils/exception.js"),h={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},u={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function d(r){this._type=r||"undefined",this._status=h.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return d.prototype.destroy=function(){this._status=h.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},d.prototype.isWorking=function(){return this._status===h.kConnecting||this._status===h.kBuffering},Object.defineProperty(d.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(r){this._onContentLengthKnown=r},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(r){this._onURLRedirect=r},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(r){this._onDataArrival=r},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onError",{get:function(){return this._onError},set:function(r){this._onError=r},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onComplete",{get:function(){return this._onComplete},set:function(r){this._onComplete=r},enumerable:!1,configurable:!0}),d.prototype.open=function(r,a){throw new E.NotImplementedException("Unimplemented abstract function!")},d.prototype.abort=function(){throw new E.NotImplementedException("Unimplemented abstract function!")},d}()},"./src/io/param-seek-handler.js":function(I,L,p){p.r(L);var E=function(){function h(u,o){this._startName=u,this._endName=o}return h.prototype.getConfig=function(u,o){var d=u;if(o.from!==0||o.to!==-1){var r=!0;d.indexOf("?")===-1&&(d+="?",r=!1),r&&(d+="&"),d+=this._startName+"="+o.from.toString(),o.to!==-1&&(d+="&"+this._endName+"="+o.to.toString())}return{url:d,headers:{}}},h.prototype.removeURLParameters=function(u){var o=u.split("?")[0],d=void 0,r=u.indexOf("?");r!==-1&&(d=u.substring(r+1));var a="";if(d!=null&&d.length>0)for(var l=d.split("&"),i=0;i<l.length;i++){var t=l[i].split("="),s=i>0;t[0]!==this._startName&&t[0]!==this._endName&&(s&&(a+="&"),a+=l[i])}return a.length===0?o:o+"?"+a},h}();L.default=E},"./src/io/range-seek-handler.js":function(I,L,p){p.r(L);var E=function(){function h(u){this._zeroStart=u||!1}return h.prototype.getConfig=function(u,o){var d={};if(o.from!==0||o.to!==-1){var r=void 0;o.to!==-1?r="bytes="+o.from.toString()+"-"+o.to.toString():r="bytes="+o.from.toString()+"-",d.Range=r}else this._zeroStart&&(d.Range="bytes=0-");return{url:u,headers:d}},h.prototype.removeURLParameters=function(u){return u},h}();L.default=E},"./src/io/speed-sampler.js":function(I,L,p){p.r(L);var E=function(){function h(){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 h.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},h.prototype.addBytes=function(u){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=u,this._totalBytes+=u):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=u,this._totalBytes+=u):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=u,this._totalBytes+=u,this._lastCheckpoint=this._now())},Object.defineProperty(h.prototype,"currentKBps",{get:function(){this.addBytes(0);var u=(this._now()-this._lastCheckpoint)/1e3;return u==0&&(u=1),this._intervalBytes/u/1024},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"averageKBps",{get:function(){var u=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/u/1024},enumerable:!1,configurable:!0}),h}();L.default=E},"./src/io/websocket-loader.js":function(I,L,p){p.r(L);var E=p("./src/io/loader.js"),h=p("./src/utils/exception.js"),u=function(){var d=function(r,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,i){l.__proto__=i}||function(l,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(l[t]=i[t])},d(r,a)};return function(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(r,a);function l(){this.constructor=r}r.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),o=function(d){u(r,d);function r(){var a=d.call(this,"websocket-loader")||this;return a.TAG="WebSocketLoader",a._needStash=!0,a._ws=null,a._requestAbort=!1,a._receivedLength=0,a}return r.isSupported=function(){try{return typeof self.WebSocket!="undefined"}catch(a){return!1}},r.prototype.destroy=function(){this._ws&&this.abort(),d.prototype.destroy.call(this)},r.prototype.open=function(a){try{var l=this._ws=new self.WebSocket(a.url);l.binaryType="arraybuffer",l.onopen=this._onWebSocketOpen.bind(this),l.onclose=this._onWebSocketClose.bind(this),l.onmessage=this._onWebSocketMessage.bind(this),l.onerror=this._onWebSocketError.bind(this),this._status=E.LoaderStatus.kConnecting}catch(t){this._status=E.LoaderStatus.kError;var i={code:t.code,msg:t.message};if(this._onError)this._onError(E.LoaderErrors.EXCEPTION,i);else throw new h.RuntimeException(i.msg)}},r.prototype.abort=function(){var a=this._ws;a&&(a.readyState===0||a.readyState===1)&&(this._requestAbort=!0,a.close()),this._ws=null,this._status=E.LoaderStatus.kComplete},r.prototype._onWebSocketOpen=function(a){this._status=E.LoaderStatus.kBuffering},r.prototype._onWebSocketClose=function(a){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=E.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)},r.prototype._onWebSocketMessage=function(a){var l=this;if(a.data instanceof ArrayBuffer)this._dispatchArrayBuffer(a.data);else if(a.data instanceof Blob){var i=new FileReader;i.onload=function(){l._dispatchArrayBuffer(i.result)},i.readAsArrayBuffer(a.data)}else{this._status=E.LoaderStatus.kError;var t={code:-1,msg:"Unsupported WebSocket message type: "+a.data.constructor.name};if(this._onError)this._onError(E.LoaderErrors.EXCEPTION,t);else throw new h.RuntimeException(t.msg)}},r.prototype._dispatchArrayBuffer=function(a){var l=a,i=this._receivedLength;this._receivedLength+=l.byteLength,this._onDataArrival&&this._onDataArrival(l,i,this._receivedLength)},r.prototype._onWebSocketError=function(a){this._status=E.LoaderStatus.kError;var l={code:a.code,msg:a.message};if(this._onError)this._onError(E.LoaderErrors.EXCEPTION,l);else throw new h.RuntimeException(l.msg)},r}(E.BaseLoader);L.default=o},"./src/io/xhr-moz-chunked-loader.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/io/loader.js"),u=p("./src/utils/exception.js"),o=function(){var r=function(a,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])},r(a,l)};return function(a,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(a,l);function i(){this.constructor=a}a.prototype=l===null?Object.create(l):(i.prototype=l.prototype,new i)}}(),d=function(r){o(a,r);function a(l,i){var t=r.call(this,"xhr-moz-chunked-loader")||this;return t.TAG="MozChunkedLoader",t._seekHandler=l,t._config=i,t._needStash=!0,t._xhr=null,t._requestAbort=!1,t._contentLength=null,t._receivedLength=0,t}return a.isSupported=function(){try{var l=new XMLHttpRequest;return l.open("GET","https://example.com",!0),l.responseType="moz-chunked-arraybuffer",l.responseType==="moz-chunked-arraybuffer"}catch(i){return E.default.w("MozChunkedLoader",i.message),!1}},a.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),r.prototype.destroy.call(this)},a.prototype.open=function(l,i){this._dataSource=l,this._range=i;var t=l.url;this._config.reuseRedirectedURL&&l.redirectedURL!=null&&(t=l.redirectedURL);var s=this._seekHandler.getConfig(t,i);this._requestURL=s.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",s.url,!0),n.responseType="moz-chunked-arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onloadend=this._onLoadEnd.bind(this),n.onerror=this._onXhrError.bind(this),l.withCredentials&&(n.withCredentials=!0),typeof s.headers=="object"){var e=s.headers;for(var f in e)e.hasOwnProperty(f)&&n.setRequestHeader(f,e[f])}if(typeof this._config.headers=="object"){var e=this._config.headers;for(var f in e)e.hasOwnProperty(f)&&n.setRequestHeader(f,e[f])}this._status=h.LoaderStatus.kConnecting,n.send()},a.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=h.LoaderStatus.kComplete},a.prototype._onReadyStateChange=function(l){var i=l.target;if(i.readyState===2){if(i.responseURL!=null&&i.responseURL!==this._requestURL&&this._onURLRedirect){var t=this._seekHandler.removeURLParameters(i.responseURL);this._onURLRedirect(t)}if(i.status!==0&&(i.status<200||i.status>299))if(this._status=h.LoaderStatus.kError,this._onError)this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:i.status,msg:i.statusText});else throw new u.RuntimeException("MozChunkedLoader: Http code invalid, "+i.status+" "+i.statusText);else this._status=h.LoaderStatus.kBuffering}},a.prototype._onProgress=function(l){if(this._status!==h.LoaderStatus.kError){this._contentLength===null&&l.total!==null&&l.total!==0&&(this._contentLength=l.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var i=l.target.response,t=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,t,this._receivedLength)}},a.prototype._onLoadEnd=function(l){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===h.LoaderStatus.kError)return;this._status=h.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)},a.prototype._onXhrError=function(l){this._status=h.LoaderStatus.kError;var i=0,t=null;if(this._contentLength&&l.loaded<this._contentLength?(i=h.LoaderErrors.EARLY_EOF,t={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(i=h.LoaderErrors.EXCEPTION,t={code:-1,msg:l.constructor.name+" "+l.type}),this._onError)this._onError(i,t);else throw new u.RuntimeException(t.msg)},a}(h.BaseLoader);L.default=d},"./src/io/xhr-range-loader.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/io/speed-sampler.js"),u=p("./src/io/loader.js"),o=p("./src/utils/exception.js"),d=function(){var a=function(l,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])},a(l,i)};return function(l,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(l,i);function t(){this.constructor=l}l.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),r=function(a){d(l,a);function l(i,t){var s=a.call(this,"xhr-range-loader")||this;return s.TAG="RangeLoader",s._seekHandler=i,s._config=t,s._needStash=!1,s._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],s._currentChunkSizeKB=384,s._currentSpeedNormalized=0,s._zeroSpeedChunkCount=0,s._xhr=null,s._speedSampler=new h.default,s._requestAbort=!1,s._waitForTotalLength=!1,s._totalLengthReceived=!1,s._currentRequestURL=null,s._currentRedirectedURL=null,s._currentRequestRange=null,s._totalLength=null,s._contentLength=null,s._receivedLength=0,s._lastTimeLoaded=0,s}return l.isSupported=function(){try{var i=new XMLHttpRequest;return i.open("GET","https://example.com",!0),i.responseType="arraybuffer",i.responseType==="arraybuffer"}catch(t){return E.default.w("RangeLoader",t.message),!1}},l.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),a.prototype.destroy.call(this)},Object.defineProperty(l.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),l.prototype.open=function(i,t){this._dataSource=i,this._range=t,this._status=u.LoaderStatus.kConnecting;var s=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(s=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!s?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()},l.prototype._openSubRange=function(){var i=this._currentChunkSizeKB*1024,t=this._range.from+this._receivedLength,s=t+i;this._contentLength!=null&&s-this._range.from>=this._contentLength&&(s=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:s},this._internalOpen(this._dataSource,this._currentRequestRange)},l.prototype._internalOpen=function(i,t){this._lastTimeLoaded=0;var s=i.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?s=this._currentRedirectedURL:i.redirectedURL!=null&&(s=i.redirectedURL));var n=this._seekHandler.getConfig(s,t);this._currentRequestURL=n.url;var e=this._xhr=new XMLHttpRequest;if(e.open("GET",n.url,!0),e.responseType="arraybuffer",e.onreadystatechange=this._onReadyStateChange.bind(this),e.onprogress=this._onProgress.bind(this),e.onload=this._onLoad.bind(this),e.onerror=this._onXhrError.bind(this),i.withCredentials&&(e.withCredentials=!0),typeof n.headers=="object"){var f=n.headers;for(var _ in f)f.hasOwnProperty(_)&&e.setRequestHeader(_,f[_])}if(typeof this._config.headers=="object"){var f=this._config.headers;for(var _ in f)f.hasOwnProperty(_)&&e.setRequestHeader(_,f[_])}e.send()},l.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=u.LoaderStatus.kComplete},l.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)},l.prototype._onReadyStateChange=function(i){var t=i.target;if(t.readyState===2){if(t.responseURL!=null){var s=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&s!==this._currentRedirectedURL&&(this._currentRedirectedURL=s,this._onURLRedirect&&this._onURLRedirect(s))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=u.LoaderStatus.kBuffering}else if(this._status=u.LoaderStatus.kError,this._onError)this._onError(u.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText});else throw new o.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText)}},l.prototype._onProgress=function(i){if(this._status!==u.LoaderStatus.kError){if(this._contentLength===null){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var s=i.total;this._internalAbort(),s!=null&s!==0&&(this._totalLength=s)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=i.loaded-this._lastTimeLoaded;this._lastTimeLoaded=i.loaded,this._speedSampler.addBytes(n)}},l.prototype._normalizeSpeed=function(i){var t=this._chunkSizeKBList,s=t.length-1,n=0,e=0,f=s;if(i<t[0])return t[0];for(;e<=f;){if(n=e+Math.floor((f-e)/2),n===s||i>=t[n]&&i<t[n+1])return t[n];t[n]<i?e=n+1:f=n-1}},l.prototype._onLoad=function(i){if(this._status!==u.LoaderStatus.kError){if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(t===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),t!==0){var s=this._normalizeSpeed(t);this._currentSpeedNormalized!==s&&(this._currentSpeedNormalized=s,this._currentChunkSizeKB=s)}var n=i.target.response,e=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var f=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():f=!0,this._onDataArrival&&this._onDataArrival(n,e,this._receivedLength),f&&(this._status=u.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},l.prototype._onXhrError=function(i){this._status=u.LoaderStatus.kError;var t=0,s=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=u.LoaderErrors.EARLY_EOF,s={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=u.LoaderErrors.EXCEPTION,s={code:-1,msg:i.constructor.name+" "+i.type}),this._onError)this._onError(t,s);else throw new o.RuntimeException(s.msg)},l}(u.BaseLoader);L.default=r},"./src/player/flv-player.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./src/utils/logger.js"),o=p("./src/utils/browser.js"),d=p("./src/player/player-events.js"),r=p("./src/core/transmuxer.js"),a=p("./src/core/transmuxing-events.js"),l=p("./src/core/mse-controller.js"),i=p("./src/core/mse-events.js"),t=p("./src/player/player-errors.js"),s=p("./src/config.js"),n=p("./src/utils/exception.js"),e=function(){function f(_,c){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(h()),this._config=(0,s.createDefaultConfig)(),typeof c=="object"&&Object.assign(this._config,c),_.type.toLowerCase()!=="flv")throw new n.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");_.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=_,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 v=o.default.chrome&&(o.default.version.major<50||o.default.version.major===50&&o.default.version.build<2661);this._alwaysSeekKeyframe=!!(v||o.default.msedge||o.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return f.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},f.prototype.on=function(_,c){var v=this;_===d.default.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){v._emitter.emit(d.default.MEDIA_INFO,v.mediaInfo)}):_===d.default.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){v._emitter.emit(d.default.STATISTICS_INFO,v.statisticsInfo)}),this._emitter.addListener(_,c)},f.prototype.off=function(_,c){this._emitter.removeListener(_,c)},f.prototype.attachMediaElement=function(_){var c=this;if(this._mediaElement=_,_.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),_.addEventListener("seeking",this.e.onvSeeking),_.addEventListener("canplay",this.e.onvCanPlay),_.addEventListener("stalled",this.e.onvStalled),_.addEventListener("progress",this.e.onvProgress),this._msectl=new l.default(this._config),this._msectl.on(i.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(i.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(i.default.SOURCE_OPEN,function(){c._mseSourceOpened=!0,c._hasPendingLoad&&(c._hasPendingLoad=!1,c.load())}),this._msectl.on(i.default.ERROR,function(v){c._emitter.emit(d.default.ERROR,t.ErrorTypes.MEDIA_ERROR,t.ErrorDetails.MEDIA_MSE_ERROR,v)}),this._msectl.attachMediaElement(_),this._pendingSeekTime!=null)try{_.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(v){}},f.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)},f.prototype.load=function(){var _=this;if(!this._mediaElement)throw new n.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new n.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new r.default(this._mediaDataSource,this._config),this._transmuxer.on(a.default.INIT_SEGMENT,function(c,v){_._msectl.appendInitSegment(v)}),this._transmuxer.on(a.default.MEDIA_SEGMENT,function(c,v){if(_._msectl.appendMediaSegment(v),_._config.lazyLoad&&!_._config.isLive){var y=_._mediaElement.currentTime;v.info.endDts>=(y+_._config.lazyLoadMaxDuration)*1e3&&_._progressChecker==null&&(u.default.v(_.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),_._suspendTransmuxer())}}),this._transmuxer.on(a.default.LOADING_COMPLETE,function(){_._msectl.endOfStream(),_._emitter.emit(d.default.LOADING_COMPLETE)}),this._transmuxer.on(a.default.RECOVERED_EARLY_EOF,function(){_._emitter.emit(d.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(a.default.IO_ERROR,function(c,v){_._emitter.emit(d.default.ERROR,t.ErrorTypes.NETWORK_ERROR,c,v)}),this._transmuxer.on(a.default.DEMUX_ERROR,function(c,v){_._emitter.emit(d.default.ERROR,t.ErrorTypes.MEDIA_ERROR,c,{code:-1,msg:v})}),this._transmuxer.on(a.default.MEDIA_INFO,function(c){_._mediaInfo=c,_._emitter.emit(d.default.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(a.default.METADATA_ARRIVED,function(c){_._emitter.emit(d.default.METADATA_ARRIVED,c)}),this._transmuxer.on(a.default.SCRIPTDATA_ARRIVED,function(c){_._emitter.emit(d.default.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(a.default.STATISTICS_INFO,function(c){_._statisticsInfo=_._fillStatisticsInfo(c),_._emitter.emit(d.default.STATISTICS_INFO,Object.assign({},_._statisticsInfo))}),this._transmuxer.on(a.default.RECOMMEND_SEEKPOINT,function(c){_._mediaElement&&!_._config.accurateSeek&&(_._requestSetTime=!0,_._mediaElement.currentTime=c/1e3)}),this._transmuxer.open()}},f.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)},f.prototype.play=function(){return this._mediaElement.play()},f.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(f.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(_){this._mediaElement.volume=_},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(_){this._mediaElement.muted=_},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(_){this._mediaElement?this._internalSeek(_):this._pendingSeekTime=_},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),f.prototype._fillStatisticsInfo=function(_){if(_.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return _;var c=!0,v=0,y=0;if(this._mediaElement.getVideoPlaybackQuality){var x=this._mediaElement.getVideoPlaybackQuality();v=x.totalVideoFrames,y=x.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(v=this._mediaElement.webkitDecodedFrameCount,y=this._mediaElement.webkitDroppedFrameCount):c=!1;return c&&(_.decodedFrames=v,_.droppedFrames=y),_},f.prototype._onmseUpdateEnd=function(){if(!(!this._config.lazyLoad||this._config.isLive)){for(var _=this._mediaElement.buffered,c=this._mediaElement.currentTime,v=0,y=0;y<_.length;y++){var x=_.start(y),m=_.end(y);if(x<=c&&c<m){v=m;break}}v>=c+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(u.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},f.prototype._onmseBufferFull=function(){u.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},f.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},f.prototype._checkProgressAndResume=function(){for(var _=this._mediaElement.currentTime,c=this._mediaElement.buffered,v=!1,y=0;y<c.length;y++){var x=c.start(y),m=c.end(y);if(_>=x&&_<m){_>=m-this._config.lazyLoadRecoverDuration&&(v=!0);break}}v&&(window.clearInterval(this._progressChecker),this._progressChecker=null,v&&(u.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},f.prototype._isTimepointBuffered=function(_){for(var c=this._mediaElement.buffered,v=0;v<c.length;v++){var y=c.start(v),x=c.end(v);if(_>=y&&_<x)return!0}return!1},f.prototype._internalSeek=function(_){var c=this._isTimepointBuffered(_),v=!1,y=0;if(_<1&&this._mediaElement.buffered.length>0){var x=this._mediaElement.buffered.start(0);(x<1&&_<x||o.default.safari)&&(v=!0,y=o.default.safari?.1:x)}if(v)this._requestSetTime=!0,this._mediaElement.currentTime=y;else if(c){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=_;else{var m=this._msectl.getNearestKeyframe(Math.floor(_*1e3));this._requestSetTime=!0,m!=null?this._mediaElement.currentTime=m.dts/1e3:this._mediaElement.currentTime=_}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(_),this._transmuxer.seek(Math.floor(_*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=_)},f.prototype._checkAndApplyUnbufferedSeekpoint=function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var _=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(_)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(_),this._transmuxer.seek(Math.floor(_*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=_))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},f.prototype._checkAndResumeStuckPlayback=function(_){var c=this._mediaElement;if(_||!this._receivedCanPlay||c.readyState<2){var v=c.buffered;v.length>0&&c.currentTime<v.start(0)&&(u.default.w(this.TAG,"Playback seems stuck at "+c.currentTime+", seek to "+v.start(0)),this._requestSetTime=!0,this._mediaElement.currentTime=v.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)},f.prototype._onvLoadedMetadata=function(_){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)},f.prototype._onvSeeking=function(_){var c=this._mediaElement.currentTime,v=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(c<1&&v.length>0){var y=v.start(0);if(y<1&&c<y||o.default.safari){this._requestSetTime=!0,this._mediaElement.currentTime=o.default.safari?.1:y;return}}if(this._isTimepointBuffered(c)){if(this._alwaysSeekKeyframe){var x=this._msectl.getNearestKeyframe(Math.floor(c*1e3));x!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=x.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:c,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},f.prototype._onvCanPlay=function(_){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)},f.prototype._onvStalled=function(_){this._checkAndResumeStuckPlayback(!0)},f.prototype._onvProgress=function(_){this._checkAndResumeStuckPlayback()},f}();L.default=e},"./src/player/native-player.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./src/player/player-events.js"),o=p("./src/config.js"),d=p("./src/utils/exception.js"),r=function(){function a(l,i){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(h()),this._config=(0,o.createDefaultConfig)(),typeof i=="object"&&Object.assign(this._config,i),l.type.toLowerCase()==="flv")throw new d.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(l.hasOwnProperty("segments"))throw new d.InvalidArgumentException("NativePlayer("+l.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=l,this._mediaElement=null}return a.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},a.prototype.on=function(l,i){var t=this;l===u.default.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){t._emitter.emit(u.default.MEDIA_INFO,t.mediaInfo)}):l===u.default.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){t._emitter.emit(u.default.STATISTICS_INFO,t.statisticsInfo)}),this._emitter.addListener(l,i)},a.prototype.off=function(l,i){this._emitter.removeListener(l,i)},a.prototype.attachMediaElement=function(l){if(this._mediaElement=l,l.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{l.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(i){}},a.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},a.prototype.load=function(){if(!this._mediaElement)throw new d.IllegalStateException("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},a.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},a.prototype.play=function(){return this._mediaElement.play()},a.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(a.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(l){this._mediaElement.volume=l},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(l){this._mediaElement.muted=l},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(l){this._mediaElement?this._mediaElement.currentTime=l:this._pendingSeekTime=l},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"mediaInfo",{get:function(){var l=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",i={mimeType:l+this._mediaDataSource.type};return this._mediaElement&&(i.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(i.width=this._mediaElement.videoWidth,i.height=this._mediaElement.videoHeight)),i},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"statisticsInfo",{get:function(){var l={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return l;var i=!0,t=0,s=0;if(this._mediaElement.getVideoPlaybackQuality){var n=this._mediaElement.getVideoPlaybackQuality();t=n.totalVideoFrames,s=n.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(t=this._mediaElement.webkitDecodedFrameCount,s=this._mediaElement.webkitDroppedFrameCount):i=!1;return i&&(l.decodedFrames=t,l.droppedFrames=s),l},enumerable:!1,configurable:!0}),a.prototype._onvLoadedMetadata=function(l){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(u.default.MEDIA_INFO,this.mediaInfo)},a.prototype._reportStatisticsInfo=function(){this._emitter.emit(u.default.STATISTICS_INFO,this.statisticsInfo)},a}();L.default=r},"./src/player/player-errors.js":function(I,L,p){p.r(L),p.d(L,{ErrorTypes:function(){return u},ErrorDetails:function(){return o}});var E=p("./src/io/loader.js"),h=p("./src/demux/demux-errors.js"),u={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},o={NETWORK_EXCEPTION:E.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:E.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:E.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:E.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:h.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:h.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:h.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js":function(I,L,p){p.r(L);var E={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"};L.default=E},"./src/remux/aac-silent.js":function(I,L,p){p.r(L);var E=function(){function h(){}return h.getSilentFrame=function(u,o){if(u==="mp4a.40.2"){if(o===1)return new Uint8Array([0,200,0,128,35,128]);if(o===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(o===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(o===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(o===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(o===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(o===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(o===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(o===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},h}();L.default=E},"./src/remux/mp4-generator.js":function(I,L,p){p.r(L);var E=function(){function h(){}return h.init=function(){h.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":[]};for(var u in h.types)h.types.hasOwnProperty(u)&&(h.types[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);var o=h.constants={};o.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),o.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),o.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),o.STSC=o.STCO=o.STTS,o.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),o.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]),o.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]),o.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),o.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},h.box=function(u){for(var o=8,d=null,r=Array.prototype.slice.call(arguments,1),a=r.length,l=0;l<a;l++)o+=r[l].byteLength;d=new Uint8Array(o),d[0]=o>>>24&255,d[1]=o>>>16&255,d[2]=o>>>8&255,d[3]=o&255,d.set(u,4);for(var i=8,l=0;l<a;l++)d.set(r[l],i),i+=r[l].byteLength;return d},h.generateInitSegment=function(u){var o=h.box(h.types.ftyp,h.constants.FTYP),d=h.moov(u),r=new Uint8Array(o.byteLength+d.byteLength);return r.set(o,0),r.set(d,o.byteLength),r},h.moov=function(u){var o=h.mvhd(u.timescale,u.duration),d=h.trak(u),r=h.mvex(u);return h.box(h.types.moov,o,d,r)},h.mvhd=function(u,o){return h.box(h.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,u>>>24&255,u>>>16&255,u>>>8&255,u&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,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]))},h.trak=function(u){return h.box(h.types.trak,h.tkhd(u),h.mdia(u))},h.tkhd=function(u){var o=u.id,d=u.duration,r=u.presentWidth,a=u.presentHeight;return h.box(h.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255,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,r>>>8&255,r&255,0,0,a>>>8&255,a&255,0,0]))},h.mdia=function(u){return h.box(h.types.mdia,h.mdhd(u),h.hdlr(u),h.minf(u))},h.mdhd=function(u){var o=u.timescale,d=u.duration;return h.box(h.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,85,196,0,0]))},h.hdlr=function(u){var o=null;return u.type==="audio"?o=h.constants.HDLR_AUDIO:o=h.constants.HDLR_VIDEO,h.box(h.types.hdlr,o)},h.minf=function(u){var o=null;return u.type==="audio"?o=h.box(h.types.smhd,h.constants.SMHD):o=h.box(h.types.vmhd,h.constants.VMHD),h.box(h.types.minf,o,h.dinf(),h.stbl(u))},h.dinf=function(){var u=h.box(h.types.dinf,h.box(h.types.dref,h.constants.DREF));return u},h.stbl=function(u){var o=h.box(h.types.stbl,h.stsd(u),h.box(h.types.stts,h.constants.STTS),h.box(h.types.stsc,h.constants.STSC),h.box(h.types.stsz,h.constants.STSZ),h.box(h.types.stco,h.constants.STCO));return o},h.stsd=function(u){return u.type==="audio"?u.codec==="mp3"?h.box(h.types.stsd,h.constants.STSD_PREFIX,h.mp3(u)):h.box(h.types.stsd,h.constants.STSD_PREFIX,h.mp4a(u)):h.box(h.types.stsd,h.constants.STSD_PREFIX,h.avc1(u))},h.mp3=function(u){var o=u.channelCount,d=u.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,o,0,16,0,0,0,0,d>>>8&255,d&255,0,0]);return h.box(h.types[".mp3"],r)},h.mp4a=function(u){var o=u.channelCount,d=u.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,o,0,16,0,0,0,0,d>>>8&255,d&255,0,0]);return h.box(h.types.mp4a,r,h.esds(u))},h.esds=function(u){var o=u.config||[],d=o.length,r=new Uint8Array([0,0,0,0,3,23+d,0,1,0,4,15+d,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([d]).concat(o).concat([6,1,2]));return h.box(h.types.esds,r)},h.avc1=function(u){var o=u.avcc,d=u.codecWidth,r=u.codecHeight,a=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,d>>>8&255,d&255,r>>>8&255,r&255,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 h.box(h.types.avc1,a,h.box(h.types.avcC,o))},h.mvex=function(u){return h.box(h.types.mvex,h.trex(u))},h.trex=function(u){var o=u.id,d=new Uint8Array([0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return h.box(h.types.trex,d)},h.moof=function(u,o){return h.box(h.types.moof,h.mfhd(u.sequenceNumber),h.traf(u,o))},h.mfhd=function(u){var o=new Uint8Array([0,0,0,0,u>>>24&255,u>>>16&255,u>>>8&255,u&255]);return h.box(h.types.mfhd,o)},h.traf=function(u,o){var d=u.id,r=h.box(h.types.tfhd,new Uint8Array([0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255])),a=h.box(h.types.tfdt,new Uint8Array([0,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255])),l=h.sdtp(u),i=h.trun(u,l.byteLength+16+16+8+16+8+8);return h.box(h.types.traf,r,a,i,l)},h.sdtp=function(u){for(var o=u.samples||[],d=o.length,r=new Uint8Array(4+d),a=0;a<d;a++){var l=o[a].flags;r[a+4]=l.isLeading<<6|l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy}return h.box(h.types.sdtp,r)},h.trun=function(u,o){var d=u.samples||[],r=d.length,a=12+16*r,l=new Uint8Array(a);o+=8+a,l.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255],0);for(var i=0;i<r;i++){var t=d[i].duration,s=d[i].size,n=d[i].flags,e=d[i].cts;l.set([t>>>24&255,t>>>16&255,t>>>8&255,t&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.isNonSync,0,0,e>>>24&255,e>>>16&255,e>>>8&255,e&255],12+16*i)}return h.box(h.types.trun,l)},h.mdat=function(u){return h.box(h.types.mdat,u)},h}();E.init(),L.default=E},"./src/remux/mp4-remuxer.js":function(I,L,p){p.r(L);var E=p("./src/utils/logger.js"),h=p("./src/remux/mp4-generator.js"),u=p("./src/remux/aac-silent.js"),o=p("./src/utils/browser.js"),d=p("./src/core/media-segment-info.js"),r=p("./src/utils/exception.js"),a=function(){function l(i){this.TAG="MP4Remuxer",this._config=i,this._isLive=i.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new d.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new d.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(o.default.chrome&&(o.default.version.major<50||o.default.version.major===50&&o.default.version.build<2661)),this._fillSilentAfterSeek=o.default.msedge||o.default.msie,this._mp3UseMpegAudio=!o.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return l.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},l.prototype.bindDataSource=function(i){return i.onDataAvailable=this.remux.bind(this),i.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(l.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(i){this._onInitSegment=i},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(i){this._onMediaSegment=i},enumerable:!1,configurable:!0}),l.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},l.prototype.seek=function(i){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},l.prototype.remux=function(i,t){if(!this._onMediaSegment)throw new r.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(i,t),this._remuxVideo(t),this._remuxAudio(i)},l.prototype._onTrackMetadataReceived=function(i,t){var s=null,n="mp4",e=t.codec;if(i==="audio")this._audioMeta=t,t.codec==="mp3"&&this._mp3UseMpegAudio?(n="mpeg",e="",s=new Uint8Array):s=h.default.generateInitSegment(t);else if(i==="video")this._videoMeta=t,s=h.default.generateInitSegment(t);else return;if(!this._onInitSegment)throw new r.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(i,{type:i,data:s.buffer,codec:e,container:i+"/"+n,mediaDuration:t.duration})},l.prototype._calculateDtsBase=function(i,t){this._dtsBaseInited||(i.samples&&i.samples.length&&(this._audioDtsBase=i.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},l.prototype.flushStashedSamples=function(){var i=this._videoStashedLastSample,t=this._audioStashedLastSample,s={type:"video",id:1,sequenceNumber:0,samples:[],length:0};i!=null&&(s.samples.push(i),s.length=i.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};t!=null&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(s,!0),this._remuxAudio(n,!0)},l.prototype._remuxAudio=function(i,t){if(this._audioMeta!=null){var s=i,n=s.samples,e=void 0,f=-1,_=-1,c=this._audioMeta.refSampleDuration,v=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,y=this._dtsBaseInited&&this._audioNextDts===void 0,x=!1;if(!(!n||n.length===0)&&!(n.length===1&&!t)){var m=0,g=null,S=0;v?(m=0,S=s.length):(m=8,S=8+s.length);var R=null;if(n.length>1&&(R=n.pop(),S-=R.length),this._audioStashedLastSample!=null){var b=this._audioStashedLastSample;this._audioStashedLastSample=null,n.unshift(b),S+=b.length}R!=null&&(this._audioStashedLastSample=R);var T=n[0].dts-this._dtsBase;if(this._audioNextDts)e=T-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())e=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(x=!0);else{var B=this._audioSegmentInfoList.getLastSampleBefore(T);if(B!=null){var U=T-(B.originalDts+B.duration);U<=3&&(U=0);var w=B.dts+B.duration+U;e=T-w}else e=0}if(x){var j=T-e,K=this._videoSegmentInfoList.getLastSegmentBefore(T);if(K!=null&&K.beginDts<j){var P=u.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(P){var N=K.beginDts,te=j-K.beginDts;E.default.v(this.TAG,"InsertPrefixSilentAudio: dts: "+N+", duration: "+te),n.unshift({unit:P,dts:N,pts:N}),S+=P.byteLength}}else x=!1}for(var G=[],V=0;V<n.length;V++){var b=n[V],q=b.unit,Q=b.dts-this._dtsBase,N=Q,J=!1,ne=null,W=0;if(!(Q<-.001)){if(this._audioMeta.codec!=="mp3"){var M=Q,$=3;if(this._audioNextDts&&(M=this._audioNextDts),e=Q-M,e<=-$*c){E.default.w(this.TAG,"Dropping 1 audio frame (originalDts: "+Q+" ms ,curRefDts: "+M+" ms) due to dtsCorrection: "+e+" ms overlap.");continue}else if(e>=$*c&&this._fillAudioTimestampGap&&!o.default.safari){J=!0;var re=Math.floor(e/c);E.default.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+("originalDts: "+Q+" ms, curRefDts: "+M+" ms, ")+("dtsCorrection: "+Math.round(e)+" ms, generate: "+re+" frames")),N=Math.floor(M),W=Math.floor(M+c)-N;var P=u.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);P==null&&(E.default.w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),P=q),ne=[];for(var ue=0;ue<re;ue++){M=M+c;var se=Math.floor(M),ae=Math.floor(M+c)-se,fe={dts:se,pts:se,cts:0,unit:P,size:P.byteLength,duration:ae,originalDts:Q,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};ne.push(fe),S+=fe.size}this._audioNextDts=M+c}else N=Math.floor(M),W=Math.floor(M+c)-N,this._audioNextDts=M+c}else{if(N=Q-e,V!==n.length-1){var de=n[V+1].dts-this._dtsBase-e;W=de-N}else if(R!=null){var de=R.dts-this._dtsBase-e;W=de-N}else G.length>=1?W=G[G.length-1].duration:W=Math.floor(c);this._audioNextDts=N+W}f===-1&&(f=N),G.push({dts:N,pts:N,cts:0,unit:b.unit,size:b.unit.byteLength,duration:W,originalDts:Q,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),J&&G.push.apply(G,ne)}}if(G.length===0){s.samples=[],s.length=0;return}v?g=new Uint8Array(S):(g=new Uint8Array(S),g[0]=S>>>24&255,g[1]=S>>>16&255,g[2]=S>>>8&255,g[3]=S&255,g.set(h.default.types.mdat,4));for(var V=0;V<G.length;V++){var q=G[V].unit;g.set(q,m),m+=q.byteLength}var ie=G[G.length-1];_=ie.dts+ie.duration;var ee=new d.MediaSegmentInfo;ee.beginDts=f,ee.endDts=_,ee.beginPts=f,ee.endPts=_,ee.originalBeginDts=G[0].originalDts,ee.originalEndDts=ie.originalDts+ie.duration,ee.firstSample=new d.SampleInfo(G[0].dts,G[0].pts,G[0].duration,G[0].originalDts,!1),ee.lastSample=new d.SampleInfo(ie.dts,ie.pts,ie.duration,ie.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(ee),s.samples=G,s.sequenceNumber++;var _e=null;v?_e=new Uint8Array:_e=h.default.moof(s,f),s.samples=[],s.length=0;var pe={type:"audio",data:this._mergeBoxes(_e,g).buffer,sampleCount:G.length,info:ee};v&&y&&(pe.timestampOffset=f),this._onMediaSegment("audio",pe)}}},l.prototype._remuxVideo=function(i,t){if(this._videoMeta!=null){var s=i,n=s.samples,e=void 0,f=-1,_=-1,c=-1,v=-1;if(!(!n||n.length===0)&&!(n.length===1&&!t)){var y=8,x=null,m=8+i.length,g=null;if(n.length>1&&(g=n.pop(),m-=g.length),this._videoStashedLastSample!=null){var S=this._videoStashedLastSample;this._videoStashedLastSample=null,n.unshift(S),m+=S.length}g!=null&&(this._videoStashedLastSample=g);var R=n[0].dts-this._dtsBase;if(this._videoNextDts)e=R-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())e=0;else{var b=this._videoSegmentInfoList.getLastSampleBefore(R);if(b!=null){var T=R-(b.originalDts+b.duration);T<=3&&(T=0);var B=b.dts+b.duration+T;e=R-B}else e=0}for(var U=new d.MediaSegmentInfo,w=[],j=0;j<n.length;j++){var S=n[j],K=S.dts-this._dtsBase,P=S.isKeyframe,N=K-e,te=S.cts,G=N+te;f===-1&&(f=N,c=G);var V=0;if(j!==n.length-1){var q=n[j+1].dts-this._dtsBase-e;V=q-N}else if(g!=null){var q=g.dts-this._dtsBase-e;V=q-N}else w.length>=1?V=w[w.length-1].duration:V=Math.floor(this._videoMeta.refSampleDuration);if(P){var Q=new d.SampleInfo(N,G,V,S.dts,!0);Q.fileposition=S.fileposition,U.appendSyncPoint(Q)}w.push({dts:N,pts:G,cts:te,units:S.units,size:S.length,isKeyframe:P,duration:V,originalDts:K,flags:{isLeading:0,dependsOn:P?2:1,isDependedOn:P?1:0,hasRedundancy:0,isNonSync:P?0:1}})}x=new Uint8Array(m),x[0]=m>>>24&255,x[1]=m>>>16&255,x[2]=m>>>8&255,x[3]=m&255,x.set(h.default.types.mdat,4);for(var j=0;j<w.length;j++)for(var J=w[j].units;J.length;){var ne=J.shift(),W=ne.data;x.set(W,y),y+=W.byteLength}var M=w[w.length-1];if(_=M.dts+M.duration,v=M.pts+M.duration,this._videoNextDts=_,U.beginDts=f,U.endDts=_,U.beginPts=c,U.endPts=v,U.originalBeginDts=w[0].originalDts,U.originalEndDts=M.originalDts+M.duration,U.firstSample=new d.SampleInfo(w[0].dts,w[0].pts,w[0].duration,w[0].originalDts,w[0].isKeyframe),U.lastSample=new d.SampleInfo(M.dts,M.pts,M.duration,M.originalDts,M.isKeyframe),this._isLive||this._videoSegmentInfoList.append(U),s.samples=w,s.sequenceNumber++,this._forceFirstIDR){var $=w[0].flags;$.dependsOn=2,$.isNonSync=0}var re=h.default.moof(s,f);s.samples=[],s.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(re,x).buffer,sampleCount:w.length,info:U})}}},l.prototype._mergeBoxes=function(i,t){var s=new Uint8Array(i.byteLength+t.byteLength);return s.set(i,0),s.set(t,i.byteLength),s},l}();L.default=a},"./src/utils/browser.js":function(I,L,p){p.r(L);var E={};function h(){var u=self.navigator.userAgent.toLowerCase(),o=/(edge)\/([\w.]+)/.exec(u)||/(opr)[\/]([\w.]+)/.exec(u)||/(chrome)[ \/]([\w.]+)/.exec(u)||/(iemobile)[\/]([\w.]+)/.exec(u)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(u)||[],d=/(ipad)/.exec(u)||/(ipod)/.exec(u)||/(windows phone)/.exec(u)||/(iphone)/.exec(u)||/(kindle)/.exec(u)||/(android)/.exec(u)||/(windows)/.exec(u)||/(mac)/.exec(u)||/(linux)/.exec(u)||/(cros)/.exec(u)||[],r={browser:o[5]||o[3]||o[1]||"",version:o[2]||o[4]||"0",majorVersion:o[4]||o[2]||"0",platform:d[0]||""},a={};if(r.browser){a[r.browser]=!0;var l=r.majorVersion.split(".");a.version={major:parseInt(r.majorVersion,10),string:r.version},l.length>1&&(a.version.minor=parseInt(l[1],10)),l.length>2&&(a.version.build=parseInt(l[2],10))}if(r.platform&&(a[r.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),a.rv||a.iemobile){a.rv&&delete a.rv;var i="msie";r.browser=i,a[i]=!0}if(a.edge){delete a.edge;var t="msedge";r.browser=t,a[t]=!0}if(a.opr){var s="opera";r.browser=s,a[s]=!0}if(a.safari&&a.android){var n="android";r.browser=n,a[n]=!0}a.name=r.browser,a.platform=r.platform;for(var e in E)E.hasOwnProperty(e)&&delete E[e];Object.assign(E,a)}h(),L.default=E},"./src/utils/exception.js":function(I,L,p){p.r(L),p.d(L,{RuntimeException:function(){return h},IllegalStateException:function(){return u},InvalidArgumentException:function(){return o},NotImplementedException:function(){return d}});var E=function(){var r=function(a,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])},r(a,l)};return function(a,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(a,l);function i(){this.constructor=a}a.prototype=l===null?Object.create(l):(i.prototype=l.prototype,new i)}}(),h=function(){function r(a){this._message=a}return Object.defineProperty(r.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return this.name+": "+this.message},r}(),u=function(r){E(a,r);function a(l){return r.call(this,l)||this}return Object.defineProperty(a.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),a}(h),o=function(r){E(a,r);function a(l){return r.call(this,l)||this}return Object.defineProperty(a.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),a}(h),d=function(r){E(a,r);function a(l){return r.call(this,l)||this}return Object.defineProperty(a.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),a}(h)},"./src/utils/logger.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=function(){function o(){}return o.e=function(d,r){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var a="["+d+"] > "+r;o.ENABLE_CALLBACK&&o.emitter.emit("log","error",a),o.ENABLE_ERROR&&(console.error?console.error(a):console.warn&&console.warn(a))},o.i=function(d,r){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var a="["+d+"] > "+r;o.ENABLE_CALLBACK&&o.emitter.emit("log","info",a),!!o.ENABLE_INFO&&console.info&&console.info(a)},o.w=function(d,r){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var a="["+d+"] > "+r;o.ENABLE_CALLBACK&&o.emitter.emit("log","warn",a),!!o.ENABLE_WARN&&console.warn&&console.warn(a)},o.d=function(d,r){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var a="["+d+"] > "+r;o.ENABLE_CALLBACK&&o.emitter.emit("log","debug",a),!!o.ENABLE_DEBUG&&console.debug&&console.debug(a)},o.v=function(d,r){(!d||o.FORCE_GLOBAL_TAG)&&(d=o.GLOBAL_TAG);var a="["+d+"] > "+r;o.ENABLE_CALLBACK&&o.emitter.emit("log","verbose",a),o.ENABLE_VERBOSE},o}();u.GLOBAL_TAG="flv.js",u.FORCE_GLOBAL_TAG=!1,u.ENABLE_ERROR=!0,u.ENABLE_INFO=!0,u.ENABLE_WARN=!0,u.ENABLE_DEBUG=!0,u.ENABLE_VERBOSE=!0,u.ENABLE_CALLBACK=!1,u.emitter=new(h()),L.default=u},"./src/utils/logging-control.js":function(I,L,p){p.r(L);var E=p("./node_modules/events/events.js"),h=p.n(E),u=p("./src/utils/logger.js"),o=function(){function d(){}return Object.defineProperty(d,"forceGlobalTag",{get:function(){return u.default.FORCE_GLOBAL_TAG},set:function(r){u.default.FORCE_GLOBAL_TAG=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"globalTag",{get:function(){return u.default.GLOBAL_TAG},set:function(r){u.default.GLOBAL_TAG=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableAll",{get:function(){return u.default.ENABLE_VERBOSE&&u.default.ENABLE_DEBUG&&u.default.ENABLE_INFO&&u.default.ENABLE_WARN&&u.default.ENABLE_ERROR},set:function(r){u.default.ENABLE_VERBOSE=r,u.default.ENABLE_DEBUG=r,u.default.ENABLE_INFO=r,u.default.ENABLE_WARN=r,u.default.ENABLE_ERROR=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableDebug",{get:function(){return u.default.ENABLE_DEBUG},set:function(r){u.default.ENABLE_DEBUG=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableVerbose",{get:function(){return u.default.ENABLE_VERBOSE},set:function(r){u.default.ENABLE_VERBOSE=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableInfo",{get:function(){return u.default.ENABLE_INFO},set:function(r){u.default.ENABLE_INFO=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableWarn",{get:function(){return u.default.ENABLE_WARN},set:function(r){u.default.ENABLE_WARN=r,d._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(d,"enableError",{get:function(){return u.default.ENABLE_ERROR},set:function(r){u.default.ENABLE_ERROR=r,d._notifyChange()},enumerable:!1,configurable:!0}),d.getConfig=function(){return{globalTag:u.default.GLOBAL_TAG,forceGlobalTag:u.default.FORCE_GLOBAL_TAG,enableVerbose:u.default.ENABLE_VERBOSE,enableDebug:u.default.ENABLE_DEBUG,enableInfo:u.default.ENABLE_INFO,enableWarn:u.default.ENABLE_WARN,enableError:u.default.ENABLE_ERROR,enableCallback:u.default.ENABLE_CALLBACK}},d.applyConfig=function(r){u.default.GLOBAL_TAG=r.globalTag,u.default.FORCE_GLOBAL_TAG=r.forceGlobalTag,u.default.ENABLE_VERBOSE=r.enableVerbose,u.default.ENABLE_DEBUG=r.enableDebug,u.default.ENABLE_INFO=r.enableInfo,u.default.ENABLE_WARN=r.enableWarn,u.default.ENABLE_ERROR=r.enableError,u.default.ENABLE_CALLBACK=r.enableCallback},d._notifyChange=function(){var r=d.emitter;if(r.listenerCount("change")>0){var a=d.getConfig();r.emit("change",a)}},d.registerListener=function(r){d.emitter.addListener("change",r)},d.removeListener=function(r){d.emitter.removeListener("change",r)},d.addLogListener=function(r){u.default.emitter.addListener("log",r),u.default.emitter.listenerCount("log")>0&&(u.default.ENABLE_CALLBACK=!0,d._notifyChange())},d.removeLogListener=function(r){u.default.emitter.removeListener("log",r),u.default.emitter.listenerCount("log")===0&&(u.default.ENABLE_CALLBACK=!1,d._notifyChange())},d}();o.emitter=new(h()),L.default=o},"./src/utils/polyfill.js":function(I,L,p){p.r(L);var E=function(){function h(){}return h.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},Object.assign=Object.assign||function(u){if(u==null)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(u),d=1;d<arguments.length;d++){var r=arguments[d];if(r!=null)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a])}return o},typeof self.Promise!="function"&&p("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},h}();E.install(),L.default=E},"./src/utils/utf8-conv.js":function(I,L,p){p.r(L);function E(u,o,d){var r=u;if(o+d<r.length){for(;d--;)if((r[++o]&192)!==128)return!1;return!0}else return!1}function h(u){for(var o=[],d=u,r=0,a=u.length;r<a;){if(d[r]<128){o.push(String.fromCharCode(d[r])),++r;continue}else if(!(d[r]<192)){if(d[r]<224){if(E(d,r,1)){var l=(d[r]&31)<<6|d[r+1]&63;if(l>=128){o.push(String.fromCharCode(l&65535)),r+=2;continue}}}else if(d[r]<240){if(E(d,r,2)){var l=(d[r]&15)<<12|(d[r+1]&63)<<6|d[r+2]&63;if(l>=2048&&(l&63488)!==55296){o.push(String.fromCharCode(l&65535)),r+=3;continue}}}else if(d[r]<248&&E(d,r,3)){var l=(d[r]&7)<<18|(d[r+1]&63)<<12|(d[r+2]&63)<<6|d[r+3]&63;if(l>65536&&l<1114112){l-=65536,o.push(String.fromCharCode(l>>>10|55296)),o.push(String.fromCharCode(l&1023|56320)),r+=4;continue}}}o.push(String.fromCharCode(65533)),++r}return o.join("")}L.default=h}},le={};function Y(I){var L=le[I];if(L!==void 0)return L.exports;var p=le[I]={exports:{}};return z[I].call(p.exports,p,p.exports,Y),p.exports}Y.m=z,function(){Y.n=function(I){var L=I&&I.__esModule?function(){return I.default}:function(){return I};return Y.d(L,{a:L}),L}}(),function(){Y.d=function(I,L){for(var p in L)Y.o(L,p)&&!Y.o(I,p)&&Object.defineProperty(I,p,{enumerable:!0,get:L[p]})}}(),function(){Y.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(I){if(typeof window=="object")return window}}()}(),function(){Y.o=function(I,L){return Object.prototype.hasOwnProperty.call(I,L)}}(),function(){Y.r=function(I){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})}}();var ce=Y("./src/index.js");return ce}()})})(be);var Ae=Ie(be.exports);const We=De({name:"VideoFlv",components:{SvgIcon:Me,LinkModal:Ve},props:{url:{type:String,default:null},screen:{type:Boolean,default:!0},name:{type:String,default:""}},setup(H){const oe=xe(null);let z=null;const le=xe(H.url),Y=xe(!1),ce=ye(()=>H.name),I=ye(()=>H.screen);function L(){if(!!H.url&&Ae.isSupported()){let u=Ue(oe);var h=Ae.createPlayer({type:"flv",isLive:!0,url:H.url});h.attachMediaElement(u),h.load(),h.play(),z=h}}Pe(()=>{L()});function p(){I.value&&(Y.value=!0)}function E(){!z||(z==null||z.pause(),z==null||z.unload(),z==null||z.detachMediaElement(),z==null||z.destroy(),z=null)}return we(()=>{E()}),Fe(()=>H.url,h=>{h&&(E(),L())}),{pName:ce,onScreen:p,isScreen:I,pUrl:le,visibleModal:Y,videoRef:oe}}}),ze={class:"w-full h-full relative"},He={class:"w-full"};function Xe(H,oe,z,le,Y,ce){const I=Ee("SvgIcon"),L=Ee("VideoFlv",!0),p=Ee("LinkModal");return ke(),je("div",ze,[(H.isScreen,Ne("",!0)),Se("video",{onClick:oe[1]||(oe[1]=Ge((...E)=>H.onScreen&&H.onScreen(...E),["prevent","stop"])),class:"w-full h-full",autoplay:"",controls:"",ref:"videoRef",muted:""},null,512),Le(p,{visible:H.visibleModal,"onUpdate:visible":oe[2]||(oe[2]=E=>H.visibleModal=E),footer:null,title1:H.pName},{content:Ke(()=>[Se("div",He,[Le(L,{url:H.pUrl,screen:!1,name:H.pName},null,8,["url","name"])])]),_:1},8,["visible","title1"])])}var $e=Be(We,[["render",Xe],["__scopeId","data-v-7af2ddf7"]]);export{$e as default};