aliyun-aliplayer 2.29.1 → 2.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! splayer-muxer - ver0.7.8 created:12/31/2024, 12:04:37 PM */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VideoxMuxer=e():t.VideoxMuxer=e()}(this,(()=>(()=>{var t={307:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",o=1,a=2,i=9007199254740991,s="[object Arguments]",u="[object Array]",c="[object AsyncFunction]",p="[object Boolean]",f="[object Date]",d="[object Error]",l="[object Function]",h="[object GeneratorFunction]",y="[object Map]",v="[object Number]",_="[object Null]",m="[object Object]",g="[object Promise]",T="[object Proxy]",S="[object RegExp]",b="[object Set]",E="[object String]",w="[object Symbol]",O="[object Undefined]",A="[object WeakMap]",P="[object ArrayBuffer]",C="[object DataView]",N=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[u]=L[P]=L[p]=L[C]=L[f]=L[d]=L[l]=L[y]=L[v]=L[m]=L[S]=L[b]=L[E]=L[A]=!1;var k="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,D="object"==typeof self&&self&&self.Object===Object&&self,R=k||D||Function("return this")(),U=e&&!e.nodeType&&e,x=U&&t&&!t.nodeType&&t,M=x&&x.exports===U,B=M&&k.process,V=function(){try{return B&&B.binding&&B.binding("util")}catch(t){}}(),j=V&&V.isTypedArray;function F(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var H,W,X,K=Array.prototype,Y=Function.prototype,Q=Object.prototype,$=R["__core-js_shared__"],q=Y.toString,Z=Q.hasOwnProperty,J=(H=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"",tt=Q.toString,et=RegExp("^"+q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=M?R.Buffer:void 0,nt=R.Symbol,ot=R.Uint8Array,at=Q.propertyIsEnumerable,it=K.splice,st=nt?nt.toStringTag:void 0,ut=Object.getOwnPropertySymbols,ct=rt?rt.isBuffer:void 0,pt=(W=Object.keys,X=Object,function(t){return W(X(t))}),ft=Vt(R,"DataView"),dt=Vt(R,"Map"),lt=Vt(R,"Promise"),ht=Vt(R,"Set"),yt=Vt(R,"WeakMap"),vt=Vt(Object,"create"),_t=Gt(ft),mt=Gt(dt),gt=Gt(lt),Tt=Gt(ht),St=Gt(yt),bt=nt?nt.prototype:void 0,Et=bt?bt.valueOf:void 0;function wt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function At(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Pt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new At;++e<r;)this.add(t[e])}function Ct(t){var e=this.__data__=new Ot(t);this.size=e.size}function Nt(t,e){var r=Xt(t),n=!r&&Wt(t),o=!r&&!n&&Kt(t),a=!r&&!n&&!o&&Zt(t),i=r||n||o||a,s=i?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=s.length;for(var c in t)!e&&!Z.call(t,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||zt(c,u))||s.push(c);return s}function It(t,e){for(var r=t.length;r--;)if(Ht(t[r][0],e))return r;return-1}function Lt(t){return null==t?void 0===t?O:_:st&&st in Object(t)?function(t){var e=Z.call(t,st),r=t[st];try{t[st]=void 0;var n=!0}catch(t){}var o=tt.call(t);n&&(e?t[st]=r:delete t[st]);return o}(t):function(t){return tt.call(t)}(t)}function kt(t){return qt(t)&&Lt(t)==s}function Dt(t,e,r,n,i){return t===e||(null==t||null==e||!qt(t)&&!qt(e)?t!=t&&e!=e:function(t,e,r,n,i,c){var l=Xt(t),h=Xt(e),_=l?u:Ft(t),g=h?u:Ft(e),T=(_=_==s?m:_)==m,O=(g=g==s?m:g)==m,A=_==g;if(A&&Kt(t)){if(!Kt(e))return!1;l=!0,T=!1}if(A&&!T)return c||(c=new Ct),l||Zt(t)?xt(t,e,r,n,i,c):function(t,e,r,n,i,s,u){switch(r){case C:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P:return!(t.byteLength!=e.byteLength||!s(new ot(t),new ot(e)));case p:case f:case v:return Ht(+t,+e);case d:return t.name==e.name&&t.message==e.message;case S:case E:return t==e+"";case y:var c=z;case b:var l=n&o;if(c||(c=G),t.size!=e.size&&!l)return!1;var h=u.get(t);if(h)return h==e;n|=a,u.set(t,e);var _=xt(c(t),c(e),n,i,s,u);return u.delete(t),_;case w:if(Et)return Et.call(t)==Et.call(e)}return!1}(t,e,_,r,n,i,c);if(!(r&o)){var N=T&&Z.call(t,"__wrapped__"),I=O&&Z.call(e,"__wrapped__");if(N||I){var L=N?t.value():t,k=I?e.value():e;return c||(c=new Ct),i(L,k,r,n,c)}}if(!A)return!1;return c||(c=new Ct),function(t,e,r,n,a,i){var s=r&o,u=Mt(t),c=u.length,p=Mt(e),f=p.length;if(c!=f&&!s)return!1;var d=c;for(;d--;){var l=u[d];if(!(s?l in e:Z.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var y=!0;i.set(t,e),i.set(e,t);var v=s;for(;++d<c;){var _=t[l=u[d]],m=e[l];if(n)var g=s?n(m,_,l,e,t,i):n(_,m,l,t,e,i);if(!(void 0===g?_===m||a(_,m,r,n,i):g)){y=!1;break}v||(v="constructor"==l)}if(y&&!v){var T=t.constructor,S=e.constructor;T==S||!("constructor"in t)||!("constructor"in e)||"function"==typeof T&&T instanceof T&&"function"==typeof S&&S instanceof S||(y=!1)}return i.delete(t),i.delete(e),y}(t,e,r,n,i,c)}(t,e,r,n,Dt,i))}function Rt(t){return!(!$t(t)||function(t){return!!J&&J in t}(t))&&(Yt(t)?et:N).test(Gt(t))}function Ut(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||Q,e!==n)return pt(t);var e,r,n,o=[];for(var a in Object(t))Z.call(t,a)&&"constructor"!=a&&o.push(a);return o}function xt(t,e,r,n,i,s){var u=r&o,c=t.length,p=e.length;if(c!=p&&!(u&&p>c))return!1;var f=s.get(t);if(f&&s.get(e))return f==e;var d=-1,l=!0,h=r&a?new Pt:void 0;for(s.set(t,e),s.set(e,t);++d<c;){var y=t[d],v=e[d];if(n)var _=u?n(v,y,d,e,t,s):n(y,v,d,t,e,s);if(void 0!==_){if(_)continue;l=!1;break}if(h){if(!F(e,(function(t,e){if(o=e,!h.has(o)&&(y===t||i(y,t,r,n,s)))return h.push(e);var o}))){l=!1;break}}else if(y!==v&&!i(y,v,r,n,s)){l=!1;break}}return s.delete(t),s.delete(e),l}function Mt(t){return function(t,e,r){var n=e(t);return Xt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Jt,jt)}function Bt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Rt(r)?r:void 0}wt.prototype.clear=function(){this.__data__=vt?vt(null):{},this.size=0},wt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},wt.prototype.get=function(t){var e=this.__data__;if(vt){var r=e[t];return r===n?void 0:r}return Z.call(e,t)?e[t]:void 0},wt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},wt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=vt&&void 0===e?n:e,this},Ot.prototype.clear=function(){this.__data__=[],this.size=0},Ot.prototype.delete=function(t){var e=this.__data__,r=It(e,t);return!(r<0)&&(r==e.length-1?e.pop():it.call(e,r,1),--this.size,!0)},Ot.prototype.get=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]},Ot.prototype.has=function(t){return It(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},At.prototype.clear=function(){this.size=0,this.__data__={hash:new wt,map:new(dt||Ot),string:new wt}},At.prototype.delete=function(t){var e=Bt(this,t).delete(t);return this.size-=e?1:0,e},At.prototype.get=function(t){return Bt(this,t).get(t)},At.prototype.has=function(t){return Bt(this,t).has(t)},At.prototype.set=function(t,e){var r=Bt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Pt.prototype.add=Pt.prototype.push=function(t){return this.__data__.set(t,n),this},Pt.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Ot,this.size=0},Ct.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ot){var n=r.__data__;if(!dt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new At(n)}return r.set(t,e),this.size=r.size,this};var jt=ut?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a}(ut(t),(function(e){return at.call(t,e)})))}:function(){return[]},Ft=Lt;function zt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||I.test(t))&&t>-1&&t%1==0&&t<e}function Gt(t){if(null!=t){try{return q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(ft&&Ft(new ft(new ArrayBuffer(1)))!=C||dt&&Ft(new dt)!=y||lt&&Ft(lt.resolve())!=g||ht&&Ft(new ht)!=b||yt&&Ft(new yt)!=A)&&(Ft=function(t){var e=Lt(t),r=e==m?t.constructor:void 0,n=r?Gt(r):"";if(n)switch(n){case _t:return C;case mt:return y;case gt:return g;case Tt:return b;case St:return A}return e});var Wt=kt(function(){return arguments}())?kt:function(t){return qt(t)&&Z.call(t,"callee")&&!at.call(t,"callee")},Xt=Array.isArray;var Kt=ct||function(){return!1};function Yt(t){if(!$t(t))return!1;var e=Lt(t);return e==l||e==h||e==c||e==T}function Qt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function $t(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qt(t){return null!=t&&"object"==typeof t}var Zt=j?function(t){return function(e){return t(e)}}(j):function(t){return qt(t)&&Qt(t.length)&&!!L[Lt(t)]};function Jt(t){return null!=(e=t)&&Qt(e.length)&&!Yt(e)?Nt(t):Ut(t);var e}t.exports=function(t,e){return Dt(t,e)}},801:t=>{t.exports=function(t){return void 0===t}},378:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",i="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Null]",p="[object Object]",f="[object Proxy]",d="[object Undefined]",l=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[a]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y[s]=y["[object Map]"]=y["[object Number]"]=y[p]=y["[object RegExp]"]=y["[object Set]"]=y["[object String]"]=y["[object WeakMap]"]=!1;var v="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,_="object"==typeof self&&self&&self.Object===Object&&self,m=v||_||Function("return this")(),g=e&&!e.nodeType&&e,T=g&&t&&!t.nodeType&&t,S=T&&T.exports===g,b=S&&v.process,E=function(){try{var t=T&&T.require&&T.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),w=E&&E.isTypedArray;var O,A,P,C=Array.prototype,N=Function.prototype,I=Object.prototype,L=m["__core-js_shared__"],k=N.toString,D=I.hasOwnProperty,R=(O=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",U=I.toString,x=k.call(Object),M=RegExp("^"+k.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=S?m.Buffer:void 0,V=m.Symbol,j=m.Uint8Array,F=B?B.allocUnsafe:void 0,z=(A=Object.getPrototypeOf,P=Object,function(t){return A(P(t))}),G=Object.create,H=I.propertyIsEnumerable,W=C.splice,X=V?V.toStringTag:void 0,K=function(){try{var t=gt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=B?B.isBuffer:void 0,Q=Math.max,$=Date.now,q=gt(m,"Map"),Z=gt(Object,"create"),J=function(){function t(){}return function(e){if(!Lt(e))return{};if(G)return G(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function tt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function et(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nt(t){var e=this.__data__=new et(t);this.size=e.size}function ot(t,e){var r=At(t),n=!r&&Ot(t),o=!r&&!n&&Ct(t),a=!r&&!n&&!o&&Dt(t),i=r||n||o||a,s=i?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=s.length;for(var c in t)!e&&!D.call(t,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Tt(c,u))||s.push(c);return s}function at(t,e,r){(void 0!==r&&!wt(t[e],r)||void 0===r&&!(e in t))&&ut(t,e,r)}function it(t,e,r){var n=t[e];D.call(t,e)&&wt(n,r)&&(void 0!==r||e in t)||ut(t,e,r)}function st(t,e){for(var r=t.length;r--;)if(wt(t[r][0],e))return r;return-1}function ut(t,e,r){"__proto__"==e&&K?K(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}tt.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},tt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},tt.prototype.get=function(t){var e=this.__data__;if(Z){var r=e[t];return r===n?void 0:r}return D.call(e,t)?e[t]:void 0},tt.prototype.has=function(t){var e=this.__data__;return Z?void 0!==e[t]:D.call(e,t)},tt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Z&&void 0===e?n:e,this},et.prototype.clear=function(){this.__data__=[],this.size=0},et.prototype.delete=function(t){var e=this.__data__,r=st(e,t);return!(r<0)&&(r==e.length-1?e.pop():W.call(e,r,1),--this.size,!0)},et.prototype.get=function(t){var e=this.__data__,r=st(e,t);return r<0?void 0:e[r][1]},et.prototype.has=function(t){return st(this.__data__,t)>-1},et.prototype.set=function(t,e){var r=this.__data__,n=st(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},rt.prototype.clear=function(){this.size=0,this.__data__={hash:new tt,map:new(q||et),string:new tt}},rt.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},rt.prototype.get=function(t){return mt(this,t).get(t)},rt.prototype.has=function(t){return mt(this,t).has(t)},rt.prototype.set=function(t,e){var r=mt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},nt.prototype.clear=function(){this.__data__=new et,this.size=0},nt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},nt.prototype.get=function(t){return this.__data__.get(t)},nt.prototype.has=function(t){return this.__data__.has(t)},nt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!q||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new rt(n)}return r.set(t,e),this.size=r.size,this};var ct,pt=function(t,e,r){for(var n=-1,o=Object(t),a=r(t),i=a.length;i--;){var s=a[ct?i:++n];if(!1===e(o[s],s,o))break}return t};function ft(t){return null==t?void 0===t?d:c:X&&X in Object(t)?function(t){var e=D.call(t,X),r=t[X];try{t[X]=void 0;var n=!0}catch(t){}var o=U.call(t);n&&(e?t[X]=r:delete t[X]);return o}(t):function(t){return U.call(t)}(t)}function dt(t){return kt(t)&&ft(t)==a}function lt(t){return!(!Lt(t)||function(t){return!!R&&R in t}(t))&&(Nt(t)?M:l).test(function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ht(t){if(!Lt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=St(t),r=[];for(var n in t)("constructor"!=n||!e&&D.call(t,n))&&r.push(n);return r}function yt(t,e,r,n,o){t!==e&&pt(e,(function(a,i){if(o||(o=new nt),Lt(a))!function(t,e,r,n,o,a,i){var s=bt(t,r),u=bt(e,r),c=i.get(u);if(c)return void at(t,r,c);var f=a?a(s,u,r+"",t,e,i):void 0,d=void 0===f;if(d){var l=At(u),h=!l&&Ct(u),y=!l&&!h&&Dt(u);f=u,l||h||y?At(s)?f=s:kt(T=s)&&Pt(T)?f=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(s):h?(d=!1,f=function(t,e){if(e)return t.slice();var r=t.length,n=F?F(r):new t.constructor(r);return t.copy(n),n}(u,!0)):y?(d=!1,v=u,_=!0?(m=v.buffer,g=new m.constructor(m.byteLength),new j(g).set(new j(m)),g):v.buffer,f=new v.constructor(_,v.byteOffset,v.length)):f=[]:function(t){if(!kt(t)||ft(t)!=p)return!1;var e=z(t);if(null===e)return!0;var r=D.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&k.call(r)==x}(u)||Ot(u)?(f=s,Ot(s)?f=function(t){return function(t,e,r,n){var o=!r;r||(r={});var a=-1,i=e.length;for(;++a<i;){var s=e[a],u=n?n(r[s],t[s],s,r,t):void 0;void 0===u&&(u=t[s]),o?ut(r,s,u):it(r,s,u)}return r}(t,Rt(t))}(s):Lt(s)&&!Nt(s)||(f=function(t){return"function"!=typeof t.constructor||St(t)?{}:J(z(t))}(u))):d=!1}var v,_,m,g;var T;d&&(i.set(u,f),o(f,u,n,a,i),i.delete(u));at(t,r,f)}(t,e,i,r,yt,n,o);else{var s=n?n(bt(t,i),a,i+"",t,e,o):void 0;void 0===s&&(s=a),at(t,i,s)}}),Rt)}function vt(t,e){return Et(function(t,e,r){return e=Q(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Q(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,s)}}(t,e,Mt),t+"")}var _t=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Mt;function mt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function gt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return lt(r)?r:void 0}function Tt(t,e){var r=typeof t;return!!(e=null==e?o:e)&&("number"==r||"symbol"!=r&&h.test(t))&&t>-1&&t%1==0&&t<e}function St(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||I)}function bt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Et=function(t){var e=0,r=0;return function(){var n=$(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(_t);function wt(t,e){return t===e||t!=t&&e!=e}var Ot=dt(function(){return arguments}())?dt:function(t){return kt(t)&&D.call(t,"callee")&&!H.call(t,"callee")},At=Array.isArray;function Pt(t){return null!=t&&It(t.length)&&!Nt(t)}var Ct=Y||function(){return!1};function Nt(t){if(!Lt(t))return!1;var e=ft(t);return e==s||e==u||e==i||e==f}function It(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function Lt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var Dt=w?function(t){return function(e){return t(e)}}(w):function(t){return kt(t)&&It(t.length)&&!!y[ft(t)]};function Rt(t){return Pt(t)?ot(t,!0):ht(t)}var Ut,xt=(Ut=function(t,e,r){yt(t,e,r)},vt((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=Ut.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(t,e,r){if(!Lt(r))return!1;var n=typeof e;return!!("number"==n?Pt(r)&&Tt(e,r.length):"string"==n&&e in r)&&wt(r[e],t)}(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var i=e[r];i&&Ut(t,i,r,o)}return t})));function Mt(t){return t}t.exports=xt},775:t=>{var e=Object.prototype.hasOwnProperty;function r(t){return"[Throws: "+(t?t.message:"?")+"]"}function n(t){var n=[];return function t(o){if(null===o||"object"!=typeof o)return o;if(-1!==n.indexOf(o))return"[Circular]";if(n.push(o),"function"==typeof o.toJSON)try{var a=t(o.toJSON());return n.pop(),a}catch(t){return r(t)}if(Array.isArray(o)){var i=o.map(t);return n.pop(),i}var s=Object.keys(o).reduce((function(n,a){return n[a]=t(function(t,n){if(e.call(t,n))try{return t[n]}catch(t){return r(t)}return t[n]}(o,a)),n}),{});return n.pop(),s}(t)}t.exports=function(t,e,r){return JSON.stringify(n(t),e,r)},t.exports.ensureProperties=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={id:n,loaded:!1,exports:{}};return t[n](a,a.exports,r),a.loaded=!0,a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.r(n),r.d(n,{AACParser:()=>t,AudioBody:()=>Gt,AvMultitrackType:()=>qt,AvcSPS:()=>tt,BasicLoader:()=>wt,BitBuffer:()=>d,Box:()=>lt,ByteBuffer:()=>o,CTrackTypeMap:()=>ut,Demuxer:()=>wn,DiscardType:()=>U,EAudioCodecID:()=>xt,EAudioPacketType:()=>Vt,EFormatType:()=>F,EFrameType:()=>Kt,EH264NALType:()=>y,EH265NALType:()=>_,EH266NALType:()=>T,EHandlerType:()=>j,ELoaderStatus:()=>St,EPID:()=>Jr,ESampleFlag:()=>st,ESoundType:()=>Bt,EStreamType:()=>Or,ETSPacketType:()=>nn,ETagType:()=>Pt,ETrackType:()=>z,EVideoCodecID:()=>Qt,EVideoCommand:()=>Yt,EVideoPacketType:()=>$t,ErrorCode:()=>x,FLVParser:()=>de,FullBox:()=>ht,H264NAL:()=>m,H265NAL:()=>S,H266NAL:()=>E,HLSParser:()=>_n,HevcSPS:()=>at,Loader:()=>kt,LoaderError:()=>Et,MP4Parser:()=>$r,MP4RemuxStream:()=>Rn,MPEGTSParser:()=>ln,PAT:()=>tn,PES:()=>en,PMT:()=>rn,Remuxer:()=>Nn,SOUND_RATE:()=>jt,SOUND_SIZE:()=>Ft,ScriptBody:()=>Zt,TSHeader:()=>on,TagHeader:()=>Mt,VideoBody:()=>te,VvcSPS:()=>it,esTypeMap:()=>Zr});var t={};r.r(t),r.d(t,{AAC_DURATION:()=>i,AAC_SAMPLING_FREQUENCIES:()=>a,addADTSHeader:()=>s,getADTSHeaderLength:()=>c,getADTSLength:()=>p,isADTS:()=>u,readAACSamples:()=>f});var e={};r.r(e),r.d(e,{Box:()=>lt,avc1:()=>ve,avcC:()=>vt,btrt:()=>Te,co64:()=>kr,ctts:()=>Cr,dinf:()=>he,dref:()=>be,edts:()=>he,elst:()=>we,esds:()=>Re,ftyp:()=>xe,hdlr:()=>ze,hev1:()=>me,hvc1:()=>me,hvcC:()=>mt,mdat:()=>He,mdhd:()=>Xe,mdia:()=>he,mfhd:()=>pr,mfra:()=>he,minf:()=>he,moof:()=>ir,moov:()=>he,mp4a:()=>Ye,mvex:()=>dr,mvhd:()=>$e,pasp:()=>Ze,sdtp:()=>hr,sidx:()=>vr,stbl:()=>he,stco:()=>Ir,stsc:()=>Rr,stsd:()=>xr,stss:()=>Br,stsz:()=>jr,stts:()=>zr,tfdt:()=>mr,tfhd:()=>Sr,tkhd:()=>tr,traf:()=>ur,trak:()=>he,trex:()=>Er,trun:()=>Ar,url:()=>rr,vmhd:()=>or,vvc1:()=>Be,vvcC:()=>ce,vvi1:()=>je});var o=function(){function t(t,e,r){this.dv=new DataView(t),this.offset=e||this.dv.byteOffset,this.start=this.offset,this.end=r?this.start+r:this.dv.byteLength}return t.fromUint8=function(e){return new t(e.buffer,e.byteOffset,e.byteLength)},t.concatUint8s=function(t){return this.concatUint8.apply(this,t)},t.concatUint8=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length<=1)return t[0]||new Uint8Array(0);var r=new Uint8Array(t.reduce((function(t,e){return t+e.byteLength}),0)),n=0;return t.forEach((function(t){r.set(t,n),n+=t.byteLength})),r},t.concat=function(e,r){return t.concatUint8(new Uint8Array(e),new Uint8Array(r)).buffer},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.dv.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unreadLength",{get:function(){return Math.max(this.end-this.offset,0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),t.prototype.readFloat=function(t){var e=0;switch(t){case 4:e=this.dv.getFloat32(this.offset);break;case 8:e=this.dv.getFloat64(this.offset);break;default:throw new Error("not supported for read float byte with "+t)}return this.offset+=t,e},t.prototype.back=function(t){this.offset-=t},t.prototype.skip=function(t){this.offset+=t},t.prototype.readInt=function(t){var e=this.offset;switch(this.offset+=t,t){case 1:return this.dv.getInt8(e);case 2:return this.dv.getInt16(e);case 4:return this.dv.getInt32(e);default:throw new Error("not supported for read byte with "+t)}},t.prototype.read=function(t){var e=this.offset;switch(this.offset+=t,t){case 1:return this.dv.getUint8(e);case 2:return this.dv.getUint16(e);case 3:return(this.dv.getUint16(e)<<8)+this.dv.getUint8(e+2);case 4:return this.dv.getUint32(e);default:return this.back(t-4),this.read(t-4)+this.dv.getUint32(e)*Math.pow(256,t-4)}},t.prototype.writeInt=function(t,e){var r=this.offset;switch(this.offset+=t,t){case 1:return this.dv.setInt8(r,e);case 2:return this.dv.setInt16(r,e);case 3:return this.dv.setInt8(r,e>>16),this.dv.setInt16(r+1,65535&e);case 4:return this.dv.setInt32(r,e);default:throw new Error("不支持Byte write "+t)}},t.prototype.write=function(t,e){var r=this.offset;switch(this.offset+=t,t){case 1:return this.dv.setUint8(r,e);case 2:return this.dv.setUint16(r,e);case 3:return this.dv.setUint8(r,e>>>16),this.dv.setUint16(r+1,65535&e);case 4:return this.dv.setUint32(r,e);default:throw new Error("不支持Byte write "+t)}},t.prototype.readToUint8=function(t){var e=new Uint8Array(this.dv.buffer,this.offset,t||this.unreadLength);return this.offset+=e.byteLength,e},t.prototype.readToBuffer=function(t){var e;return e=this.offset||t?this.dv.buffer.slice(this.offset,t?this.offset+t:void 0):this.dv.buffer,this.offset+=e.byteLength,e},t}(),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=1024,s=function(t,e){var r=e.audioObjectType,n=e.sampleRate,i=e.samplingFrequencyIndex,s=e.channelCount,u=e.numberOfRawDataBlocksInFrame,c=void 0===u?0:u,p=i;0===p&&n>0&&(p=a.indexOf(n));var f=t.byteLength+7,d=new Uint8Array(7);return d[0]=255,d[1]=241,d[2]=r-1<<6,d[2]|=p<<2,d[2]|=(4&s)>>2,d[3]=(3&s)<<6,d[3]|=(6144&f)>>11,d[4]=(2047&f)>>3,d[5]=(7&f)<<5,d[5]|=31,d[6]=252,d[6]|=3&c,o.concatUint8(d,t)},u=function(t,e){return e<t.byteLength-1&&255===t[e]&&240==(246&t[e+1])},c=function(t,e){return 1&t[e+1]?7:9},p=function(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5},f=function(t){for(var e,r,n=[],o=0,i=t.byteLength;o+6<i;)u(t,o)?(e=c(t,o),r=p(t,o),n.push({audioObjectType:1+(t[2]>>>6),sampleRate:a[t[2]>>>2&15],samplingFrequencyIndex:t[2]>>>2&15,channelCount:(1&t[2])<<2|t[3]>>>6,numberOfRawDataBlocksInFrame:0,data:t.subarray(o+e,o+r)}),o+=r):o++;return n},d=function(){function t(t,e){this.num=t,this.len=e,this.offset=0}return t.fromByte=function(e,r){return new t(e.read(r),r<<3)},t.prototype.skip=function(t){this.offset+=t},t.prototype.read=function(t){var e=this.len-this.offset-t;if(e>=0){for(var r=0,n=0;n<t;n++)r+=1<<n;return this.offset+=t,this.num>>>e&r}return console.warn("bit 读取位数超过限制"),0},t}();const l=function(){function t(){}return t.createAnnexbStartCode=function(){return new Uint8Array([0,0,0,1])},t.createVVCAnnexbStartCode=function(){return new Uint8Array([0,0,1])},t.createAVCCStartCode=function(t){return new Uint8Array([t>>24&255,t>>16&255,t>>8&255,255&t])},t.extractAVCCNAL=function(t,e){for(var r,n=[],a=new o(t.buffer,t.byteOffset,t.byteLength);a.unreadLength>e;){if((r=a.read(e+1))<=0||r>a.unreadLength){console.warn("extract avc nalu size wrong! lengthSizeMinusOne:",e,"size:",r);break}var i=a.offset-a.start;n.push(t.subarray(i,i+r)),a.skip(r)}return n},t.extractAnnexbNAL=function(t){for(var e=t.byteLength,r=[],n=0;n<e-3;)0===t[n]?0===t[n+1]?0===t[n+2]?0===t[n+3]?n++:1===t[n+3]&&n+4<e?(r.push({prefixStart:n,start:n+4}),n+=4):n+=4:1===t[n+2]?(r.push({prefixStart:n,start:n+3}),n+=3):n+=3:n+=2:n++;return r.length?r.map((function(e,n){var o=r[n+1];return o?t.subarray(e.start,o.prefixStart):t.subarray(e.start)})):[]},t}();var h,y,v=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},h(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});!function(t){t[t.UNUSED=0]="UNUSED",t[t.NON_IDR_SLICE=1]="NON_IDR_SLICE",t[t.DP_A=2]="DP_A",t[t.DP_B=3]="DP_B",t[t.DP_C=4]="DP_C",t[t.IDR=5]="IDR",t[t.SEI=6]="SEI",t[t.SPS=7]="SPS",t[t.PPS=8]="PPS",t[t.DIVIDER=9]="DIVIDER",t[t.SEQUENCE_END=10]="SEQUENCE_END",t[t.STREAM_END=11]="STREAM_END",t[t.FILL=12]="FILL"}(y||(y={}));var _,m=function(t){function e(e){var r=t.call(this)||this,n=new d(e.read(1),8);return r.forbiddenZeroBit=n.read(1),r.nalRefIdc=n.read(2),r.nalType=n.read(5),r}return v(e,t),e.extractNALType=function(t){return 31&t[0]},e.isSlice=function(t){var e=this.extractNALType(t);return e>=y.NON_IDR_SLICE&&e<=y.IDR},e}(l),g=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.TRAIL_N=0]="TRAIL_N",t[t.TRAIL_R=1]="TRAIL_R",t[t.TSA_N=2]="TSA_N",t[t.TSA_R=3]="TSA_R",t[t.STSA_N=4]="STSA_N",t[t.STSA_R=5]="STSA_R",t[t.RADL_N=6]="RADL_N",t[t.RADL_R=7]="RADL_R",t[t.RASL_N=8]="RASL_N",t[t.RASL_R=9]="RASL_R",t[t.VCL_N10=10]="VCL_N10",t[t.VCL_R11=11]="VCL_R11",t[t.VCL_N12=12]="VCL_N12",t[t.VCL_R13=13]="VCL_R13",t[t.VCL_N14=14]="VCL_N14",t[t.VCL_R15=15]="VCL_R15",t[t.BLA_W_LP=16]="BLA_W_LP",t[t.BLA_W_RADL=17]="BLA_W_RADL",t[t.BLA_N_LP=18]="BLA_N_LP",t[t.IDR_W_RADL=19]="IDR_W_RADL",t[t.IDR_N_LP=20]="IDR_N_LP",t[t.CRA=21]="CRA",t[t.VPS=32]="VPS",t[t.SPS=33]="SPS",t[t.PPS=34]="PPS",t[t.ACCESS_UNIT_DELIMITER=35]="ACCESS_UNIT_DELIMITER",t[t.EOS=36]="EOS",t[t.EOB=37]="EOB",t[t.FILLER_DATA=38]="FILLER_DATA",t[t.SEI=39]="SEI",t[t.SEI_SUFFIX=40]="SEI_SUFFIX",t[t.INVALID=64]="INVALID"}(_||(_={}));var T,S=function(t){function e(e){var r=t.call(this)||this,n=new d(e.read(2),16);return r.forbiddenZeroBit=n.read(1),r.nalType=n.read(6),r.nhLayerId=n.read(6),r.nhTimeId=n.read(3),r}return g(e,t),e.extractNALType=function(t,e){return void 0===e&&(e=0),(126&t[e])>>1},e.isNonRefNALType=function(t){switch(t){case _.TRAIL_N:case _.STSA_N:case _.RADL_N:case _.RASL_N:case _.VCL_N10:case _.VCL_N12:case _.VCL_N14:return!0;default:return!1}},e.isNonRef=function(t){return this.isNonRefNALType(this.extractNALType(t))},e.isSlice=function(t){var e=this.extractNALType(t);return e>=_.TRAIL_N&&e<=_.CRA},e.littleEndian=function(){var t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]},e.parseHVCVideoData=function(t,e){for(var r=t.byteLength,n=new DataView(t.buffer,t.byteOffset,t.byteLength),o=[],a=0,i=0+e,s=this.littleEndian,u=!1;a<r;){if(a+4>=r){console.warn("parseHVCVideoData Malformed Nalu near timestamp "+i+", offset = "+a+", dataSize = "+r);break}var c=n.getUint32(a,!s);if(c>r-4)return void console.warn("parseHVCVideoData Malformed Nalus near timestamp "+i+", NaluSize > DataSize!");var p=n.getUint8(a+4)>>1&63;p>=16&&p<=23&&(u=!0);var f=0+a+4,d=f+c,l={type:p,data:t.subarray(f,d)};o.push(l),a+=4+c}return{keyframe:u,units:o}},e}(l),b=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.VVC_TRAIL_NUT=0]="VVC_TRAIL_NUT",t[t.VVC_STSA_NUT=1]="VVC_STSA_NUT",t[t.VVC_RADL_NUT=2]="VVC_RADL_NUT",t[t.VVC_RASL_NUT=3]="VVC_RASL_NUT",t[t.VVC_RSV_VCL_4=4]="VVC_RSV_VCL_4",t[t.VVC_RSV_VCL_5=5]="VVC_RSV_VCL_5",t[t.VVC_RSV_VCL_6=6]="VVC_RSV_VCL_6",t[t.VVC_IDR_W_RADL=7]="VVC_IDR_W_RADL",t[t.VVC_IDR_N_LP=8]="VVC_IDR_N_LP",t[t.VVC_CRA_NUT=9]="VVC_CRA_NUT",t[t.VVC_GDR_NUT=10]="VVC_GDR_NUT",t[t.VVC_RSV_IRAP_11=11]="VVC_RSV_IRAP_11",t[t.VVC_OPI_NUT=12]="VVC_OPI_NUT",t[t.VVC_DCI_NUT=13]="VVC_DCI_NUT",t[t.VVC_VPS_NUT=14]="VVC_VPS_NUT",t[t.VVC_SPS_NUT=15]="VVC_SPS_NUT",t[t.VVC_PPS_NUT=16]="VVC_PPS_NUT",t[t.VVC_PREFIX_APS_NUT=17]="VVC_PREFIX_APS_NUT",t[t.VVC_SUFFIX_APS_NUT=18]="VVC_SUFFIX_APS_NUT",t[t.VVC_PH_NUT=19]="VVC_PH_NUT",t[t.VVC_AUD_NUT=20]="VVC_AUD_NUT",t[t.VVC_EOS_NUT=21]="VVC_EOS_NUT",t[t.VVC_EOB_NUT=22]="VVC_EOB_NUT",t[t.VVC_PREFIX_SEI_NUT=23]="VVC_PREFIX_SEI_NUT",t[t.VVC_SUFFIX_SEI_NUT=24]="VVC_SUFFIX_SEI_NUT",t[t.VVC_FD_NUT=25]="VVC_FD_NUT",t[t.VVC_RSV_NVCL_26=26]="VVC_RSV_NVCL_26",t[t.VVC_RSV_NVCL_27=27]="VVC_RSV_NVCL_27",t[t.VVC_UNSPEC_28=28]="VVC_UNSPEC_28",t[t.VVC_UNSPEC_29=29]="VVC_UNSPEC_29",t[t.VVC_UNSPEC_30=30]="VVC_UNSPEC_30",t[t.VVC_UNSPEC_31=31]="VVC_UNSPEC_31"}(T||(T={}));var E=function(t){function e(e){var r=t.call(this)||this,n=e.readToUint8(2),o={nuh_layer_id:63&n[0],nal_unit_type:n[1]>>3&31,nuh_temporal_id_plus1:7&n[1]};return r.forbiddenZeroBit=0,r.nalType=o.nal_unit_type,r.nhLayerId=o.nuh_layer_id,r.nhTimeId=o.nuh_temporal_id_plus1,r}return b(e,t),e.parseNaluHeader=function(t){return{nuh_layer_id:63&t[0],nal_unit_type:t[1]>>3&31,nuh_temporal_id_plus1:7&t[1]}},e.extractNALType=function(t){return this.parseNaluHeader(t).nal_unit_type},e.isNonRefNALType=function(t){switch(t){case T.VVC_IDR_W_RADL:case T.VVC_IDR_N_LP:return!0;default:return!1}},e.isNonRef=function(t){return this.isNonRefNALType(this.extractNALType(t))},e.isSlice=function(t){var e=this.extractNALType(t);return e<=T.VVC_RASL_NUT||e>=T.VVC_IDR_W_RADL&&e<=T.VVC_GDR_NUT},e.littleEndian=function(){var t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]},e.parseHVCVideoData=function(t,e){for(var r=t.byteLength,n=new DataView(t.buffer,t.byteOffset,t.byteLength),o=[],a=0,i=0+e,s=this.littleEndian,u=!1;a<r;){if(a+4>=r){console.warn("parseHVCVideoData Malformed Nalu near timestamp "+i+", offset = "+a+", dataSize = "+r);break}var c=n.getUint32(a,!s);if(c>r-4)return void console.warn("parseHVCVideoData Malformed Nalus near timestamp "+i+", NaluSize > DataSize!");var p=n.getUint8(a+4)>>1&63;p>=16&&p<=23&&(u=!0);var f=0+a+4,d=f+c,l={type:p,data:t.subarray(f,d)};o.push(l),a+=4+c}return{keyframe:u,units:o}},e}(l),w=r(307),O=r.n(w);function A(t,e){var r=!1;return Object.keys(e).forEach((function(n){O()(t[n],e[n])||(t[n]=e[n],r=!0)})),r}var P=r(775),C=r.n(P),N=function(t){return t<10?"0"+t:t},I=function(t,e){void 0===e&&(e=!0);var r=Math.floor(t/1e3);return function(t,e){return void 0===e&&(e=!1),t===1/0?t:(n=Math.floor(t/60),n-=60*(r=Math.floor(n/60)),t=Math.floor(t-60*(60*r+n)),o=[],(e||r>0)&&o.push(N(r)),o.push(N(n)),o.push(N(t)),o.join(":"));var r,n,o}(r,e)+"."+Math.floor(1e3*(t-1e3*r))},L="undefined"!=typeof performance&&"function"==typeof performance.now;function k(){return L?performance.now():Date.now()}var D,R=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))};!function(t){t[t.TRACE=-1]="TRACE",t[t.DEBUG=0]="DEBUG",t[t.LOG=1]="LOG",t[t.INFO=2]="INFO",t[t.WARN=10]="WARN",t[t.ERROR=11]="ERROR",t[t.NONE=1e3]="NONE"}(D||(D={}));var U,x,M,B,V,j,F,z,G=D.INFO,H=D.ERROR,W=2e3,X=k(),K=[],Y=0,Q=function(){function t(t){var e=this;this.trace=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.TRACE,t)},this.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.DEBUG,t)},this.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.LOG,t)},this.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.INFO,t)},this.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.WARN,t)},this.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e._print(D.ERROR,t)},this.name=t}return t.prototype._print=function(t,e){if(t>=G){var r=k()-X,n="[".concat(D[t],"][").concat(this.name,"][").concat(I(r,!0),"]");if(K.push({id:Y++,level:t,name:this.name,timestamp:r,args:e,prefix:n,message:""}),K.length>W&&K.shift(),t>=H){var o=(D[t]||"").toLowerCase(),a=console[o];a&&a.apply(void 0,R([n],e,!1))}}},t.prototype.getLogs=function(){return K.map((function(t){return t.message=t.prefix+" "+t.args.map((function(t){return"string"==typeof t?t:C()(t)})).join(" "),t}))},t.prototype.clear=function(){K=[]},t.prototype.setSize=function(t){W=t},t.prototype.setLevel=function(t){G=t},t.prototype.getLevel=function(){return G},t.prototype.setPrintLevel=function(t){H=t},t.prototype.reset=function(){G=D.INFO,H=D.ERROR,W=2e3,X=k(),K=[],Y=0},t.LogLevel=D,t}(),$=(new Q("common"),new Q("demuxer")),q=function(){function t(t){this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return t.prototype.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,n=new Uint8Array(4),o=Math.min(4,e);if(0===o)throw new Error("no bytes available");n.set(t.subarray(r,r+o)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*o,this.bytesAvailable-=o},t.prototype.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&$.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?r<<e|this.readBits(e):r},t.prototype.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e,r=8,n=8;for(e=0;e<t;e++)0!==n&&(n=(r+this.readEG()+256)%256),r=0===n?r:n},t}(),Z=[100,110,122,244,44,83,86,118,128,138,144],J=[[0,1],[1,1],[12,11],[10,11],[16,11],[40,33],[24,11],[20,11],[32,11],[80,33],[18,11],[15,11],[64,33],[160,99],[4,3],[3,2],[2,1]],tt=function(){function t(e){this.generalProfileSpace=0,this.generalTierFlag=0,this.generalProfileIdc=0,this.generalProfileCompatibility=0,this.crop=0,this.cropLeft=0,this.cropRight=0,this.cropTop=0,this.cropBottom=0,this.pixelRatio=[],this.codec="";var r,n,o=new q(e);if(this.generalProfileIdc=o.readUByte(),this.generalProfileCompatibility=o.readUByte(),this.generalLevelIdc=o.readUByte(),this.spsId=o.readUEG(),this.codec=t.generateCodec(this),Z.indexOf(this.generalProfileIdc)>-1){if(this.chromaFormatIdc=o.readUEG(),3===this.chromaFormatIdc&&o.skipBits(1),o.skipUEG(),o.skipUEG(),o.skipBits(1),o.readBits(1))for(r=0,n=3!==this.chromaFormatIdc?8:12;r<n;r++)o.readBits(1)&&(r<6?o.skipScalingList(16):o.skipScalingList(64))}else this.chromaFormatIdc=1;o.skipUEG();var a=o.readUEG();if(0===a)o.skipUEG();else if(1===a)for(o.skipBits(1),o.skipEG(),o.skipEG(),r=0,n=o.readUEG();r<n;r++)o.skipEG();o.skipUEG(),o.skipBits(1);var i=o.readUEG()+1,s=o.readUEG()+1,u=o.readBits(1);if(u||o.skipBits(1),this.height=s*(2-u),o.skipBits(1),this.crop=o.readBits(1),this.crop){var c=1<<(1===this.chromaFormatIdc||2===this.chromaFormatIdc?1:0),p=2-u<<(1===this.chromaFormatIdc?1:0);this.cropLeft=o.readUEG()*c,this.cropRight=o.readUEG()*c,this.cropTop=o.readUEG()*p,this.cropBottom=o.readUEG()*p}if(this.width=16*i-(this.cropRight+this.cropLeft),this.height=16*s-(this.cropTop+this.cropBottom),o.readBits(1)&&o.readBits(1)){var f=o.readUByte();255===f?(this.pixelRatio[0]=o.readUByte()<<8|o.readUByte(),this.pixelRatio[1]=o.readUByte()<<8|o.readUByte()):f<J.length&&(this.pixelRatio=J[f])}}return t.generateCodec=function(t){return"avc1."+[t.generalProfileIdc,t.generalProfileCompatibility,t.generalLevelIdc].map((function(t){return(e=t.toString(16)).length<2?"0"+e:e;var e})).join("")},t}(),et=[1,2,2,1],rt=[1,2,1,1],nt=[1,2,2,1],ot=[1,2,1,1],at=function(){function t(e){var r=this;this.generalProfileSpace=0,this.generalTierFlag=0,this.generalProfileIdc=0,this.generalProfileCompatibilityFlags=[],this.generalConstraintIndicatorFlags=[],this.subLayerProfilePresentFlags=[],this.subLayerLevelPresentFlags=[],this.separateColourPlaneFlag=0,this.pixelRatio=[],this.codec="",this.checkProfileIdc=function(t){return r.generalProfileIdc===t||r.generalProfileCompatibilityFlags[t]};var n,o=new q(e);for(this.vpsId=o.readBits(4),this.maxSubLayersMinus1=o.readBits(3),this.temporalIdNestingFlag=o.readBits(1),this.generalProfileSpace=o.readBits(2),this.generalTierFlag=o.readBits(1),this.generalProfileIdc=o.readBits(5),n=0;n<32;n++)this.generalProfileCompatibilityFlags[n]=o.readBits(1),0===this.generalProfileIdc&&n>0&&this.generalProfileCompatibilityFlags[n]&&(this.generalProfileIdc=n);for(n=0;n<6;n++)this.generalConstraintIndicatorFlags.push(o.readUByte());for(this.generalLevelIdc=o.readUByte(),n=0;n<this.maxSubLayersMinus1;n++)this.subLayerProfilePresentFlags[n]=o.readBits(1),this.subLayerLevelPresentFlags[n]=o.readBits(1);for(this.maxSubLayersMinus1>0&&o.skipBits(2*(8-this.maxSubLayersMinus1)),n=0;n<this.maxSubLayersMinus1;n++)this.subLayerProfilePresentFlags[n]&&o.skipBits(48),this.subLayerLevelPresentFlags[n]&&o.readUByte();if(this.spsId=o.readUEG(),this.codec=t.generateCodec(this),this.chromaFormatIdc=o.readUEG(),3===this.chromaFormatIdc&&(this.separateColourPlaneFlag=o.readBits(1)),this.separateColourPlaneFlag&&(this.chromaFormatIdc=0),this.width=o.readUEG(),this.height=o.readUEG(),o.readBits(1)){var a=et[this.chromaFormatIdc],i=rt[this.chromaFormatIdc],s=o.readUEG()*a,u=o.readUEG()*a,c=o.readUEG()*i,p=o.readUEG()*i;this.width-=s+u,this.height-=c+p}}return t.generateCodec=function(t){var e=["hvc1"],r=t.generalProfileSpace;e.push((r>0&&r<4?String.fromCharCode(64+r):"")+t.generalProfileIdc.toString()),e.push(t.generalProfileCompatibilityFlags.reverse().reduce((function(t,e){return t<<1|e}),0).toString(16)),e.push((t.generalTierFlag?"H":"L")+t.generalLevelIdc);for(var n=!1,o=[],a=5;a>=0;a--){var i=t.generalConstraintIndicatorFlags[a];(i||n)&&(o.unshift(i.toString(16)),n=!0)}return e.concat(o).join(".")},t}(),it=function(t){this.log2CtuSizeMinus5=0,this.ptlDpbHrdParamsPresentFlag=0,this.gdrEnabledFlag=0,this.refPicResamplingEnabledFlag=0,this.resChangeInClvsAllowedFlag=0,this.picWidthMaxInLumasamples=0,this.picHeightMaxInLumasamples=0,this.conformanceWindowFlag=0,this.profileTierPresentFlag=0,this.generalProfileIdc=0,this.generalTierFlag=0,this.generalLevelIdc=0,this.ptlFrameOnlyConstraintFlag=0,this.ptlMultiLayerEnabledFlag=0,this.subLayerProfilePresentFlags=[],this.ptlSubLayerLevelPresentFlags=[],this.subLayerLevelIdc=[],this.ptlNumSubProfiles=0,this.generalSubProfileIdc=[],this.gciPresentFlag=0,this.width=0,this.height=0,this.pixelRatio=[],this.codec="vvc1.1.L48.CA";var e=new q(t),r=0;if(this.spsId=e.readBits(4),this.vpsId=e.readBits(4),this.maxSubLayersMinus1=e.readBits(3),this.chromaFormatIdc=e.readBits(2),this.log2CtuSizeMinus5=e.readBits(2),this.ptlDpbHrdParamsPresentFlag=e.readBits(1),r+=16,this.ptlDpbHrdParamsPresentFlag){if(this.profileTierPresentFlag=1,this.profileTierPresentFlag&&(this.generalProfileIdc=e.readBits(7),this.generalTierFlag=e.readBits(1),r+=8),this.generalLevelIdc=e.readBits(8),r+=8,this.ptlFrameOnlyConstraintFlag=e.readBits(1),this.ptlMultiLayerEnabledFlag=e.readBits(1),r+=2,this.profileTierPresentFlag&&(this.gciPresentFlag=e.readBits(1),r+=1,this.gciPresentFlag)){e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=3,e.skipBits(4),e.skipBits(2),r+=6,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=10,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=6,e.skipBits(2),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=5,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=6,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=16,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=13,e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=6;var n=e.readBits(8);r+=8;var o=0;n>5&&(e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1),r+=6,o=6);var a=0;for(a=0;a<n-o;a++)e.skipBits(1),r+=1}var i=8-r%8;for(e.skipBits(i),r+=i,a=this.maxSubLayersMinus1-1;a>=0;a--)this.ptlSubLayerLevelPresentFlags[a]=e.readBits(1),r+=1;for(i=8-r%8,e.skipBits(i),r+=i,a=this.maxSubLayersMinus1-1;a>=0;a--)this.ptlSubLayerLevelPresentFlags[a]&&(this.subLayerLevelIdc[a]=e.readBits(8),r+=8);if(this.profileTierPresentFlag)for(this.ptlNumSubProfiles=e.readBits(8),a=0;a<this.ptlNumSubProfiles;a++)this.generalSubProfileIdc[a]=e.readBits(32),r+=32}if(this.gdrEnabledFlag=e.readBits(1),this.refPicResamplingEnabledFlag=e.readBits(1),r+=2,this.refPicResamplingEnabledFlag&&(this.resChangeInClvsAllowedFlag=e.readBits(1),r+=1),this.picWidthMaxInLumasamples=e.readUEG(),this.picHeightMaxInLumasamples=e.readUEG(),r+=16,this.conformanceWindowFlag=e.readBits(1),r+=1,this.width=this.picWidthMaxInLumasamples,this.height=this.picHeightMaxInLumasamples,this.conformanceWindowFlag){var s=nt[this.chromaFormatIdc],u=ot[this.chromaFormatIdc],c=e.readUEG()*s,p=e.readUEG()*s,f=e.readUEG()*u,d=e.readUEG()*u;this.width-=c+p,this.height-=f+d}};!function(t){t[t.NONE=-16]="NONE",t[t.DEFAULT=0]="DEFAULT",t[t.NONREF=8]="NONREF",t[t.BIDIR=16]="BIDIR",t[t.NONINTRA=24]="NONINTRA",t[t.NONKEY=32]="NONKEY",t[t.ALL=48]="ALL"}(U||(U={})),function(t){t[t.ABORTED=1]="ABORTED",t[t.NETWORK=2]="NETWORK",t[t.DECODE=3]="DECODE",t[t.SRC_NOT_SUPPORTED=4]="SRC_NOT_SUPPORTED",t[t.PARSER=1001]="PARSER",t[t.WEBGL_NOT_SUPPORTED=10005]="WEBGL_NOT_SUPPORTED",t[t.COROUTINE=20001]="COROUTINE",t[t.BUFFERING=20003]="BUFFERING",t[t.RENDERER=20005]="RENDERER"}(x||(x={})),function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(M||(M={})),function(t){t[t.NETWORK_EMPTY=0]="NETWORK_EMPTY",t[t.NETWORK_IDLE=1]="NETWORK_IDLE",t[t.NETWORK_LOADING=2]="NETWORK_LOADING",t[t.NETWORK_NO_SOURCE=3]="NETWORK_NO_SOURCE"}(B||(B={})),function(t){t.VIDE="vide",t.SOUN="soun"}(j||(j={})),function(t){t[t.FLV=0]="FLV",t[t.MP4=1]="MP4",t[t.HLS=2]="HLS",t[t.MPEGTS=3]="MPEGTS",t[t.UNKNOWN=4]="UNKNOWN"}(F||(F={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VIDEO=1]="VIDEO",t[t.AUDIO=2]="AUDIO"}(z||(z={}));var st,ut=((V={})[j.VIDE]=z.VIDEO,V[j.SOUN]=z.AUDIO,V);!function(t){t[t.DEGRADATION_PRIORITY_MASK=65535]="DEGRADATION_PRIORITY_MASK",t[t.IS_NON_SYNC=65536]="IS_NON_SYNC",t[t.PADDING_MASK=917504]="PADDING_MASK",t[t.REDUNDANCY_MASK=3145728]="REDUNDANCY_MASK",t[t.DEPENDED_MASK=12582912]="DEPENDED_MASK",t[t.DEPENDS_MASK=50331648]="DEPENDS_MASK",t[t.DEPENDS_NO=33554432]="DEPENDS_NO",t[t.DEPENDS_YES=16777216]="DEPENDS_YES"}(st||(st={}));var ct=function(t,e){var r=t.offset;this.start=e,this.size=t.read(4),this.type=String.fromCharCode(t.read(1),t.read(1),t.read(1),t.read(1)).trim(),1===this.size&&(this.size=t.read(8)),this.length=t.offset-r},pt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ft=function(){return ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ft.apply(this,arguments)},dt=new Date("1904-01-01T00:00:00Z").getTime(),lt=function(){function t(t,e){this.children=[],this.isContainer=!1,this.toStandardTime=function(t){return t?dt+1e3*t:t},this.header=t}return t.prototype.append=function(t){this.children.push(t)},t.mapBoxToJSON=function(e){return ft({box:e},e.children.reduce((function(e,r){var n=r.header.type,o=e[n],a=t.mapBoxToJSON(r);return o?Array.isArray(o)?o.push(a):e[n]=[o,a]:e[n]=a,e}),{}))},t}(),ht=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.version=r.read(1),n.flag=r.read(3),n}return pt(e,t),e}(lt),yt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vt=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.sps=[],n.pps=[],n.configVersion=r.read(1),n.generalProfileIdc=r.read(1),n.generalProfileCompatibility=r.read(1),n.generalLevelIdc=r.read(1),n.lengthSizeMinusOne=3&r.read(1),n.numOfSequenceParameterSets=31&r.read(1);var o,a=0,i=[];for(a=0;a<n.numOfSequenceParameterSets;a++){for(o=r.read(2),i=[];o--;)i.push(r.read(1));n.sps.push(new Uint8Array(i))}for(n.numOfPictureParameterSets=31&r.read(1),a=0;a<n.numOfPictureParameterSets;a++){for(o=r.read(2),i=[];o--;)i.push(r.read(1));n.pps.push(new Uint8Array(i))}return n.codec=tt.generateCodec(n),n}return yt(e,t),e}(lt),_t=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mt=function(t){function e(e,r){var n,o=t.call(this,e,r)||this;o.nalus=[],o.vps=[],o.sps=[],o.pps=[],o.sei=[],o.configVersion=r.read(1),n=new d(r.read(1),8),o.generalProfileSpace=n.read(2),o.generalTierFlag=n.read(1),o.generalProfileIdc=n.read(5),n=new d(r.read(4),32),o.generalProfileCompatibilityFlags=Array.from(new Array(32)).map((function(){return n.read(1)})),o.generalConstraintIndicatorFlags=Array.from(new Array(6)).map((function(){return r.read(1)})),o.generalLevelIdc=r.read(1),o.minSpatialSegmentationIdc=4095&r.read(2),o.parallelismType=3&r.read(1),o.chromaFormatIdc=3&r.read(1),o.bitDepthLumaMinus8=7&r.read(1),o.bitDepthChromaMinus8=7&r.read(1),o.avgFrameRate=r.read(2),n=new d(r.read(1),8),o.constantFrameRate=n.read(2),o.numTemporalLayers=n.read(3),o.temporalIdNested=n.read(1),o.lengthSizeMinusOne=n.read(2),o.nalus=[];for(var a=r.read(1),i=0;i<a;i++){var s=[],u=(n=new d(r.read(1),8)).read(1);n.read(1);for(var c=n.read(6),p=r.read(2),f=0;f<p;f++)s.push(new Uint8Array(r.read(2)).map((function(){return r.read(1)})));o.nalus.push({completeness:u,type:c,data:s}),c===_.VPS?s.forEach((function(t){return o.vps.push(t)})):c===_.SPS?s.forEach((function(t){return o.sps.push(t)})):c===_.PPS?s.forEach((function(t){return o.pps.push(t)})):c===_.SEI&&s.forEach((function(t){return o.sei.push(t)}))}return o.codec=at.generateCodec(o),o}return _t(e,t),e}(lt),gt=function(t){for(var e=t.byteLength,r=[],n=1;n<e-2;)0===t[n]&&0===t[n+1]&&3===t[n+2]?(n+=2,r.push(n)):n++;if(0===r.length)return t;var o=e-r.length,a=new Uint8Array(o),i=0;for(n=0;n<o;i++,n++)i===r[0]&&(i++,r.shift()),a[n]=t[i];return a};const Tt=function(){var t=this;this._eventMap={},this.listeners=function(e){return t._eventMap[e]||[]},this.emit=function(e,r){var n=t._eventMap[e];return!!Array.isArray(n)&&(n.forEach((function(t){return t(r)})),!0)},this.off=function(e,r){var n=t._eventMap[e];return Array.isArray(n)&&(t._eventMap[e]=n.filter((function(t){return t!==r}))),t},this.removeAllListeners=function(e){return void 0===e?t._eventMap={}:t._eventMap[e]&&(t._eventMap[e]=[]),t},this.on=function(e,r){return t._eventMap[e]?t._eventMap[e].push(r):t._eventMap[e]=[r],t},this.once=function(e,r){var n=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];t.off(e,n),r.apply(t,o)};return t.on(e,n),t},this.proxy=function(e,r){r.forEach((function(r){t.on(r,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.unshift(r),e.emit.apply(e,t)}))}))},this.proxyOnce=function(e,r){r.forEach((function(r){t.once(r,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.unshift(r),e.emit.apply(e,t)}))}))}};var St,bt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.IDLE=0]="IDLE",t[t.LOADING=1]="LOADING",t[t.SUSPENGING=2]="SUSPENGING",t[t.ERROR=3]="ERROR"}(St||(St={}));var Et=function(t){function e(e){return t.call(this,e)||this}return bt(e,t),e}(Error),wt=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.timeout=15e3,r.total=1/0,r.offset=0,r.status=St.IDLE,r.url="",r._handleError=function(t){"AbortError"!==t.name&&(r._changeStatus(St.ERROR),r.emit("error",{code:x.NETWORK,message:t.message,origin:t}))},r.timeout=e.timeout||r.timeout,r}return bt(e,t),Object.defineProperty(e.prototype,"eof",{get:function(){return this.offset===this.total},enumerable:!1,configurable:!0}),e.prototype._changeStatus=function(t){this.status!==t&&($.log("loader status changed: ".concat(St[this.status]," -> ").concat(St[t])),this.status=t)},e.prototype.jump=function(t){this.offset=t},e.prototype.load=function(t,e,r){return this.reset(),this.url=t,this.loadRange(e,r)},e.prototype.resume=function(){return this.loadRange(this.offset)},e.prototype.suspend=function(){var t=this.status;this._abort(),t===St.LOADING&&(this._changeStatus(St.SUSPENGING),this.emit("suspend",void 0))},e.prototype.abort=function(){var t=this.status;this._abort(),t!==St.SUSPENGING&&t!==St.LOADING||this.emit("abort",void 0)},e.prototype.reset=function(){this.abort(),this.offset=0,this.total=1/0,this.url=""},e.prototype.destroy=function(){this.removeAllListeners(),this.reset()},e}(Tt),Ot={isIos:!1,isDingtalk:!1,isQQBrowser:!1},At=(window.navigator.userAgent||"").toLowerCase();/(iPhone\sOS)\s([\d_]+)/i.test(At)&&(Ot.isIos=!0),At.indexOf("dingtalk")>-1?Ot.isDingtalk=!0:At.indexOf("qqbrowser")>-1&&(Ot.isQQBrowser=!0);var Pt,Ct=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.controller=null,e.timer=-1,e._abort=function(){clearTimeout(e.timer),e.controller&&!e.controller.signal.aborted&&(e.controller.abort(),e.controller=null),e._changeStatus(St.IDLE)},e.triggerTimeout=function(){e._abort(),e._handleError(new Et("加载超时,请重试"))},e}return Ct(e,t),e.isSupported=function(){return Ot.isIos&&(Ot.isDingtalk||Ot.isQQBrowser)?(console.log("ios","isDingtalk",Ot.isDingtalk,"isQQBrowser",Ot.isQQBrowser),!1):"undefined"!=typeof AbortController&&"undefined"!=typeof ReadableStream},e.prototype.loadRange=function(t,e){var r=this;if(void 0===t&&(t=0),void 0===e&&(e=1/0),!this.url||t>=this.total)return Promise.resolve(!1);if(this.status===St.LOADING||this.status===St.ERROR)return Promise.resolve(!1);$.info("执行load, ".concat(this.total," from=").concat(t," to=").concat(e," url=").concat(this.url)),this.abort();var n=new Headers,o=t>0||e<1/0;return o&&(e=Math.min(this.total-1,e),n.set("Range","bytes=".concat(t,"-").concat(e===1/0?"":e))),this._changeStatus(St.LOADING),this.controller=new AbortController,this.emit("loadstart",void 0),this.timer=setTimeout(this.triggerTimeout,this.timeout),fetch(this.url,{method:"GET",headers:n,signal:this.controller.signal}).then((function(e){if(clearTimeout(r.timer),e.status>=200&&e.status<300){if(r.offset=t,o){var n=e.headers.get("Content-Range")||"";r.total=Number(n.split("/")[1])||r.total}else r.total=Number(e.headers.get("Content-Length"))||r.total;if(e.body){var a=e.body.getReader(),i=function(){return a.read().then((function(t){return t.done?(r.total===1/0&&(r.total=r.offset),r.controller=null,r._changeStatus(St.IDLE),r.emit("loadend",void 0),!0):(r.offset+=t.value.byteLength,r.emit("progress",{offset:r.offset-t.value.byteLength,data:t.value}),i())}))};return i()}if(e.arrayBuffer)return e.arrayBuffer().then((function(t){return r.offset+=t.byteLength,r.emit("progress",{offset:r.offset-t.byteLength,data:new Uint8Array(t)}),r.controller=null,r._changeStatus(St.IDLE),r.emit("loadend",void 0),!0}))}var s=new Et("媒体流数据不存在: ".concat(r.url));throw s.response=e,s})).catch((function(t){return clearTimeout(r.timer),r._handleError(t),!1}))},e}(wt),It=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.xhr=null,e._timer=-1,e._resolve=function(t){},e.triggerTimeout=function(){e._abort(),e._handleError(new Error("加载超时,请重试"))},e}return It(e,t),e.prototype._abort=function(){var t=this.xhr;t&&(t.onerror=null,t.onprogress=null,t.onloadend=null,t.onreadystatechange=null,t.abort(),this.xhr=null,this._resolve(!1)),this._changeStatus(St.IDLE)},e.prototype.loadRange=function(t,e){var r=this;return void 0===t&&(t=0),void 0===e&&(e=1/0),!this.url||t>=this.total||this.status===St.LOADING||this.status===St.ERROR?Promise.resolve(!1):(this.abort(),new Promise((function(n,o){r.xhr=new XMLHttpRequest,r._resolve=n;var a=r.xhr,i=t>0||e<1/0;a.open("GET",r.url),i&&a.setRequestHeader("Range","bytes=".concat(t,"-").concat(e===1/0?"":e)),a.onreadystatechange=function(){if(a.readyState===a.HEADERS_RECEIVED&&a.status>=200&&a.status<300)if(i){var t=a.getResponseHeader("Content-Range")||"";r.total=Number(t.split("/")[1])||r.total}else r.total=Number(a.getResponseHeader("Content-Length"))||r.total;a.readyState>=a.HEADERS_RECEIVED&&clearTimeout(r._timer)},r.offset=t;var s=0,u=function(t){var e,n=a.responseText,o=n.length,u=s,c=r.offset,p=o-u;p>0&&(r.offset+=p),!i&&t&&r.total===1/0&&(r.total=r.offset),p>0&&(s=o,r.emit("progress",{offset:c,data:(e=n.substring(u,o),new Uint8Array(e.length).map((function(t,r){return e.charCodeAt(r)})))}))};a.timeout=r.timeout,a.onprogress=function(){u(!1)},a.onloadend=function(){u(!0),r.xhr=null,r._changeStatus(St.IDLE),r.emit("loadend",void 0),n(!0)},a.onerror=function(t){r.xhr=null;var e=new Error(t.constructor.name);r._handleError(e),o(e)},a.overrideMimeType("text/plain; charset=x-user-defined"),r._changeStatus(St.LOADING),r.emit("loadstart",void 0),r._timer=setTimeout(r.triggerTimeout,r.timeout),a.send()})))},e}(wt),kt=Nt.isSupported()?Nt:Lt,Dt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rt=function(t){function e(e){var r=t.call(this)||this;return r.skipFrame=U.DEFAULT,r.metadata=null,r.options=e,r.onProgress=r.onProgress.bind(r),r.onLoadEnd=r.onLoadEnd.bind(r),r.originLoader=new kt(r.options),r.customLoader=e.loader,r.loader.on("progress",r.onProgress),r.loader.on("loadend",r.onLoadEnd),r.skipFrame=e.skipFrame||U.DEFAULT,r}return Dt(e,t),Object.defineProperty(e.prototype,"loader",{get:function(){return this.customLoader||this.originLoader},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.loader.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.loader.status},enumerable:!1,configurable:!0}),e.probe=function(t){throw new Error("parser should implements static probe")},e.prototype.onProgress=function(t){},e.prototype.onLoadEnd=function(){},e.prototype.load=function(t){return this.reset(),this.loader.load(t)},e.prototype.suspend=function(){return this.loader.suspend()},e.prototype.resume=function(){return this.loader.resume()},e.prototype.reset=function(){this.loader.reset(),this.metadata=null},e.prototype.destroy=function(){this.reset(),this.loader.off("progress",this.onProgress),this.loader.off("loadend",this.onLoadEnd),this.originLoader.destroy(),this.removeAllListeners()},e}(Tt),Ut=function(){function t(t){this.signature=String.fromCharCode(t.read(1),t.read(1),t.read(1)),this.version=t.read(1);var e=t.read(1);this.size=t.read(4);var r=new d(e,8);r.read(5),this.hasAudio=!!r.read(1),r.read(1),this.hasVideo=!!r.read(1)}return t.BUFFER_LENGTH=9,t}();!function(t){t[t.AUDIO=8]="AUDIO",t[t.VIDEO=9]="VIDEO",t[t.SCRIPT=18]="SCRIPT"}(Pt||(Pt={}));var xt,Mt=function(){function t(t){this.type=t.read(1),this.size=t.read(3),this.dts=t.read(3),this.dts|=t.read(1)<<24,t.skip(3)}return t.BUFFER_LENGTH=11,t}();!function(t){t[t.PCM=0]="PCM",t[t.ADPCM=1]="ADPCM",t[t.MP3=2]="MP3",t[t.PCM_LE=3]="PCM_LE",t[t.NELLYMOSER_16KHZ_MONO=4]="NELLYMOSER_16KHZ_MONO",t[t.NELLYMOSER_8KHZ_MONO=5]="NELLYMOSER_8KHZ_MONO",t[t.NELLYMOSER=6]="NELLYMOSER",t[t.PCM_ALAW=7]="PCM_ALAW",t[t.PCM_MULAW=8]="PCM_MULAW",t[t.AAC=10]="AAC",t[t.SPEEX=11]="SPEEX"}(xt||(xt={}));var Bt,Vt,jt=[5512,11025,22050,44100],Ft=[8,16];!function(t){t[t.MONO=0]="MONO",t[t.STEREO=1]="STEREO"}(Bt||(Bt={})),function(t){t[t.ADTS_HEADER=0]="ADTS_HEADER",t[t.RAW=1]="RAW"}(Vt||(Vt={}));var zt,Gt=function(){function t(t){var e=new d(t.read(1),8);this.codecId=e.read(4),this.sampleRate=jt[e.read(2)],this.sampleSize=Ft[e.read(1)],this.soundType=e.read(1),this.packetType=t.read(1),this.data=t.readToUint8()}return t.readAudioSpecificConfig=function(t){var e=new d(t.read(2),16),r=e.read(5),n=e.read(4),o=e.read(4);return{audioObjectType:r,sampleRate:a[n],samplingFrequencyIndex:n,channelCount:o}},t}();function Ht(t){var e=t.read(2);return Array.from(Array(e)).map((function(){var e=t.read(1);return e>0?String.fromCharCode(e):""})).join("")}function Wt(t){var e=Ht(t),r=Xt(t);return{key:e,value:r.value,objectEnd:r.objectEnd}}function Xt(t){var e={value:null,objectEnd:!1},r=t.read(1);switch(r){case zt.NUMBER:e.value=t.readFloat(8);break;case zt.BOOLEAN:e.value=!!t.read(1);break;case zt.LONG_STRING:case zt.STRING:e.value=Ht(t);break;case zt.OBJECT_START:e.value=function(t){for(var e={};t.unreadLength>0;){var r=Wt(t);if(r.objectEnd)break;e[r.key]=r.value}return e}(t);break;case zt.ECMA_ARRAY:e.value=function(t){for(var e=t.read(4),r={};e-- >0;){var n=Wt(t);r[n.key]=n.value}return r}(t);break;case zt.OBJECT_END:e.objectEnd=!0;break;case zt.STRICT_ARRAY:e.value=function(t){for(var e=t.read(4),r=[];e-- >0;){var n=Xt(t);r.push(n.value)}return r}(t);break;case zt.DATE:e.value=new Date(t.readFloat(8)+60*t.readInt(2)+1e3);break;default:console.warn("unknown AMF value type",r)}return e}!function(t){t[t.NUMBER=0]="NUMBER",t[t.BOOLEAN=1]="BOOLEAN",t[t.STRING=2]="STRING",t[t.OBJECT_START=3]="OBJECT_START",t[t.NULL=5]="NULL",t[t.UNDEFINED=6]="UNDEFINED",t[t.REFERENCE=7]="REFERENCE",t[t.ECMA_ARRAY=8]="ECMA_ARRAY",t[t.OBJECT_END=9]="OBJECT_END",t[t.STRICT_ARRAY=10]="STRICT_ARRAY",t[t.DATE=11]="DATE",t[t.LONG_STRING=12]="LONG_STRING"}(zt||(zt={}));var Kt,Yt,Qt,$t,qt,Zt=function(t){this.name=Xt(t).value,this.value=Xt(t).value};!function(t){t[t.KEY=1]="KEY",t[t.INTER=2]="INTER",t[t.DISP_INTER=3]="DISP_INTER",t[t.GENERATED_KEY=4]="GENERATED_KEY",t[t.VIDEO_INFO_CMD=5]="VIDEO_INFO_CMD"}(Kt||(Kt={})),function(t){t[t.STARTSEEK=0]="STARTSEEK",t[t.ENDSEEK=1]="ENDSEEK"}(Yt||(Yt={})),function(t){t[t.JPEG=1]="JPEG",t[t.H263=2]="H263",t[t.SCREEN=3]="SCREEN",t[t.VP6=4]="VP6",t[t.VP6A=5]="VP6A",t[t.SCREEN2=6]="SCREEN2",t[t.H264=7]="H264",t[t.REALH263=8]="REALH263",t[t.MPEG4=9]="MPEG4",t[t.H265=12]="H265",t[t.H266=14]="H266"}(Qt||(Qt={})),function(t){t[t.AVC_SEQUENCE_HEADER=0]="AVC_SEQUENCE_HEADER",t[t.AVC_NALU=1]="AVC_NALU",t[t.AVC_END=2]="AVC_END",t[t.COCED_FRAMES_X=3]="COCED_FRAMES_X",t[t.METADATA=4]="METADATA",t[t.MPEG2_TS_SEQUENCE_START=5]="MPEG2_TS_SEQUENCE_START",t[t.MULTI_TRACK=6]="MULTI_TRACK"}($t||($t={})),function(t){t[t.OneTrackOneCodec=0]="OneTrackOneCodec",t[t.ManyTracksOneCodec=1]="ManyTracksOneCodec",t[t.ManyTracksManyCodecs=2]="ManyTracksManyCodecs"}(qt||(qt={}));var Jt,te=function(){function t(t){this.videoCommand=Yt.STARTSEEK,this.codecId=Qt.H265,this.packetType=$t.AVC_NALU,this.cts=0,this.videoFourCC="";var e=new d(t.read(1),8);if(this.isExVideoHeader=e.read(1),this.type=e.read(3),this.videoFrameType=this.type,0===this.isExVideoHeader&&(this.codecId=e.read(4),this.packetType=t.read(1),this.type===Kt.VIDEO_INFO_CMD&&(this.videoCommand=t.read(1))),1===this.isExVideoHeader){var r=e.read(4);if(r!=$t.METADATA&&this.videoFrameType===Kt.VIDEO_INFO_CMD)this.videoCommand=t.read(1);else if(r==$t.MULTI_TRACK){var n=new d(t.read(1),8),o=n.read(4);r=n.read(4),o==qt.ManyTracksManyCodecs&&(String.fromCharCode(t.read(1)),this.videoFourCC=this.bin2str(t.readToUint8(4)))}else this.videoFourCC=this.bin2str(t.readToUint8(4));this.packetType=r}this.codecId=this.convertCodecNameToVideoCodecID(this.videoFourCC)||this.codecId,this.cts=t.read(3)+4286578688^4286578688,this.data=t.readToUint8()}return t.prototype.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.prototype.convertCodecNameToVideoCodecID=function(t){return/hvc1/.test(t)||/1cvh/.test(t)?Qt.H265:/vvc1/.test(t)||/1cvv/.test(t)||/vvi1/.test(t)?Qt.H266:void 0},t}(),ee={isFirefox:!1,isOpera:!1,isTrident:!1,isEdge:!1,isChrome:!1,isSafari:!1,isMQQBrowser:!1,isMobile:!1,isIos:!1,isDingtalk:!1},re=void 0!==window.navigator,ne=re?window.navigator.userAgent:"";if(ne.indexOf("MQQBrowser")>-1?ee.isMQQBrowser=!0:ne.indexOf("Firefox")>-1?ee.isFirefox=!0:ne.indexOf("Opera")>-1||ne.indexOf("OPR")>-1?ee.isOpera=!0:ne.indexOf("Trident")>-1?ee.isTrident=!0:ne.indexOf("Edge")>-1?ee.isEdge=!0:ne.indexOf("Chrome")>-1?(ee.isChrome=!0,(ne.toLowerCase().match(/chrome\/([\d.]+)/)||[])[1]):ne.indexOf("Safari")>-1||ne.indexOf("iPhone")>-1||ne.indexOf("iPad")>-1||ne.indexOf("iPod")>-1?ee.isSafari=!0:ne.toLowerCase().indexOf("dingtalk")>-1&&(ee.isDingtalk=!0),/(iPhone\sOS)\s([\d_]+)/i.test(ne)&&(ee.isIos=!0),re){var oe=window.navigator;if("maxTouchPoints"in oe)ee.isMobile=oe.maxTouchPoints>0;else if("msMaxTouchPoints"in oe)ee.isMobile=oe.msMaxTouchPoints>0;else{var ae=null===(Jt=window.matchMedia)||void 0===Jt?void 0:Jt.call(window,"(pointer:coarse)");if(ae&&"(pointer:coarse)"===ae.media)ee.isMobile=!!ae.matches;else if("orientation"in window)ee.isMobile=!0;else{var ie=oe.userAgent;ee.isMobile=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(ie)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(ie)}}}var se,ue=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ce=function(t){function e(e,r){var n,o=t.call(this,e,r)||this;o.generalTierFlag=0,o.numBytesConstraintInfo=0,o.generalProfileIdc=0,o.generalLevelIdc=0,o.chromaFormatIdc=0,o.bitDepthLumaMinus8=0,o.bitDepthChromaMinus8=0,o.avgFrameRate=0,o.constantFrameRate=0,o.lengthSizeMinusOne=0,o.olsIdx=0,o.ptlFrameOnlyConstraintFlag=0,o.ptlMultilayerEnabledFlag=0,o.maxPictureWidth=0,o.maxPictureHeight=0,o.nalus=[],o.vps=[],o.sps=[],o.pps=[],o.sei=[],o.codec="",o.codecTag="vvc1",(n=new d(r.read(1),8)).skip(5);var a=n.read(2),i=n.read(1);if(o.lengthSizeMinusOne=a,i){var s=(n=new d(r.read(3),24)).read(9),u=n.read(3),c=n.read(2),p=n.read(2),f=n.read(3);o.olsIdx=s,o.constantFrameRate=c,o.chromaFormatIdc=p,o.bitDepthLumaMinus8=f,n.skip(5),(n=new d(r.read(2),16)).skip(2);var l=n.read(6),h=n.read(7),y=n.read(1);o.numBytesConstraintInfo=l,o.generalTierFlag=y,o.generalProfileIdc=h;var v=r.read(1);o.generalLevelIdc=v;var _=(n=new d(r.read(1),8)).read(1),m=n.read(1);o.ptlFrameOnlyConstraintFlag=_,o.ptlMultilayerEnabledFlag=m;var g=0;l>0?n.skip(8*l-2):n.read(6);var S=0;if(u>1){n=new d(r.read(1),8);var b=0;for(S=u-2;S>=0;--S){b|=n.read(1)<<S}for(S=u;S<=8&&u>1;++S)n.read(1);var E=[];for(S=u-2;S>=0;--S)b&1<<S&&(E[S]=r.read(1));var w=r.read(1),O=[];if(w)for(g=0;g<w;g++)O.push(r.readInt(1))}var A=r.read(2),P=r.read(2);o.maxPictureWidth=A,o.maxPictureHeight=P;var C=r.read(2);o.avgFrameRate=C}var N=r.read(1),I=0,L=0;for(I=0;I<N;I++){(n=new d(r.read(1),8)).read(1),n.skip(2);var k=n.read(5),D=[],R=0;for(k!=T.VVC_DCI_NUT&&k!=T.VVC_OPI_NUT&&(R=r.read(2)),L=0;L<R;L++)D.push(new Uint8Array(r.read(2)).map((function(){return r.read(1)})));k===T.VVC_VPS_NUT?D.forEach((function(t){return o.vps.push(t)})):k===T.VVC_SPS_NUT?D.forEach((function(t){return o.sps.push(t)})):k===T.VVC_PPS_NUT&&D.forEach((function(t){return o.pps.push(t)}))}return o.configVersion=0,o.codec="vvc1.1.L48.CA",o}return ue(e,t),e}(ht),pe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fe=1e3,de=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.header=null,e.flvMetadata=null,e.videoTrackMeta=null,e.audioTrackMeta=null,e.unhandleBuffer=null,e.cachePackets=[],e.videoLoaded=!1,e.baseVideoPTS=0,e.baseVideoDTS=0,e.audioLoaded=!1,e.baseAudioPTS=0,e.baseAudioDTS=0,e.isHVCC=!1,e.formatType=F.FLV,e}return pe(e,t),e.probe=function(t){return!(t.byteLength<9)&&"FLV"===new Ut(new o(t.buffer,t.byteOffset,t.byteLength)).signature},e.prototype.parse=function(t,e){var r=[];if(!t.byteLength)return r;this.unhandleBuffer&&(t=o.concat(this.unhandleBuffer,t),e-=this.unhandleBuffer.byteLength,this.unhandleBuffer=null);var n=new o(t);for(!this.header&&n.unreadLength>=Ut.BUFFER_LENGTH&&(this.header=new Ut(n),!1===this.header.hasVideo&&(this.header.hasVideo=!0),n.skip(this.header.size-Ut.BUFFER_LENGTH));n.unreadLength>4+Mt.BUFFER_LENGTH;){n.skip(4);var a=new Mt(n);if(!(n.unreadLength>=a.size)){n.back(4+Mt.BUFFER_LENGTH);break}var i=new o(n.buffer,n.offset,a.size);switch(n.skip(a.size),a.type){case Pt.VIDEO:r=r.concat(this.parseVideoBody(a,i,n.offset+e));break;case Pt.AUDIO:r=r.concat(this.parseAudioBody(a,i,n.offset+e));break;case Pt.SCRIPT:this.parseScriptBody(a,i);break;default:return $.warn("unknown tag type",a.type),r}}return this.unhandleBuffer=n.unreadLength?n.readToBuffer():null,r},e.prototype.checkMetadata=function(){var t=this.flvMetadata,e=this.header;if(console.log("checkMetadata flvMetadata:",t,"header:",e,", this.metadata:",this.metadata),e&&!this.metadata){var r=[];if(e.hasVideo){if(!this.videoTrackMeta||!this.videoLoaded)return void console.log("checkMetadata hasVideo no this.videoTrackMeta",this.videoTrackMeta,", this.videoLoaded",this.videoLoaded);this.videoTrackMeta.baseDTS=this.baseVideoDTS,this.videoTrackMeta.basePTS=this.baseVideoPTS,this.videoTrackMeta.fps=null==t?void 0:t.framerate,r.push(this.videoTrackMeta)}if(e.hasAudio){if(!this.audioTrackMeta||!this.audioLoaded)return void console.log("checkMetadata hasAudio no this.audioTrackMeta",this.audioTrackMeta,", this.audioLoaded",this.audioLoaded);this.audioTrackMeta.baseDTS=this.baseAudioDTS,this.audioTrackMeta.basePTS=this.baseAudioPTS,r.push(this.audioTrackMeta)}var n=this.options,o=n.live,a=n.progressive;this.metadata={formatType:F.FLV,live:!!o,progressive:!o&&!!a,url:this.loader.url,basePTS:Math.min.apply(Math,r.map((function(t){return t.basePTS||0}))),baseDTS:Math.min.apply(Math,r.map((function(t){return t.baseDTS||0}))),timescale:fe,duration:1e3*((null==t?void 0:t.duration)||1/0),tracks:r},console.log("checkMetadata loadedmetadata",this.metadata),this.emit("loadedmetadata",this.metadata)}},e.prototype.parseVideoBody=function(t,e,r){var n,a,i,s,u,c,p,f,d,h,y,v=this,m=new te(e);this.emit("loadedtag",{header:t,body:m});var g=[],b=m.type===Kt.KEY,w=!1;if(!m.data.length)return $.warn("[videox] flv parse empty data",t,m),g;if(m.packetType===$t.AVC_SEQUENCE_HEADER){var O=this.flvMetadata||{},A={type:z.VIDEO,id:2,baseDTS:0,basePTS:0,timescale:fe,vps:[],sps:[],pps:[],sei:[],width:O.width||0,height:O.height||0,codec:"",pixelRatio:[],live:(null===(n=this.metadata)||void 0===n?void 0:n.live)||!1};if(m.codecId===Qt.H264){var P=new ct(new o(new ArrayBuffer(8)),0),C=new o(m.data.buffer,m.data.byteOffset,m.data.byteLength),N=new vt(P,C);A.pps=N.pps,A.sps=N.sps,A.codec=N.codec;var I=N.sps[0];if(I){var L=new tt(I.subarray(1));A.width=L.width,A.height=L.height}}else if(m.codecId===Qt.H265){if(l.extractAnnexbNAL(m.data).forEach((function(t){var e=new o(t.buffer,t.byteOffset,t.length),r=new S(e);if(r.nalType<_.ACCESS_UNIT_DELIMITER)if(r.nalType===_.SPS){var n=new at(gt(e.readToUint8()));A.sps.push(t),A.codec=n.codec,console.log("thisvideoTrackMeta sps.codec=",n.codec),A.width=n.width,A.height=n.height}else r.nalType===_.VPS?A.vps.push(t):r.nalType===_.PPS&&A.pps.push(t)})),""===A.codec){P=new ct(new o(new ArrayBuffer(8)),0),C=new o(m.data.buffer,m.data.byteOffset,m.data.byteLength);var k=new mt(P,C);if(A.vps=k.vps,A.pps=k.pps,A.sps=k.sps,A.sei=k.sei,A.codec=k.codec,k.sps&&k.sps.length>0){L=new at(gt(k.sps[0]));A.width=L.width,A.height=L.height}this.isHVCC=!0}}else if(m.codecId===Qt.H266&&(l.extractAnnexbNAL(m.data).forEach((function(t){var e=new o(t.buffer,t.byteOffset,t.length),r=new E(e);if(r.nalType<T.VVC_UNSPEC_31)if(r.nalType===T.VVC_SPS_NUT){var n=new it(gt(e.readToUint8()));A.width=n.width,A.height=n.height,A.codec=n.codec,A.sps.push(t)}else r.nalType===T.VVC_VPS_NUT?A.vps.push(t):r.nalType===T.VVC_PPS_NUT&&A.pps.push(t)})),""===A.codec)){P=new ct(new o(new ArrayBuffer(8)),0),C=new o(m.data.buffer,m.data.byteOffset,m.data.byteLength);var D=new ce(P,C);A.vps=D.vps,A.pps=D.pps,A.sps=D.sps,A.sei=D.sei,A.codec=D.codec,this.isHVCC=!0}this.videoTrackMeta=A,this.checkMetadata()}else{var R=[];if(m.codecId===Qt.H266){var x={type:z.VIDEO,id:2,baseDTS:0,basePTS:0,timescale:fe,vps:[],sps:[],pps:[],sei:[],width:(null===(a=this.flvMetadata)||void 0===a?void 0:a.width)||0,height:(null===(i=this.flvMetadata)||void 0===i?void 0:i.height)||0,codec:"",pixelRatio:[],live:(null===(s=this.metadata)||void 0===s?void 0:s.live)||!1},M=[],B=[],V=[],j=[],F=[];F=m.data.length>4&&0===m.data[0]&&0===m.data[1]&&0===m.data[2]&&1===m.data[3]?l.extractAnnexbNAL(m.data):l.extractAVCCNAL(m.data,3);var G=[];F.forEach((function(t){var e=new o(t.buffer,t.byteOffset,t.length),r=new E(e);if(r.nalType>=7&&r.nalType<=10&&(b=!0,v.videoTrackMeta&&v.videoTrackMeta.sps.length>0&&G.push(E.createAnnexbStartCode(),v.videoTrackMeta.sps[0]),v.videoTrackMeta&&v.videoTrackMeta.pps.length>0&&G.push(E.createAnnexbStartCode(),v.videoTrackMeta.pps[0]),v.videoTrackMeta&&v.videoTrackMeta.vps.length>0&&G.push(E.createAnnexbStartCode(),v.videoTrackMeta.vps[0]),v.videoTrackMeta&&v.videoTrackMeta.sei.length>0&&G.push(E.createAnnexbStartCode(),v.videoTrackMeta.sei[0])),G.push(E.createAnnexbStartCode(),t),r.nalType<T.VVC_UNSPEC_31)if(r.nalType===T.VVC_SPS_NUT){var n=new it(gt(e.readToUint8()));x.width=n.width,x.height=n.height,x.codec=n.codec,M.push(t)}else r.nalType===T.VVC_VPS_NUT?B.push(t):r.nalType===T.VVC_PPS_NUT?V.push(t):r.nalType===T.VVC_PREFIX_SEI_NUT&&j.push(t);w=E.isNonRefNALType(r.nalType)}));var H=o.concatUint8s(G);R.push(H),B.length&&(x.vps=B),M.length&&(x.sps=M),V.length&&(x.pps=V),j.length&&(x.sei=j),M.length&&(this.videoTrackMeta?(this.videoTrackMeta.vps=[],this.videoTrackMeta.sps=[],this.videoTrackMeta.pps=[],B.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.vps.push(t)})),M.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sps.push(t)})),V.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.pps.push(t)})),j.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sei.push(t)}))):this.videoTrackMeta=x)}else if(m.codecId!==Qt.H265||this.isHVCC){q=l.extractAVCCNAL(m.data,3);var W={type:z.VIDEO,id:2,baseDTS:0,basePTS:0,timescale:fe,vps:[],sps:[],pps:[],sei:[],width:(null===(f=this.flvMetadata)||void 0===f?void 0:f.width)||0,height:(null===(d=this.flvMetadata)||void 0===d?void 0:d.height)||0,codec:"",pixelRatio:[],live:(null===(h=this.metadata)||void 0===h?void 0:h.live)||!1},X=[],K=[],Y=[],Q=[];q.forEach((function(t){var e=new o(t.buffer,t.byteOffset,t.length),r=new S(e);if(r.nalType>=16&&r.nalType<=23&&(b=!0),r.nalType<_.ACCESS_UNIT_DELIMITER){if(r.nalType===_.SPS){var n=new at(gt(e.readToUint8()));X.push(t),W.codec=n.codec,W.width=n.width,W.height=n.height}else r.nalType===_.VPS?K.push(t):r.nalType===_.PPS?Y.push(t):r.nalType===_.SEI?Q.push(t):ee.isSafari?r.nalType===_.TRAIL_R||r.nalType===_.TRAIL_N||r.nalType===_.IDR_W_RADL||r.nalType===_.IDR_N_LP||r.nalType===_.CRA?R.push(t):console.warn("skip this nalu nalType:",r.nalType):R.push(t);w=S.isNonRefNALType(r.nalType)}})),K.length&&(W.vps=K),X.length&&(W.sps=X),Y.length&&(W.pps=Y),Q.length&&(W.sei=Q),X.length>0&&(this.videoTrackMeta?(this.videoTrackMeta.vps=[],this.videoTrackMeta.sps=[],this.videoTrackMeta.pps=[],this.videoTrackMeta.sei=[],K.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.vps.push(t)})),X.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sps.push(t)})),Y.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.pps.push(t)})),Q.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sei.push(t)}))):this.videoTrackMeta=W)}else{if(this.skipFrame===U.NONREF&&S.isNonRefNALType(S.extractNALType(m.data,4)))return console.warn("skipFrame isNonRefNALType"),[];var q,Z={type:z.VIDEO,id:2,baseDTS:0,basePTS:0,timescale:fe,vps:[],sps:[],pps:[],sei:[],width:(null===(u=this.flvMetadata)||void 0===u?void 0:u.width)||0,height:(null===(c=this.flvMetadata)||void 0===c?void 0:c.height)||0,codec:"",pixelRatio:[],live:(null===(p=this.metadata)||void 0===p?void 0:p.live)||!1},J=[],et=[],rt=[],nt=[];(q=l.extractAnnexbNAL(m.data)).forEach((function(t){var e=new o(t.buffer,t.byteOffset,t.length),r=new S(e);if(r.nalType>=16&&r.nalType<=23&&(b=!0),r.nalType<_.ACCESS_UNIT_DELIMITER)if(r.nalType===_.SPS){var n=new at(gt(e.readToUint8()));J.push(t),Z.codec=n.codec,Z.width=n.width,Z.height=n.height}else r.nalType===_.VPS?et.push(t):r.nalType===_.PPS?rt.push(t):r.nalType===_.SEI&&nt.push(t);w=S.isNonRefNALType(r.nalType),R.push(t)})),et.length&&(Z.vps=et),J.length&&(Z.sps=J),rt.length&&(Z.pps=rt),nt.length&&(Z.sei=nt),J.length&&(this.videoTrackMeta?(this.videoTrackMeta.vps=[],this.videoTrackMeta.sps=[],this.videoTrackMeta.pps=[],et.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.vps.push(t)})),J.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sps.push(t)})),rt.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.pps.push(t)})),nt.forEach((function(t){var e;return null===(e=v.videoTrackMeta)||void 0===e?void 0:e.sei.push(t)}))):this.videoTrackMeta=Z)}if(!this.videoLoaded&&this.videoTrackMeta){if(!b)return[];this.videoLoaded=!0,this.baseVideoDTS=t.dts,this.baseVideoPTS=m.cts+t.dts,this.checkMetadata()}if(this.videoTrackMeta&&m.codecId==Qt.H265&&b&&(this.videoTrackMeta.pps.forEach((function(t){return R.unshift(t)})),this.videoTrackMeta.sps.forEach((function(t){return R.unshift(t)})),this.videoTrackMeta.vps.forEach((function(t){return R.unshift(t)})),this.videoTrackMeta.sei.forEach((function(t){return R.unshift(t)}))),R.length){var ot={trackId:2,codec:(null===(y=this.videoTrackMeta)||void 0===y?void 0:y.codec)||"",trackType:z.VIDEO,isSync:b||m.type===Kt.KEY,isNonRef:w,data:R,dts:t.dts,pts:t.dts+m.cts,offset:r,size:R.reduce((function(t,e){return t+e.byteLength}),0)};g.push(ot)}}return g},e.prototype.parseAudioBody=function(t,e,r){var n,a=new Gt(e);this.emit("loadedtag",{header:t,body:a});var i=[];if(a.packetType===Vt.ADTS_HEADER){var s=new o(a.data.buffer,a.data.byteOffset,a.data.byteLength),u=Gt.readAudioSpecificConfig(s);this.audioTrackMeta={id:1,baseDTS:0,basePTS:0,type:z.AUDIO,codec:"mp4a.40."+u.audioObjectType,timescale:fe,audioObjectType:u.audioObjectType,sampleRate:u.sampleRate,samplingFrequencyIndex:u.samplingFrequencyIndex,sampleSize:a.sampleSize,channelCount:u.channelCount},this.checkMetadata()}else this.audioLoaded||(this.audioLoaded=!0,this.baseAudioDTS=t.dts,this.baseAudioPTS=t.dts,this.checkMetadata()),i.push({codec:(null===(n=this.audioTrackMeta)||void 0===n?void 0:n.codec)||"",trackId:1,trackType:z.AUDIO,isSync:!0,isNonRef:!1,data:[a.data],dts:t.dts,pts:t.dts,offset:r,size:a.data.byteLength});return i},e.prototype.parseScriptBody=function(t,e){var r=new Zt(e);this.emit("loadedtag",{header:t,body:r});var n=r.value;n&&"onMetaData"===r.name&&(this.flvMetadata=n,$.info("flv script tag loaded, flv metadata:",this.flvMetadata))},e.prototype.onProgress=function(t){var e=t.data,r=t.offset;if(e.byteLength){var n=this.parse(e.buffer,r);if(n.length){var o=void 0;this.cachePackets.length?(o=this.cachePackets.concat(n),this.cachePackets=[]):o=n,this.metadata&&this.loader.status!==St.SUSPENGING?this.emit("loadeddata",{packets:o}):this.cachePackets=o}}},e.prototype.onLoadEnd=function(){this.loader.eof&&this.emit("end",void 0)},e.prototype.seek=function(){},e.prototype.reset=function(){t.prototype.reset.call(this),this.cachePackets=[],this.videoLoaded=!1,this.audioLoaded=!1,this.baseVideoDTS=0,this.baseVideoPTS=0,this.baseAudioDTS=0,this.baseAudioPTS=0,this.header=null,this.unhandleBuffer=null,this.flvMetadata=null,this.videoTrackMeta=null,this.audioTrackMeta=null},e}(Rt),le=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),he=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContainer=!0,e}return le(e,t),e}(lt),ye=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ve=function(t){function e(e,r){var n=t.call(this,e,r)||this;r.skip(4),r.skip(2),n.bitReferenceId=r.read(2),n.codeStreamVersion=r.read(4),r.skip(4),r.skip(8),n.width=r.read(2),n.heigth=r.read(2),n.horizontalResolution=r.read(4),n.verticalResolution=r.read(4),r.skip(4),n.frameCount=r.read(2);var o=Math.min(r.read(1),32);return n.compressorName=Array.from(new Array(o)).map((function(){return String.fromCharCode(r.read(1))})).join(""),r.skip(32-(o+1)),n.depth=r.read(2),r.skip(2),n}return ye(e,t),e}(he),_e=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _e(e,t),e}(ve),ge=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Te=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.bufferSizeDB=r.read(4),n.maxBitrate=r.read(4),n.avgBitrate=r.read(4),n}return ge(e,t),e}(lt),Se=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),be=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.version=r.read(1),n.flag=r.read(3),n.entryCount=r.read(4),n}return Se(e,t),e}(he),Ee=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),we=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.entries=[],n.version=r.read(1),n.flag=r.read(3),n.entryCount=r.read(4);for(var o=0;o<n.entryCount;o++){var a=1===n.version;n.entries.push({segmentDuration:r.read(a?8:4),mediaTime:r.read(a?8:4),mediaRateInteger:r.read(2),mediaRateFraction:r.read(2)})}return n}return Ee(e,t),e}(lt),Oe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.OD=1]="OD",t[t.IOD=2]="IOD",t[t.ESD=3]="ESD",t[t.DCD=4]="DCD",t[t.DSD=5]="DSD",t[t.SLCD=6]="SLCD"}(se||(se={}));var Ae,Pe=function(){function t(e){this.tag=e.read(1),this.size=t.readSize(e)}return t.readSize=function(t){for(var e,r=0,n=4;n--&&(r=r<<7|127&(e=t.read(1)),128&e););return r},t.extractDescriptors=function(e){for(var r,n,a,i=[];e.unreadLength;){if(r=new t(e),a=new o(e.buffer,e.offset,r.size),e.skip(r.size),r.size<=0)return i;switch(r.tag){case se.ESD:n=new Ne(r,a);break;case se.DCD:n=new Ie(r,a);break;case se.DSD:n=new Le(r,a);break;case se.SLCD:n=new ke(r,a);break;default:n=null}n&&a.unreadLength&&(n.children=t.extractDescriptors(a)),i.push(n)}return i},t}(),Ce=function(){function t(t){this.children=[],this.probe=t}return t.findDescriptor=function(e,r){var n;return e.some((function(e){return!!(n=e.probe.tag===r?e:t.findDescriptor(e.children,r))})),n},t}(),Ne=function(t){function e(e,r){var n=t.call(this,e)||this;return n.streamDependenceFlag=0,n.URLFlag=0,n.OCRStreamFlag=0,n.esId=r.read(2),n.esFlag=r.read(1),128&n.esFlag&&(n.streamDependenceFlag=r.read(2)),64&n.esFlag&&(n.URLFlag=r.read(1),r.skip(n.URLFlag)),32&n.esFlag&&(n.OCRStreamFlag=r.read(2)),n}return Oe(e,t),e}(Ce),Ie=function(t){function e(e,r){var n=t.call(this,e)||this;return n.mepg4Audio=r.read(1),n.audioStream=r.read(1),n.bufferSize=r.read(3),n.maxBitrate=r.read(4),n.avgBitrate=r.read(4),n}return Oe(e,t),e}(Ce),Le=function(t){function e(e,r){var n=t.call(this,e)||this,o=new d(r.read(2),16);return n.audioObjectType=o.read(5),n.samplingFrequencyIndex=o.read(4),n.channel=o.read(4),n.frameLengthFlag=o.read(1),n.dependsOnCoreCoder=o.read(1),n.extesionFlag=o.read(1),n}return Oe(e,t),e}(Ce),ke=function(t){function e(e,r){var n=t.call(this,e)||this;return n.esId=r.read(2),n}return Oe(e,t),e}(Ce),De=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Re=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.descriptors=[],n.audioObjectType=0,n.samplingFrequencyIndex=0,n.descriptors=Pe.extractDescriptors(r);var o=Ce.findDescriptor(n.descriptors,se.DCD),a=Ce.findDescriptor(n.descriptors,se.DSD);return a&&(n.audioObjectType=a.audioObjectType,n.samplingFrequencyIndex=a.samplingFrequencyIndex),n.codec=o&&a?"mp4a."+o.mepg4Audio.toString(16)+"."+a.audioObjectType.toString(16):"mp4a",n}return De(e,t),e}(ht),Ue=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xe=function(t){function e(e,r){var n=t.call(this,e,r)||this;for(n.compatibleBrands=[],n.majorBrand=String.fromCharCode(r.read(1),r.read(1),r.read(1),r.read(1)),n.minorVersion=r.read(4);r.unreadLength>=4;)n.compatibleBrands.push(String.fromCharCode(r.read(1),r.read(1),r.read(1),r.read(1)));return n}return Ue(e,t),e}(lt),Me=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Me(e,t),e}(ve),Ve=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ve(e,t),e}(ve),Fe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ze=function(t){function e(e,r){var n=t.call(this,e,r)||this;for(n.name="",n.version=r.read(1),n.flag=r.read(3),n.preDefined=String.fromCharCode(r.read(1),r.read(1),r.read(1),r.read(1)),n.handleType=String.fromCharCode(r.read(1),r.read(1),r.read(1),r.read(1)),r.skip(12);r.unreadLength>0;)n.name+=String.fromCharCode(r.read(1));return n}return Fe(e,t),e}(lt),Ge=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),He=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.data=r.readToUint8(e.size-e.length),n}return Ge(e,t),e}(lt),We=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xe=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.version=r.read(1),n.flag=r.read(3);var o=1===n.version;n.createTime=n.toStandardTime(r.read(o?8:4)),n.modifyTime=n.toStandardTime(r.read(o?8:4)),n.timeScale=r.read(4),n.duration=r.read(o?8:4);var a=r.read(2),i=function(t){return 96+(31&t)};return n.language=String.fromCharCode(i(a>>10),i(a>>5),i(a)),n.quality=Number(r.read(1)+"."+r.read(1)),n}return We(e,t),e}(lt),Ke=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ye=function(t){function e(e,r){var n=t.call(this,e,r)||this;return r.skip(6),n.dataReferenceIndex=r.read(2),r.skip(8),n.channelCount=r.read(2),n.sampleSize=r.read(2),r.skip(4),n.sampleRate=r.read(4)>>>16,n}return Ke(e,t),e}(he),Qe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$e=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.matrix=[],n.version=r.read(1),n.flag=r.read(3),n.createTime=n.toStandardTime(r.read(4)),n.modifyTime=n.toStandardTime(r.read(4)),n.timeScale=r.read(4),n.duration=r.read(4),n.rate=Number(r.read(2)+"."+r.read(2)),n.volume=Number(r.read(1)+"."+r.read(1)),r.skip(10);for(var o=0;o<9;o++)n.matrix.push(Number(r.read(2)+"."+r.read(2)));return r.skip(24),n.nextTrackId=r.read(4),n}return Qe(e,t),e}(lt),qe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ze=function(t){function e(e,r){var n=t.call(this,e,r)||this;for(n.data=[];r.unreadLength>0;)n.data.push(r.read(1));return n}return qe(e,t),e}(lt),Je=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.matrix=[],n.version=r.read(1),n.flag=r.read(3),n.createTime=n.toStandardTime(r.read(4)),n.modifyTime=n.toStandardTime(r.read(4)),n.trackId=r.read(4),r.skip(4),n.duration=r.read(4),r.skip(8),n.layer=r.read(2),n.alternateGroup=r.read(2),n.volume=Number(r.read(1)+"."+r.read(1)),r.skip(2);for(var o=0;o<9;o++)n.matrix.push(Number(r.read(2)+"."+r.read(2)));return n.width=Number(r.read(2)+"."+r.read(2)),n.height=Number(r.read(2)+"."+r.read(2)),n}return Je(e,t),e}(lt),er=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rr=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.version=r.read(1),n.flag=r.read(3),n}return er(e,t),e}(lt),nr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),or=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.version=r.read(1),n.flag=r.read(3),n.graphicsMode=r.read(2),n.opcolor=[r.read(2),r.read(2),r.read(2)],n}return nr(e,t),e}(lt),ar=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ar(e,t),e}(he),sr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ur=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sr(e,t),e}(he),cr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cr(e,t),e}(ht),fr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fr(e,t),e}(he),lr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.isLeadings=[],n.sampleDependsOns=[],n.sampleIsDependedOns=[],n.sampleHasRedundancys=[];for(var o=0,a=void 0;o<r.unreadLength;o++)a=new d(r.read(1),8),n.isLeadings[o]=a.read(2),n.sampleDependsOns[o]=a.read(2),n.sampleIsDependedOns[o]=a.read(2),n.sampleHasRedundancys[o]=a.read(2);return n}return lr(e,t),e}(ht),yr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.references=[],n.trackId=r.read(4),n.timescale=r.read(4),0===n.version?(n.pts=r.read(4),n.offset=r.read(4)):(n.pts=r.read(8),n.offset=r.read(8)),r.skip(2),n.references=[];for(var o=r.read(2),a=0;a<o;a++){var i=new d(r.read(4),32),s=r.read(4),u=new d(r.read(4),32);n.references.push({type:i.read(1),size:i.read(31),duration:s,startWithSap:u.read(1),sapType:u.read(3),sapDeltaTime:u.read(28)})}return n}return yr(e,t),e}(ht),_r=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mr=function(t){function e(e,r){var n=t.call(this,e,r)||this;return 1===n.version?n.baseMediaDecodeTime=r.read(8):n.baseMediaDecodeTime=r.read(4),n}return _r(e,t),e}(ht),gr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.BASE_DATA_OFFSET=1]="BASE_DATA_OFFSET",t[t.SAMPLE_DESC=2]="SAMPLE_DESC",t[t.SAMPLE_DUR=8]="SAMPLE_DUR",t[t.SAMPLE_SIZE=16]="SAMPLE_SIZE",t[t.SAMPLE_FLAG=32]="SAMPLE_FLAG",t[t.DUR_EMPTY=65536]="DUR_EMPTY",t[t.DEFAULT_BASE_IS_MOOF=131072]="DEFAULT_BASE_IS_MOOF"}(Ae||(Ae={}));var Tr,Sr=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.baseDataOffset=0,n.defaultSampleDescriptionIndex=0,n.defaultSampleDuration=0,n.defaultSampleSize=0,n.defaultSampleFlag=0,n.trackId=r.read(4),n.flag&Ae.BASE_DATA_OFFSET&&(n.baseDataOffset=r.read(8)),n.flag&Ae.SAMPLE_DESC&&(n.defaultSampleDescriptionIndex=r.read(4)),n.flag&Ae.SAMPLE_DUR&&(n.defaultSampleDuration=r.read(4)),n.flag&Ae.SAMPLE_SIZE&&(n.defaultSampleSize=r.read(4)),n.flag&Ae.SAMPLE_FLAG&&(n.defaultSampleFlag=r.read(4)),n}return gr(e,t),e}(ht),br=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Er=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.trackId=r.read(4),n.defaultSampleDescriptionIndex=r.read(4),n.defaultSampleDuration=r.read(4),n.defaultSampleSize=r.read(4),n.defaultSampleFlag=r.read(4),n}return br(e,t),e}(ht),wr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){t[t.DATA_OFFSET=1]="DATA_OFFSET",t[t.FIRST_FLAG=4]="FIRST_FLAG",t[t.DURATION=256]="DURATION",t[t.SIZE=512]="SIZE",t[t.FLAG=1024]="FLAG",t[t.CTS_OFFSET=2048]="CTS_OFFSET"}(Tr||(Tr={}));var Or,Ar=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.sampleDurations=[],n.sampleSizes=[],n.sampleFlags=[],n.sampleCTSs=[],n.sampleCount=r.read(4),n.flag&Tr.DATA_OFFSET?n.dataOffset=r.readInt(4):n.dataOffset=0,n.flag&Tr.FIRST_FLAG?n.firstSampleFlag=r.read(4):n.firstSampleFlag=0;for(var o=0;o<n.sampleCount;o++)n.flag&Tr.DURATION&&(n.sampleDurations[o]=r.read(4)),n.flag&Tr.SIZE&&(n.sampleSizes[o]=r.read(4)),n.flag&Tr.FLAG&&(n.sampleFlags[o]=r.read(4)),n.flag&Tr.CTS_OFFSET&&(0===n.version?n.sampleCTSs[o]=r.read(4):n.sampleCTSs[o]=r.readInt(4));return n}return wr(e,t),e}(ht),Pr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.sampleCounts=[],n.sampleOffsets=[],n.version=r.read(1),n.flag=r.read(3),n.entryCount=r.read(4);for(var o=0;o<n.entryCount;o++)n.sampleCounts.push(r.read(4)),n.sampleOffsets.push(r.readInt(4));return n}return Pr(e,t),e}(lt),Nr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ir=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.chunkOffsets=[],n.version=r.read(1),n.flag=r.read(3);for(var o=r.read(4),a=0;a<o;a++)n.chunkOffsets.push(r.read(4));return n}return Nr(e,t),e}(lt),Lr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.chunkOffsets=[],n.version=r.read(1),n.flag=r.read(3);for(var o=r.read(4),a=0;a<o;a++)n.chunkOffsets.push(r.read(8));return n}return Lr(e,t),e}(lt),Dr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.entries=[],n.version=r.read(1),n.flag=r.read(3);for(var o=r.read(4),a=0;a<o;a++)n.entries.push({firstChunk:r.read(4),samplePerChunk:r.read(4),sampleDescriptionIndex:r.read(4)});return n}return Dr(e,t),e}(lt),Ur=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xr=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.version=r.read(1),n.flag=r.read(3),n.entryCount=r.read(4),n}return Ur(e,t),e}(he),Mr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Br=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.sampleNumbers=[],n.version=r.read(1),n.flag=r.read(3);for(var o=r.read(4),a=0;a<o;a++)n.sampleNumbers.push(r.read(4));return n}return Mr(e,t),e}(he),Vr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.isContainer=!0,n.sampleSizes=[],n.version=r.read(1),n.flag=r.read(3),n.sampleSize=r.read(4);for(var o=r.read(4),a=0;a<o;a++)0===n.sampleSize?n.sampleSizes.push(r.read(4)):n.sampleSizes.push(n.sampleSize);return n}return Vr(e,t),e}(lt),Fr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zr=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.sampleCounts=[],n.sampleDurations=[],n.version=r.read(1),n.flag=r.read(3);for(var o=r.read(4),a=0;a<o;a++)n.sampleCounts[a]=r.read(4),n.sampleDurations[a]=r.read(4);return n}return Fr(e,t),e}(lt),Gr=function(){function t(t){this.tracks=[],this.options=t}return t.prototype.addTrack=function(t){this.tracks.push(t)},t.prototype.getTracks=function(){return this.tracks},t.prototype.getTrackById=function(t){return this.tracks.find((function(e){return e.options.id===t}))},t}(),Hr=function(){return Hr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Hr.apply(this,arguments)},Wr=function(){function t(t){this.samples=[],this.nextSampleIndex=0,this.duration=0,this.options=t}return t.prototype.getSamples=function(){return this.samples},t.prototype.getNextSampleOffset=function(){var t=this.samples[this.nextSampleIndex];return t?t.offset:0},t.prototype.addSample=function(t){this.samples.push(t),this.duration+=t.duration},t.prototype.processNextSample=function(t,e){void 0===e&&(e=0);var r=this.samples[this.nextSampleIndex];if(r)return this.processSample(t,e,r)},t.prototype.processSample=function(t,e,r){void 0===e&&(e=0);var n=e+t.byteLength,o=r.offset-e;if(o>=0&&r.offset+r.size<=n)return this.nextSampleIndex++,Hr(Hr({},r),{data:t.subarray(o,o+r.size)})},t.prototype.processSamples=function(t,e){void 0===e&&(e=0);for(var r=this.samples,n=[],o=this.nextSampleIndex,a=r.length;o<a;o++){var i=this.processSample(t,e,r[o]);if(!i)break;n.push(i)}return n},t.prototype.seek=function(t){for(var e,r=t*this.options.timeScale,n=-1,o=-1,a=0,i=this.samples.length;a<i;a++)if((e=this.samples[a]).isSync&&(o=a),e.dts+e.cts>=r){n=o;break}if(n>-1)return this.nextSampleIndex=n,this.samples[n]},t}(),Xr=function(){function t(){}return t.prototype.createMedia=function(t){return this._parseMoovJSON(t)},t.prototype._parseMoovJSON=function(t){var e=this,r=t.mvhd.box,n=new Gr({duration:r.duration,timeScale:r.timeScale,rate:r.rate,modifyTime:r.modifyTime,createTime:r.createTime});return t.trak&&[].concat(t.trak).forEach((function(r){var o,a=r.tkhd,i=r.mdia,s=i.mdhd,u=i.hdlr,c=i.minf.stbl,p=a.box,f=u.box,d=s.box,l=ut[f.handleType],h=e._buildSamples(c,l),y={id:p.trackId,name:f.name,handleType:f.handleType,type:l,createTime:p.createTime,modifyTime:p.modifyTime,layer:p.layer,volume:p.volume,matrix:p.matrix,duration:p.duration,width:p.width,height:p.height,timeScale:d.timeScale,language:d.language,quality:d.quality,defaultSampleDescriptionIndex:1,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlag:0},v=null===(o=t.mvex)||void 0===o?void 0:o.trex;v&&[].concat(v).forEach((function(t){var e=t.box;y.defaultSampleDescriptionIndex=e.defaultSampleDescriptionIndex,y.defaultSampleDuration=e.defaultSampleDuration,y.defaultSampleSize=e.defaultSampleSize,y.defaultSampleFlag=e.defaultSampleFlag}));var _=new Wr(y);h.forEach((function(t){return _.addSample(t)})),n.addTrack(_)})),n},t.prototype._buildSamples=function(t,e){var r=t.stts,n=t.stss,o=t.ctts,a=t.stsc,i=t.stsz||t.stz2;if(!i)return[];var s,u,c,p,f,d=t.stco||t.co64,l=a.box,h=null==n?void 0:n.box,y=r.box,v=null==o?void 0:o.box,_=-1,m=-1,g=-1,T=-1,S=0,b=[],E=i.box.sampleSizes;return E.forEach((function(t,r){var n={},o=l.entries;if(n.size=t,n.trackType=e,0===r?(u=1,s=0,n.chunkIndex=u,n.chunkRunIndex=s,f=o[s].samplePerChunk,p=0,c=s+1<o.length?o[s+1].firstChunk-1:1/0):r<f?(n.chunkIndex=u,n.chunkRunIndex=s):(u++,n.chunkIndex=u,p=0,u>c&&(s++,c=s+1<o.length?o[s+1].firstChunk-1:1/0),n.chunkRunIndex=s,f+=o[s].samplePerChunk),n.descriptionIndex=o[s].sampleDescriptionIndex-1,n.offset=d.box.chunkOffsets[n.chunkIndex-1]+p,p+=n.size,r>_&&(m++,_=Math.max(_,0),_+=y.sampleCounts[m]),r>0){var a=b[r-1];a.duration=y.sampleDurations[m],n.dts=b[r-1].dts+a.duration}else n.dts=0;v?(r>=g&&(T++,g=Math.max(g,0),g+=v.sampleCounts[T]),n.cts=v.sampleOffsets[T]):n.cts=0,h?r===h.sampleNumbers[S]-1?(n.isSync=!0,S++):n.isSync=!1:n.isSync=!0,n.isLast=r===E.length-1,b.push(n)})),b},t}(),Kr=function(t){return Array.isArray(t)?t:t?[t]:[]},Yr=function(){function t(){var t=this;this.options=null,this._getTrakById=function(e){var r;return null===(r=t.options)||void 0===r?void 0:r.media.getTracks().find((function(t){return t.options.id===e}))}}return t.prototype.init=function(t){this.options=t},t.prototype.parse=function(t){var e=this;Kr(t.traf).forEach((function(r){return e._buildSamples(r,t.box)}))},t.prototype._buildSamples=function(t,e){var r=t.tfhd.box,n=this._getTrakById(r.trackId);if(n){var o,a,i,s,u=n.options,c=t.tfdt.box,p=r.flag;o=p&Ae.SAMPLE_DESC?r.defaultSampleDescriptionIndex:u.defaultSampleDescriptionIndex,a=p&Ae.SAMPLE_DUR?r.defaultSampleDuration:u.defaultSampleDuration,i=p&Ae.SAMPLE_SIZE?r.defaultSampleSize:u.defaultSampleSize,s=p&Ae.SAMPLE_FLAG?r.defaultSampleFlag:u.defaultSampleFlag;for(var f=Kr(t.trun),d=u.id,l=u.type,h=p&Ae.BASE_DATA_OFFSET?r.baseDataOffset:p&Ae.DEFAULT_BASE_IS_MOOF?e.header.start:0,y=0,v=0;v<f.length;v++)for(var _=f[v].box,m=_.flag,g=_.dataOffset+h,T=0;T<_.sampleCount;T++){var S={};S.trackId=d,S.trackType=l,S.descriptionIndex=o,m&Tr.SIZE?S.size=_.sampleSizes[T]:S.size=i,m&Tr.DURATION?S.duration=_.sampleDurations[T]:S.duration=a,S.dts=y>0?y:c?c.baseMediaDecodeTime:0,y=S.dts+S.duration,m&Tr.CTS_OFFSET?S.cts=_.sampleCTSs[T]:S.cts=0;var b=s;m&Tr.FLAG?b=_.sampleFlags[T]:0===T&&m&Tr.FIRST_FLAG&&(b=_.firstSampleFlag),S.offset=g,S.flag=b,S.isSync=!(b&(st.IS_NON_SYNC|st.DEPENDS_YES)),S.isLeading=b>>26&3,S.dependsOn=b>>24&3,S.isDependedOn=b>>22&3,S.hasRedundancy=b>>20&3,S.degradationPriority=65535&b,g+=S.size,S.isLast=v===f.length-1&&T===_.sampleCount-1,n.addSample(S)}}},t.prototype.destroy=function(){this.options=null},t}(),Qr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$r=function(t){function r(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.media=null,r.unhandleBuffer=null,r.formatType=F.MP4,r.boxes=[],r._handleBoxLoad=function(t){var e,n,o=t.header.type;if("vvcC"===o)r.vvcCBox=t;else if("vvc1"===o||"vvi1"===o)r.vvcCBox&&(r.vvcCBox.codecTag=o);else if("hvcC"===o)r.hvcCBox=t;else if("hvc1"===o||"hev1"===o)r.hvcCBox&&(r.hvcCBox.codecTag=o);else if("avcC"===o)r.avcCBox=t;else if("esds"===o)r.esdsBox=t;else if("mp4a"===o)r.mp4aBox=t;else if("moov"===o){var a=lt.mapBoxToJSON(t);r.media=r.moovParser.createMedia(a),r.moofParser.init({media:r.media});var i=r.mp4aBox||{},s=i.sampleRate,u=void 0===s?0:s,c=i.sampleSize,p=void 0===c?0:c,f=i.channelCount,d=void 0===f?0:f,l=r.esdsBox||{},h=l.audioObjectType,y=void 0===h?0:h,v=l.samplingFrequencyIndex,_=void 0===v?0:v,m=l.codec,g=void 0===m?"":m,T=[],S=[],b=[];r.hvcCBox?(S=r.hvcCBox.vps,b=r.hvcCBox.pps,T=r.hvcCBox.sps):r.vvcCBox?(b=r.vvcCBox.pps,T=r.vvcCBox.sps,T=r.vvcCBox.sps):r.avcCBox&&(b=r.avcCBox.pps,T=r.avcCBox.sps);var E,w=r.options,O=w.live,A=w.progressive,P=(null===(e=r.avcCBox)||void 0===e?void 0:e.codec)||"";r.vvcCBox?(P=r.vvcCBox.codec,E=r.vvcCBox?r.vvcCBox.codecTag:void 0):r.hvcCBox&&(P=r.hvcCBox?r.hvcCBox.codec:(null===(n=r.avcCBox)||void 0===n?void 0:n.codec)||"",E=r.hvcCBox?r.hvcCBox.codecTag:void 0),r.metadata={formatType:F.MP4,live:!!O,progressive:!O&&!!A,url:r.loader.url,basePTS:0,baseDTS:0,duration:r.media.options.duration,timescale:r.media.options.timeScale,tracks:r.media.getTracks().map((function(t){var e,n={};switch(n.id=t.options.id,n.type=t.options.type,n.timescale=t.options.timeScale,n.baseDTS=0,n.basePTS=0,n.type){case z.VIDEO:n.width=t.options.width,n.height=t.options.height,n.vps=S,n.sps=T,n.pps=b,n.rotate=function(t){if(t.length<5)return 0;var e=Math.hypot(t[0],t[3]),r=Math.hypot(t[1],t[4]);return 0===e||0===r?0:180*Math.atan2(t[1]/r,t[0]/e)/Math.PI}(t.options.matrix),n.pixelRatio=[],n.codec=P,n.codecTag=E,n.fps=r.computeFps(t,null===(e=r.media)||void 0===e?void 0:e.options);break;case z.AUDIO:n.audioObjectType=y,n.sampleRate=u,n.samplingFrequencyIndex=_,n.sampleSize=p,n.channelCount=d,n.codec=g;break;default:n.type=z.UNKNOWN}return n}))},$.info("loadedmetadata metadata:",r.metadata),r.emit("loadedmetadata",r.metadata)}else"moof"===o&&($.info("检测到moof box被加载,当前素材为fMP4"),r.moofParser.parse(lt.mapBoxToJSON(t)))},r.computeFps=function(t,e){return e?t.getSamples().length/(e.duration/e.timeScale):0},r.convertSampleToPacket=function(t){if(t.trackType===z.VIDEO&&(r.hvcCBox||r.avcCBox||r.vvcCBox)){var e=t.data,n=t.isSync,o=r.hvcCBox||r.avcCBox||r.vvcCBox,a=o.lengthSizeMinusOne,i=o.codec,s=!1;r.vvcCBox&&e.length>4&&0===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&(s=!0);var u=[];u=s?l.extractAnnexbNAL(e):l.extractAVCCNAL(e,a);var c=!1;return r.hvcCBox&&(c=u.every((function(t){return S.isNonRef(t)}))),r.vvcCBox&&(c=u.every((function(t){E.isNonRef(t)}))),n&&(r.hvcCBox?(r.hvcCBox.pps.forEach((function(t){return u.unshift(t)})),r.hvcCBox.sps.forEach((function(t){return u.unshift(t)})),r.hvcCBox.vps.forEach((function(t){return u.unshift(t)}))):r.vvcCBox?(r.vvcCBox.pps.forEach((function(t){return u.unshift(t)})),r.vvcCBox.sps.forEach((function(t){return u.unshift(t)})),r.vvcCBox.vps.forEach((function(t){return u.unshift(t)}))):r.avcCBox&&(r.avcCBox.pps.forEach((function(t){return u.unshift(t)})),r.avcCBox.sps.forEach((function(t){return u.unshift(t)})))),{codec:i,trackId:t.trackId,trackType:t.trackType,isLast:t.isLast,dts:t.dts,pts:t.cts+t.dts,isSync:t.isSync,isNonRef:c,data:u,size:u.reduce((function(t,e){return t+e.byteLength}),0),offset:t.offset}}if(t.trackType===z.AUDIO&&r.esdsBox)return{codec:r.esdsBox.codec,trackId:t.trackId,trackType:t.trackType,dts:t.dts,pts:t.cts+t.dts,isLast:t.isLast,isSync:!0,isNonRef:!1,data:[t.data],size:t.data.byteLength,offset:t.offset}},r.options=e,r.moovParser=new Xr,r.moofParser=new Yr,e.sub||r.on("loadedbox",r._handleBoxLoad),r}return Qr(r,t),r.probe=function(t){if(t.byteLength<8)return!1;return"ftyp"===[t[4],t[5],t[6],t[7]].map((function(t){return String.fromCharCode(t)})).join("")},r.prototype.processPackets=function(t,e){var r=this,n=[];if(this.media&&t.byteLength){this.media.getTracks().forEach((function(o){o.processSamples(t,e).forEach((function(t){var e=r.convertSampleToPacket(t);e&&n.push(e)}))}));var o=this.getMinNextSampleOffset()-e;this.unhandleBuffer=o>=t.byteLength?null:t.slice(o).buffer}return n},r.prototype.seek=function(t){var e,r=this.options.progressive;this.unhandleBuffer=null,r&&this.loader.suspend(),null===(e=this.media)||void 0===e||e.getTracks().map((function(e){return e.seek(t)})),r&&this.loader.loadRange(this.getMinNextSampleOffset())},r.prototype.onProgress=function(t){var e=t.data,r=t.offset;if(e.length&&(this.unhandleBuffer&&(e=o.concatUint8(new Uint8Array(this.unhandleBuffer),e),r-=this.unhandleBuffer.byteLength,this.unhandleBuffer=null),this.metadata||this.parse(new o(e.buffer,0),r),this.metadata)){var n=this.processPackets(e,r);n.length&&this.emit("loadeddata",{packets:n})}},r.prototype.onLoadEnd=function(){this.loader.eof&&this.emit("end",void 0)},r.prototype.getMinNextSampleOffset=function(){return this.media?Math.min.apply(Math,this.media.getTracks().map((function(t){return t.getNextSampleOffset()}))):0},r.prototype.parse=function(t,n){var a,i=this;void 0===n&&(n=0);for(var s=t.offset,u=0,c=function(){u=t.offset-s;var c=new ct(t,n+u);if(0===c.size){var f=new Error("box [".concat(c.type,"] size 为 0"));return $.error(f),p.emit("error",{code:x.PARSER,message:f.message,origin:f}),"break"}if(p.options.progressive&&"mdat"===c.type&&!p.metadata){var d=c.start+c.size;return p.loader.suspend(),p.unhandleBuffer=null,$.info("检测到mdat box在moov box之后,跳转moov起始偏移位"),p.loader.loadRange(d).then((function(t){t&&(i.unhandleBuffer=null,i.loader.jump(c.start),i.loader.status!==St.SUSPENGING&&i.loader.loadRange(c.start,d))})),{value:void 0}}var l=c.size-c.length;if(!(t.unreadLength>=l))return t.back(c.length),"break";var h=e[c.type];if(h){var y=new o(t.buffer,t.offset,l);if((a=new h(c,y)).isContainer){var v=new r({sub:!0});v.proxy(p,["loadedbox"]),v.parse(y,u+n+c.length),v.removeAllListeners(),v.boxes.forEach((function(t){a.append(t)}))}}else a=new lt(c);t.skip(l),p.boxes.push(a),p.emit("loadedbox",a)},p=this;t.unreadLength>=8;){var f=c();if("object"==typeof f)return f.value;if("break"===f)break}t.unreadLength&&(this.unhandleBuffer=t.readToBuffer())},r.prototype.reset=function(){t.prototype.reset.call(this),this.boxes=[],this.unhandleBuffer=null,this.avcCBox=void 0,this.hvcCBox=void 0,this.mp4aBox=void 0,this.media=null,this.moofParser.destroy()},r}(Rt);!function(t){t[t.H264=27]="H264",t[t.H265=36]="H265",t[t.H266=51]="H266",t[t.AAC=15]="AAC"}(Or||(Or={}));var qr,Zr={1:z.VIDEO,2:z.VIDEO,3:z.AUDIO,4:z.AUDIO,5:z.UNKNOWN,6:z.UNKNOWN,7:z.UNKNOWN,8:z.UNKNOWN,9:z.UNKNOWN,10:z.UNKNOWN,11:z.UNKNOWN,12:z.UNKNOWN,13:z.UNKNOWN,14:z.UNKNOWN,15:z.AUDIO,16:z.VIDEO,17:z.AUDIO,18:z.UNKNOWN,19:z.UNKNOWN,20:z.UNKNOWN,21:z.UNKNOWN,22:z.UNKNOWN,23:z.UNKNOWN,24:z.UNKNOWN,25:z.UNKNOWN,26:z.UNKNOWN,27:z.VIDEO,28:z.AUDIO,29:z.UNKNOWN,30:z.VIDEO,31:z.UNKNOWN,32:z.UNKNOWN,33:z.VIDEO,36:z.VIDEO,51:z.VIDEO,66:z.UNKNOWN,127:z.UNKNOWN,128:z.AUDIO,129:z.AUDIO,130:z.AUDIO,131:z.AUDIO,132:z.AUDIO,133:z.AUDIO,134:z.AUDIO,135:z.AUDIO,144:z.UNKNOWN,145:z.UNKNOWN,192:z.UNKNOWN,193:z.AUDIO,194:z.AUDIO,207:z.UNKNOWN,209:z.VIDEO,210:z.VIDEO,219:z.UNKNOWN,234:z.VIDEO};!function(t){t[t.NETWORK=0]="NETWORK",t[t.MAP_PID=1]="MAP_PID"}(qr||(qr={}));var Jr,tn=function(t){this.programs=[],this.tableId=t.read(1);var e=new d(t.read(2),16);this.sectionSyntaxIndicator=e.read(1),e.skip(1),e.skip(2),this.sectionLength=e.read(12),this.transportStreamId=t.read(2);var r=new d(t.read(1),8);r.skip(2),this.versionNumber=r.read(5),this.currentNextIndicator=r.read(1),this.sectionNumber=t.read(1),this.lastSectionNumber=t.read(1);for(var n=0;n<this.sectionLength-12;n+=4)this.programs.push({number:t.read(2),pid:8191&t.read(2)});this.crc32=t.read(4)},en=function(t){this.streamId=t.read(1),this.pesPacketLength=t.read(2);var e=new d(t.read(2),16);e.skip(2),this.pesScramblingControl=e.read(2),this.pesPriority=e.read(1),this.dataAlignmentIndicator=e.read(1),this.copyright=e.read(1),this.originalOrCopy=e.read(1),this.ptsDtsFlags=e.read(2),this.esCRFlag=e.read(1),this.esRateFlag=e.read(1),this.dsmTrickModeFlag=e.read(1),this.additionalCopyInfoFlag=e.read(1),this.pesCRCFlag=e.read(1),this.pesExtensionFlag=e.read(1),this.pesHeaderDataLength=t.read(1);var r=t.offset;2&this.ptsDtsFlags?(this.pts=(14&t.read(1))<<27|t.read(2)>>>1<<13|t.read(2)>>>3,this.pts*=4,t.back(1),this.pts+=(6&t.read(1))>>>1,1&this.ptsDtsFlags?(this.dts=(14&t.read(1))<<27|t.read(2)>>>1<<13|t.read(2)>>>3,this.dts*=4,t.back(1),this.dts+=(6&t.read(1))>>>1):this.dts=this.pts):(this.pts=0,this.dts=0);var n=this.pesHeaderDataLength-(t.offset-r);n>0&&t.skip(n),this.data=t.readToUint8()},rn=function(t){this.streams=[],this.tableId=t.read(1);var e=new d(t.read(2),16);this.sectionSyntaxIndicator=e.read(1),e.skip(1),e.skip(2),this.sectionLength=e.read(12),this.programNumber=t.read(2);var r=new d(t.read(1),8);r.skip(2),this.versionNumber=r.read(5),this.currentNextIndicator=r.read(1),this.sectionNumber=t.read(1),this.lastSectionNumber=t.read(1),this.pcrPid=8191&t.read(2),this.programInfoLength=4095&t.read(2);for(var n=12+this.programInfoLength;n<=this.sectionLength-2;n+=5){var o={streamType:t.read(1),pid:8191&t.read(2),esInfoLength:4095&t.read(2)};this.streams.push(o),t.skip(o.esInfoLength),n+=o.esInfoLength}this.crc32=t.read(4)};!function(t){t[t.PAT=0]="PAT",t[t.CAT=1]="CAT",t[t.TSDT=2]="TSDT"}(Jr||(Jr={}));var nn,on=function(){function t(t){var e=new d(t.read(4),32);if(this.syncByte=e.read(8),this.errorIndicator=e.read(1),this.payloadUnitStartIndicator=e.read(1),this.transportPriority=e.read(1),this.pid=e.read(13),this.transportScramblingControl=e.read(2),this.adaptationFlag=e.read(1),this.payloadFlag=e.read(1),this.continueCounter=e.read(4),this.adaptationFlag){var r=t.read(1);t.skip(r)}this.payloadUnitStartIndicator&&t.skip(1)}return t.SYNC_BYTE=71,t}(),an=r(378),sn=r.n(an),un=(Object.freeze({formatType:F.UNKNOWN,live:!1,progressive:!1,url:"",basePTS:0,baseDTS:0,timescale:0,duration:0,tracks:[]}),Object.freeze({type:z.VIDEO,id:0,baseDTS:0,basePTS:0,timescale:1e3,codec:"",width:0,height:0,vps:[],pps:[],sps:[],sei:[],pixelRatio:[],fps:25,live:!1})),cn=Object.freeze({type:z.AUDIO,id:1,baseDTS:0,basePTS:0,timescale:1e3,codec:"",audioObjectType:2,samplingFrequencyIndex:0,sampleRate:0,sampleSize:16,channelCount:0}),pn=function(){function t(){this.list=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.list.length},enumerable:!1,configurable:!0}),t.prototype.write=function(t){this.list.push(t)},t.prototype.read=function(){return this.list.shift()},t.prototype.readAll=function(){var t=this.list;return this.list=[],t},t.prototype.clear=function(){this.list=[]},t}(),fn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dn=188;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.PAT=1]="PAT",t[t.PES=2]="PES",t[t.PMT=3]="PMT"}(nn||(nn={}));var ln=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.patPrograms=[],e.pmtStreams=[],e.prevPesSegments=[],e.packetQueue=new pn,e.audioLoaded=!1,e.videoLoaded=!1,e.metadataChanged=!1,e.metadata=null,e.formatType=F.MPEGTS,e}return fn(e,t),e.probe=function(t){if(t.byteLength<1)return!1;for(var e=0,r=t.byteLength;e<r;e+=dn)if(t[e]!==on.SYNC_BYTE)return!1;return!0},e.prototype.splitToTsPacket=function(t){var e=t;this.unhandleBuffer&&this.unhandleBuffer.byteLength&&(e=o.concat(this.unhandleBuffer,e),this.unhandleBuffer=void 0);for(var r=new Uint8Array(e),n=r.byteLength,a=0;a+dn<=n;){if(r[a]!==on.SYNC_BYTE){var i=new Uint8Array(r.buffer,a).findIndex((function(t){return t===on.SYNC_BYTE}));if(console.warn("[videox] mpegts sync byte error",r[a],a,i),i>-1){a+=i;continue}break}this.parseTsPacket(r.subarray(a,a+dn)),a+=dn}a<n&&(this.unhandleBuffer=e.slice(a))},e.prototype.parseTsPacket=function(t){var e=o.fromUint8(t),r=new on(e),n=null;if(r.pid===Jr.PAT)n=new tn(e),this.patPrograms=n.programs,this.emitTSPacket(nn.PAT,r,n);else if(this.patPrograms.some((function(t){return t.pid===r.pid}))){n=new rn(e);var a=O()(this.pmtStreams,n.streams);a&&this.emitPackets(),this.metadataChanged=a,this.pmtStreams=n.streams,this.emitTSPacket(nn.PMT,r,n)}else{var i=this.pmtStreams.find((function(t){return t.pid===r.pid}));i?(r.payloadUnitStartIndicator&&this.parsePes(),this.prevPesSegments.push(e.readToUint8()),this.prevPesTSHeader=r,this.prevPmtStream=i):this.emitTSPacket(nn.UNKNOWN,r,n)}},e.prototype.parsePes=function(){var t=this.prevPmtStream;if(this.prevPesSegments.length&&this.prevPesTSHeader&&t){var e=o.fromUint8(o.concatUint8s(this.prevPesSegments));if(this.prevPesSegments=[],1===e.read(2)){var r=new en(e);this.emitTSPacket(nn.PES,this.prevPesTSHeader,r),t.streamType===Or.H265||t.streamType===Or.H266||t.streamType===Or.H264?this.parseVideoPes(r,t):t.streamType===Or.AAC&&this.parseAudioPes(r,t)}}},e.prototype.parseVideoPes=function(t,e){var r=Math.round(t.dts/90),n=Math.round(t.pts/90),a=e.streamType===Or.H265,i=e.streamType===Or.H266,s={},u=!0,c=!1,p=[],f=[],d=[],h=[],v=l.extractAnnexbNAL(t.data);if(i){var g=[];v.forEach((function(t){var e=o.fromUint8(t);if(t.length<4)console.log("skip this too small nalu:",t);else{var r=new E(e);if(r.nalType<T.VVC_AUD_NUT){if(r.nalType===T.VVC_SPS_NUT){c=!0;var n=new it(gt(e.readToUint8()));s.width=n.width,s.height=n.height,s.codec=n.codec,f.push(t)}else r.nalType===T.VVC_VPS_NUT?d.push(t):r.nalType===T.VVC_PPS_NUT&&h.push(t);u=E.isNonRefNALType(r.nalType)&&u,g.push(E.createAnnexbStartCode(),t)}}}));var b=o.concatUint8s(g);p.push(b)}else v.forEach((function(t){var e=o.fromUint8(t);if(!(t.length<2))if(a){if((n=new S(e)).nalType<_.ACCESS_UNIT_DELIMITER){if(n.nalType>=_.VPS)if(n.nalType===_.SPS){c=!0;var r=new at(gt(e.readToUint8()));s.width=r.width,s.height=r.height,s.pixelRatio=r.pixelRatio,s.codec=r.codec,f.push(t)}else n.nalType===_.VPS?d.push(t):n.nalType===_.PPS&&h.push(t);ee.isSafari?n.nalType===_.TRAIL_R||n.nalType===_.TRAIL_N||n.nalType===_.IDR_W_RADL||n.nalType===_.IDR_N_LP||n.nalType===_.CRA||n.nalType===_.SPS||n.nalType===_.VPS||n.nalType===_.PPS||n.nalType===_.SEI?p.push(t):console.warn("skip this nalu nalType:",n.nalType):p.push(t),u=S.isNonRefNALType(n.nalType)&&u}}else{var n;if((n=new m(e)).nalType<y.DIVIDER){if(n.nalType===y.SPS){c=!0;r=new tt(gt(e.readToUint8()));s.width=r.width,s.height=r.height,s.pixelRatio=r.pixelRatio,s.codec=r.codec,f.push(t)}else n.nalType===y.PPS&&h.push(t);p.push(t)}u=!1}}));if(!this.videoLoaded){if(!c)return;this.videoLoaded=!0,s.baseDTS=r,s.basePTS=n}d.length&&(s.vps=d),f.length&&(s.sps=f),h.length&&(s.pps=h),this.videoMetadata?(this.metadataChanged=A(this.videoMetadata,s),this.metadataChanged&&this.emit("updatedtrackmetadata",this.videoMetadata)):(this.videoMetadata=sn()({},un,s),this.metadataChanged=!0),this.checkMetadataChanged(),this.packetQueue.write({trackId:e.pid,codec:this.videoMetadata.codec,trackType:z.VIDEO,isSync:c,isNonRef:u,data:p,dts:r,pts:n,size:p.reduce((function(t,e){return t+e.byteLength}),0)})},e.prototype.parseAudioPes=function(t,e){var r=this,n={},o=Math.round(t.dts/90),a=Math.round(t.pts/90);this.audioLoaded||(this.audioLoaded=!0,n.baseDTS=o,n.basePTS=a);var s=f(t.data);if(s.length){var u=s[0],c="mp4a.40."+u.audioObjectType;n.codec=c,n.audioObjectType=u.audioObjectType,n.sampleRate=u.sampleRate,n.channelCount=u.channelCount,this.audioMetadata?(this.metadataChanged=A(this.audioMetadata,n),this.metadataChanged&&this.emit("updatedtrackmetadata",this.audioMetadata)):(this.audioMetadata=sn()({},cn,n),this.metadataChanged=!0),this.checkMetadataChanged();var p=Math.round(9e4*i/u.sampleRate/90);s.forEach((function(t,n){r.packetQueue.write({trackId:e.pid,codec:c,trackType:z.AUDIO,isSync:!0,isNonRef:!0,data:[t.data],dts:p*n+o,pts:p*n+a,size:t.data.byteLength})}))}},e.prototype.checkMetadataChanged=function(){var t=this;if(this.pmtStreams.length&&this.metadataChanged){var e=[];if(this.pmtStreams.every((function(r){var n=Zr[r.streamType];return n===z.VIDEO?(t.videoMetadata&&e.push(t.videoMetadata),!(!t.videoMetadata||!t.videoMetadata.codec)):n!==z.AUDIO||(t.audioMetadata&&e.push(t.audioMetadata),!(!t.audioMetadata||!t.audioMetadata.codec))}))){var r={formatType:F.MPEGTS,live:!1,progressive:!!this.options.progressive,url:this.loader.url,basePTS:Math.min.apply(Math,e.map((function(t){return t.basePTS||0}))),baseDTS:Math.min.apply(Math,e.map((function(t){return t.baseDTS||0}))),timescale:1e3,duration:0,tracks:e};this.metadataChanged=!1,this.metadata?A(this.metadata,r)&&this.emit("updatedmetadata",this.metadata):(this.metadata=r,this.emit("loadedmetadata",this.metadata))}}return this.metadataChanged},e.prototype.emitTSPacket=function(t,e,r){$.debug("loadedtspacket","type:",nn[t],"header:",e,"payload:",r),this.emit("loadedtspacket",{type:t,header:e,payload:r})},e.prototype.emitPackets=function(){if(this.metadata&&this.loader.status!==St.SUSPENGING&&!this.metadataChanged&&this.packetQueue.size>0){var t=this.packetQueue.readAll();this.emit("loadeddata",{packets:t})}},e.prototype.continuousLoad=function(t){return this.loader.load(t)},e.prototype.parse=function(t){this.splitToTsPacket(t),this.emitPackets()},e.prototype.onProgress=function(t){t.data.byteLength&&this.parse(t.data.buffer)},e.prototype.onLoadEnd=function(){this.parsePes(),this.emitPackets(),this.loader.eof&&this.emit("end",void 0)},e.prototype.resume=function(){return this.options.progressive?t.prototype.resume.call(this):Promise.resolve(!1)},e.prototype.flush=function(){this.unhandleBuffer=void 0,this.prevPesTSHeader=void 0,this.prevPmtStream=void 0,this.prevPesSegments=[]},e.prototype.seek=function(){this.reset(),this.loader.jump(0)},e.prototype.reset=function(){t.prototype.reset.call(this),this.flush(),this.audioLoaded=!1,this.videoLoaded=!1,this.packetQueue.clear(),this.patPrograms=[],this.pmtStreams=[],this.metadata=null,this.audioMetadata=void 0,this.videoMetadata=void 0,this.metadataChanged=!1},e}(Rt),hn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yn=function(){return yn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yn.apply(this,arguments)},vn={M3U:/^#EXTM3U/,INF:/^#EXTINF:?([0-9\.]*)?,?(.*)?(?:\n|\r\n)(.*)$/,X_TARGETDURATION:/^#EXT-X-TARGETDURATION:?([0-9.]*)?/,X_VERSION:/^#EXT-X-VERSION:?([0-9.]*)?/,X_MEDIA_SEQUENCE:/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/,X_DISCONTINUITY_SEQUENCE:/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/,X_PLAYLIST_TYPE:/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/,X_BYTERANGE:/^#EXT-X-BYTERANGE:?(.*)?$/,X_ALLOW_CACHE:/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/,X_MAP:/^#EXT-X-MAP:?(.*)$/,X_STREAM_INF:/^#EXT-X-STREAM-INF:?(.*)$/,X_MEDIA:/^#EXT-X-MEDIA:?(.*)$/,X_ENDLIST:/^#EXT-X-ENDLIST/,X_DISCONTINUITY:/^#EXT-X-DISCONTINUITY/,X_PROGRAM_DATE_TIME:/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/,X_KEY:/^#EXT-X-KEY:?(.*)$/,X_START:/^#EXT-X-START:?(.*)$/,X_CUE_OUT_CONT:/^#EXT-X-CUE-OUT-CONT:?(.*)?$/,X_CUE_OUT:/^#EXT-X-CUE-OUT:?(.*)?$/,X_CUE_IN:/^#EXT-X-CUE-IN:?(.*)?$/,X_SKIP:/^#EXT-X-SKIP:(.*)$/,X_PART:/^#EXT-X-PART:(.*)$/,X_SERVER_CONTROL:/^#EXT-X-SERVER-CONTROL:(.*)$/,X_PART_INF:/^#EXT-X-PART-INF:(.*)$/,X_PRELOAD_HINT:/^#EXT-X-PRELOAD-HINT:(.*)$/,X_RENDITION_REPORT:/^#EXT-X-RENDITION-REPORT:(.*)$/},_n=function(t){function e(e){var r=t.call(this,e)||this;return r.mpegtsParser=new ln({progressive:!0,timeout:r.options.timeout}),r.currSegmentIndex=0,r.isLive=!1,r.shouldContinuousLoad=!0,r.ended=!1,r.prevManifestLoadedTime=0,r.fetchTimer=-1,r.discontinuity=!1,r.m3u8UpdateDuration=2,r.bufferSegments=[],r.cachePackets=[],r.formatType=F.HLS,r.segments=[],r.handleTSEnd=function(){r.currSegmentIndex>=r.segments.length-1&&r.emit("end",void 0)},r.handleTSLoadedMetadata=function(t){void 0===r.basePTS&&(r.basePTS=t.basePTS),void 0===r.baseDTS&&(r.baseDTS=t.baseDTS);var e=yn(yn({},t),{formatType:F.HLS,live:r.isLive,progressive:!0,basePTS:r.basePTS,baseDTS:r.baseDTS,duration:r.duration,url:r.loader.url,discontinuity:r.discontinuity});r.metadata?A(r.metadata,e)&&r.emit("updatedmetadata",r.metadata):(r.metadata=e,r.emit("loadedmetadata",r.metadata))},r.handleTSLoadedData=function(t){var e,n=t.packets;if(n.length){if(null===(e=r.currentSegment)||void 0===e?void 0:e.discontinuity){var o=n.slice().sort((function(t,e){return t.pts-e.pts}));void 0===r.currSegmentStartPTS&&(r.currSegmentStartPTS=o[0].pts);var a=r.currSegmentStartPTS,i=Math.round(1e3*r.prevSegmentsTotalDuration)+(r.basePTS||0);o.forEach((function(t){var e=t.dts-t.pts;t.pts=i+t.pts-a,t.dts=t.pts+e}))}var s;r.cachePackets.length?(s=r.cachePackets.concat(n),r.cachePackets=[]):s=n,r.shouldContinuousLoad?r.emit("loadeddata",{packets:s}):r.cachePackets=s}},r.handleTSLoadEnd=function(){r.currSegmentIndex++,r.loadSegment()},r.mpegtsParser.on("loadedmetadata",r.handleTSLoadedMetadata),r.mpegtsParser.on("updatedmetadata",r.handleTSLoadedMetadata),r.mpegtsParser.on("loadeddata",r.handleTSLoadedData),r.mpegtsParser.on("end",r.handleTSEnd),r.mpegtsParser.loader.on("loadend",r.handleTSLoadEnd),r.mpegtsParser.loader.proxy(r,["error"]),r.mpegtsParser.proxy(r,["updatedtrackmetadata"]),r}return hn(e,t),e.probe=function(t){if(t.byteLength>=7){var e=[];return t.forEach((function(t){return e.push(String.fromCharCode(t))})),vn.M3U.test(e.join(""))}return!1},Object.defineProperty(e.prototype,"status",{get:function(){return this.loader.eof?this.mpegtsParser.status===St.IDLE?this.shouldContinuousLoad?St.LOADING:St.SUSPENGING:this.mpegtsParser.status:this.loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.isLive?1/0:Math.round(1e3*this.segments.reduce((function(t,e){return t+e.duration}),0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSegment",{get:function(){return this.segments[this.currSegmentIndex]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevSegmentsTotalDuration",{get:function(){return this.segments.slice(0,this.currSegmentIndex).reduce((function(t,e){return t+e.duration}),0)},enumerable:!1,configurable:!0}),e.prototype.insertSegment=function(t){var e=!this.segments.some((function(e){return e.uri===t.uri}));return e&&this.segments.push(t),e},e.prototype.onProgress=function(t){this.bufferSegments.push(t)},e.prototype.onLoadEnd=function(){var t=this;if(this.loader.eof){var e=o.concatUint8s(this.bufferSegments.map((function(t){return t.data})));if(this.bufferSegments=[],e.byteLength){var r,n=(new TextDecoder).decode(e).split(/\n#/).map((function(t){return"#"+t.trim()})),a=0,i=!1,s=!1;n.forEach((function(e){var n=e.match(vn.INF);if(n){var o={sequence:a,duration:parseFloat(n[1]),uri:new URL(n[3],t.url).href,discontinuity:s};t.insertSegment(o),t.emit("loadedsegment",o)}else(r=e.match(vn.X_MEDIA_SEQUENCE))?a=Number(r[1]):vn.X_ENDLIST.test(e)?i=!0:vn.X_DISCONTINUITY.test(e)&&(s=!0)})),this.discontinuity=s,this.isLive=!i,this.segments.length||this.emit("error",{code:x.PARSER,message:"M3U8文件无TS数据"}),this.prevManifestLoadedTime=Date.now(),this.loadSegment()}$.info("hls manifest loaded, all segments length:",this.segments.length)}},e.prototype.loadSegment=function(){var t=this;if(!this.shouldContinuousLoad)return Promise.resolve(!1);var e=this.segments[this.currSegmentIndex];if(this.isLive&&!e){var r=1e3*this.m3u8UpdateDuration-(Date.now()-this.prevManifestLoadedTime);return r<=0?this.loader.load(this.loader.url):new Promise((function(e){clearTimeout(t.fetchTimer),t.fetchTimer=setTimeout((function(){e(t.loader.load(t.loader.url))}),r)}))}return e?(this.cachePackets=[],this.m3u8UpdateDuration=e.duration||2,this.currSegmentStartPTS=void 0,this.mpegtsParser.continuousLoad(e.uri)):(this.ended=!0,Promise.resolve(!1))},e.prototype.suspend=function(){clearTimeout(this.fetchTimer),this.shouldContinuousLoad=!1},e.prototype.resume=function(){if(this.cachePackets.length){var e=this.cachePackets;return this.cachePackets=[],this.emit("loadeddata",{packets:e}),Promise.resolve(!1)}return this.shouldContinuousLoad||this.ended?Promise.resolve(!1):(this.shouldContinuousLoad=!0,this.loader.eof?this.mpegtsParser.loader.status===St.LOADING||this.mpegtsParser.loader.status===St.ERROR?Promise.resolve(!0):this.loadSegment():t.prototype.resume.call(this))},e.prototype.seek=function(t){this.ended=!1;var e=0,r=this.segments.findIndex((function(r){return e+=r.duration,t<e}));this.currSegmentIndex=r>-1?r:this.segments.length-1,this.cachePackets=[],this.bufferSegments=[],this.mpegtsParser.suspend(),this.mpegtsParser.flush(),this.shouldContinuousLoad=!0,this.loadSegment()},e.prototype.reset=function(){clearTimeout(this.fetchTimer),t.prototype.reset.call(this),this.discontinuity=!1,this.cachePackets=[],this.bufferSegments=[],this.shouldContinuousLoad=!0,this.mpegtsParser.reset(),this.segments=[],this.currSegmentIndex=0,this.isLive=!1,this.ended=!1},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.mpegtsParser.loader.removeAllListeners(),this.mpegtsParser.destroy()},e}(Rt),mn=r(801),gn=r.n(mn),Tn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sn=function(){return Sn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Sn.apply(this,arguments)},bn=["loadedmetadata","updatedmetadata","updatedtrackmetadata","loadeddata","error","end"],En=[$r,_n,de,ln],wn=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.loader=new kt,r.parserClasses=En,r.logger=$,r.handleFirstLoadData=function(t){if(t){var e=r.parserClasses.find((function(e){return e.probe(t.data)}));if(e){var n=r.activeParser.formatType;r.activeParser.destroy(),r.activeParser=r.createParser(e),$.info("切换parser, ".concat(F[n]," -> ").concat(F[r.activeParser.formatType])),r.emit("parserchange",void 0),r.activeParser.onProgress(t)}else{var o="未找到对应的Parser, Byte数据: "+t.data.slice(0,20).join(",");$.error(o),r.emit("error",{code:x.PARSER,message:o})}}},r.options=e,r.loader=r.createLoader(),r.activeParser=r.createParser(r.parserClasses[0]),r.logger.info("demuxer options",e),r}return Tn(e,t),e.prototype.createLoader=function(){var t=new kt(this.options);return t.proxy(this,["progress","error"]),t.proxyOnce(this,["loadstart","loadend"]),t.once("progress",this.handleFirstLoadData),t},e.prototype.createParser=function(t){var e=new t(Sn(Sn({},this.options),{loader:this.loader}));return e.proxy(this,bn),e},Object.defineProperty(e.prototype,"skipFrame",{get:function(){return this.activeParser.skipFrame},set:function(t){$.info("设置skipFrame:",t),gn()(t)||(this.options.skipFrame=t,this.activeParser.skipFrame=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.activeParser.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.loader.url},enumerable:!1,configurable:!0}),e.prototype.parse=function(t){$.info("执行parse"),this.loader.reset(),this.handleFirstLoadData({offset:0,data:t}),this.activeParser.onLoadEnd()},e.prototype.load=function(t){return $.info("执行load",t),this.loader.destroy(),this.loader=this.createLoader(),this.loader.load(t)},e.prototype.seek=function(t){return $.info("执行seek",t),this.activeParser.seek(t)},e.prototype.suspend=function(){return this.activeParser.suspend()},e.prototype.resume=function(){return this.activeParser.resume()},e.prototype.destroy=function(){$.info("执行destory"),this.loader.destroy(),this.activeParser.destroy(),this.removeAllListeners()},e}(Tt),On=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))},An=function(t){return t.split("").map((function(t){return t.charCodeAt(0)}))};const Pn=function(){function t(){}return t.prototype.create=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=new Uint8Array(8),a=[n].concat(e.map((function(t){return new Uint8Array(t)}))),i=a.reduce((function(t,e){return t+e.byteLength}),0),s=new o(n.buffer);return s.write(4,i),An(t).forEach((function(t){return s.write(1,t)})),o.concatUint8s(a)},t.prototype.avc1=function(t){var e=t.pixelRatio,r=t.vps,n=new ArrayBuffer(78),a=new o(n);a.write(4,0),a.write(2,0),a.write(2,1),a.write(4,0),a.write(4,0),a.write(4,0),a.write(4,0),a.write(2,t.width),a.write(2,t.height),a.write(4,4718592),a.write(4,4718592),a.write(4,0),a.write(2,1);var i="@ali/splayer";a.write(1,12),An(i).forEach((function(t){return a.write(1,t)})),a.skip(19),a.write(2,24),a.write(2,65535);var s=2===e.length?this.pasp(e[0],e[1]):[];return r.length?this.create("hvc1",n,this.hvcC(t),s):this.create("avc1",n,this.avcC(t),s)},t.prototype.avcC=function(t){var e=t.sps,r=t.pps,n=[],a=[];n.push(e.length),e.forEach((function(t){n.push(t.byteLength>>>8&255),n.push(255&t.byteLength),t.forEach((function(t){return n.push(t)}))})),a.push(r.length),r.forEach((function(t){a.push(t.byteLength>>>8&255),a.push(255&t.byteLength),t.forEach((function(t){return a.push(t)}))}));var i=new ArrayBuffer(5),s=new o(i);return s.write(1,1),s.write(1,n[4]||0),s.write(1,n[5]||0),s.write(1,n[6]||0),s.write(1,255),this.create("avcC",i,n,a)},t.prototype.btrt=function(){var t=new ArrayBuffer(12),e=new o(t);return e.write(4,1875072),e.write(4,3e6),e.write(4,3e6),this.create("btrt",t)},t.prototype.pasp=function(t,e){var r=new ArrayBuffer(8),n=new o(r);return n.write(4,t),n.write(4,e),this.create("pasp",r)},t.prototype.dinf=function(){return this.create("dinf",this.dref())},t.prototype.dref=function(){var t=new ArrayBuffer(8),e=new o(t);return e.write(4,0),e.write(4,1),this.create("dref",t,this.url())},t.prototype.esds=function(t){var e=t.audioObjectType,r=t.sampleRate,n=t.channelCount,i=new ArrayBuffer(33),s=new o(i),u=e>=5;s.write(4,0),s.write(1,3),s.write(1,u?27:25),s.write(2,1),s.write(1,0),s.write(1,4),s.write(1,u?19:17),s.write(1,64),s.write(1,21),s.write(3,0),s.write(4,0),s.write(4,0),s.write(1,5),s.write(1,u?4:2);var c=a.findIndex((function(t){return r===t}));if(s.write(1,e<<3|(14&c)>>1),u){var p=c;s.write(1,(1&c)<<7|n<<3|(14&p)>>1),s.write(1,(1&p)<<7|8),s.write(1,0)}else s.write(1,(1&c)<<7|n<<3);return s.back(4),s.skip(4),s.write(1,6),s.write(1,1),s.write(1,2),this.create("esds",i)},t.prototype.ftyp=function(){var t=new ArrayBuffer(16),e=new o(t);return An("isom").forEach((function(t){return e.write(1,t)})),e.write(4,1),An("isom").forEach((function(t){return e.write(1,t)})),An("avc1").forEach((function(t){return e.write(1,t)})),this.create("ftyp",t)},t.prototype.hdlr=function(t){var e=new ArrayBuffer(37),r=new o(e);return r.skip(8),t===z.VIDEO?An("vide").forEach((function(t){return r.write(1,t)})):t===z.AUDIO&&An("soun").forEach((function(t){return r.write(1,t)})),r.skip(12),t===z.VIDEO?An("VideoHandler").forEach((function(t){return r.write(1,t)})):t===z.AUDIO&&An("SoundHandler").forEach((function(t){return r.write(1,t)})),r.write(1,0),this.create("hdlr",e)},t.prototype.hvcC=function(t){var e=t.vps,r=t.sps,n=t.pps,a=[],i=[{type:_.VPS,data:e},{type:_.SPS,data:r},{type:_.PPS,data:n}];i.forEach((function(t){var e=t.type,r=t.data;a.push(128|e),a.push(r.length>>>8&255),a.push(255&r.length),r.forEach((function(t){a.push(t.byteLength>>>8&255),a.push(255&t.byteLength),t.forEach((function(t){return a.push(t)}))}))}));var s=new ArrayBuffer(23),u=new o(s),c=r.length?r[0]:[];u.write(1,1);for(var p=1;p<12;p++)u.write(1,c[p]||0);return u.write(1,0),u.write(2,0),u.write(1,0),u.write(1,1),u.write(1,0),u.write(1,0),u.write(2,0),u.write(1,15),u.write(1,i.length),this.create("hvcC",s,a)},t.prototype.mdat=function(t){return this.create("mdat",t)},t.prototype.mdhd=function(t){var e=new ArrayBuffer(24),r=new o(e);return r.write(4,0),r.write(4,0),r.write(4,0),r.write(4,t.timescale),r.write(4,0),r.write(2,21956),r.write(2,0),this.create("mdhd",e)},t.prototype.mdia=function(t){return this.create("mdia",this.mdhd(t),this.hdlr(t.type),this.minf(t))},t.prototype.mfhd=function(t){var e=new ArrayBuffer(8),r=new o(e);return r.write(4,0),r.write(4,t),this.create("mfhd",e)},t.prototype.minf=function(t){var e=t.type===z.VIDEO?this.vmhd():this.smhd();return this.create("minf",e,this.dinf(),this.stbl(t))},t.prototype.moof=function(t,e,r){var n=this,o=this.mfhd(e),a=8+o.byteLength+60*t.tracks.length+16*r.length+8,i=t.tracks.map((function(t){var e=r.filter((function(e){return e.trackType===t.type})),o=n.traf(t,e,a);return a+=e.reduce((function(t,e){return t+e.size}),0),o}));return this.create.apply(this,On(["moof",o],i,!1))},t.prototype.moov=function(t){var e=this,r=t.tracks.map((function(t){return e.trak(t)}));return this.create.apply(this,On(On(["moov",this.mvhd(t)],r,!1),[this.mvex(t)],!1))},t.prototype.mp4a=function(t){var e=new ArrayBuffer(28),r=new o(e);return r.write(4,0),r.write(2,0),r.write(2,1),r.write(4,0),r.write(4,0),r.write(2,t.channelCount),r.write(2,t.sampleSize),r.write(4,0),r.write(4,t.sampleRate<<16),this.create("mp4a",e,this.esds(t))},t.prototype.mvex=function(t){var e=this;return this.create.apply(this,On(["mvex"],t.tracks.map((function(t){return e.trex(t)})),!1))},t.prototype.mvhd=function(t){var e=new ArrayBuffer(100),r=new o(e);r.write(4,0),r.write(4,0),r.write(4,0),r.write(4,t.timescale),r.write(4,t.duration),r.write(2,1),r.skip(2),r.write(1,1),r.skip(1),r.skip(10);return[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].forEach((function(t){return r.write(1,t)})),r.skip(24),r.write(4,4294967295),this.create("mvhd",e)},t.prototype.sdtp=function(t){var e=t.length,r=new ArrayBuffer(4+e),n=new o(r);n.write(4,0);for(var a=0;a<e;a++){var i=t[a];n.write(1,i.flag)}return this.create("sdtp",r)},t.prototype.smhd=function(){var t=new ArrayBuffer(8),e=new o(t);return e.write(4,0),e.write(4,0),this.create("smhd",t)},t.prototype.stbl=function(t){return this.create("stbl",this.stsd(t),this.stts(),this.stsc(),this.stsz(),this.stco())},t.prototype.stco=function(){var t=new ArrayBuffer(8),e=new o(t);return e.write(4,0),e.write(4,0),this.create("stco",t)},t.prototype.stsc=function(){var t=new ArrayBuffer(8),e=new o(t);return e.write(4,0),e.write(4,0),this.create("stsc",t)},t.prototype.stsd=function(t){var e=new ArrayBuffer(8),r=new o(e);return r.write(4,0),r.write(4,1),t.type===z.VIDEO?this.create("stsd",e,this.avc1(t)):t.type===z.AUDIO?this.create("stsd",e,this.mp4a(t)):this.create("stsd",e)},t.prototype.stsz=function(){var t=new ArrayBuffer(12),e=new o(t);return e.write(4,0),e.write(4,0),e.write(4,0),this.create("stsz",t)},t.prototype.stts=function(){var t=new ArrayBuffer(8),e=new o(t);return e.write(4,0),e.write(4,0),this.create("stts",t)},t.prototype.tkhd=function(t){var e=new ArrayBuffer(84),r=new o(e);r.write(4,7),r.write(4,0),r.write(4,0),r.write(4,t.id),r.write(4,0),r.write(4,0),r.write(4,0),r.write(4,0),r.write(4,0),r.write(1,0),r.write(1,0),r.write(2,0);return[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].forEach((function(t){return r.write(1,t)})),r.write(2,t.width||0),r.write(2,0),r.write(2,t.height||0),r.write(2,0),this.create("tkhd",e)},t.prototype.tfdt=function(t){var e=new ArrayBuffer(8),r=new o(e);return r.write(4,0),r.write(4,t),this.create("tfdt",e)},t.prototype.tfhd=function(t){var e=new ArrayBuffer(8),r=new o(e);return r.write(4,0),r.write(4,t.id),this.create("tfhd",e)},t.prototype.traf=function(t,e,r){void 0===r&&(r=0);var n=e.length?e[0].dts:0;return this.create("traf",this.tfhd(t),this.tfdt(n),this.trun(e,r))},t.prototype.trak=function(t){return this.create("trak",this.tkhd(t),this.mdia(t))},t.prototype.trex=function(t){var e=new ArrayBuffer(24),r=new o(e);return r.write(4,0),r.write(4,t.id),r.write(4,1),r.write(4,0),r.write(4,0),r.write(4,65537),this.create("trex",e)},t.prototype.trun=function(t,e){var r=t.length,n=new ArrayBuffer(12+16*r),a=new o(n);a.write(4,3841),a.write(4,t.length),a.write(4,e);for(var i=0;i<r;i++){var s=t[i];a.write(4,s.duration),a.write(4,s.size),a.write(4,s.flag),a.write(4,s.cts)}return this.create("trun",n)},t.prototype.vmhd=function(){var t=new ArrayBuffer(12),e=new o(t);return e.write(4,1),e.write(2,0),e.write(2,0),e.write(2,0),e.write(2,0),this.create("vmhd",t)},t.prototype.url=function(){var t=new ArrayBuffer(4);return new o(t).write(4,1),this.create("url ",t)},t}();const Cn=function(){function t(){}return t.createSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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(6===e)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(1===e)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(2===e)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(3===e)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 new Uint8Array},t.FRAME_DURATION=1024,t}();var Nn=function(){function t(){this.logger=new Q("remux"),this.generator=new Pn,this.config={formatType:F.MP4,live:!1,progressive:!1,url:"",basePTS:0,baseDTS:0,timescale:0,duration:0,tracks:[]},this.sequenceNumber=0,this.offset=0,this.videoInited=!1,this.audioInited=!1,this.lastPacketMap=new Map}return t.prototype.updateConfig=function(t){Object.assign(this.config,t)},t.prototype.createInitSegment=function(){var t=o.concatUint8(this.generator.ftyp(),this.generator.moov(this.config));return this.offset=t.byteLength,t},t.prototype.createSegment=function(t){var e=this;if(!t.length)return new Uint8Array;var r=[];this.config.tracks.forEach((function(n){var a=t.filter((function(t){return t.trackType===n.type}));if(a.length){var i=null;n.type===z.VIDEO?i=e.recaculateVideoSamples(a,n):n.type===z.AUDIO&&(i=e.recaculateAudioSamples(a,n)),i&&(r.push(e.generator.moof(e.config,++e.sequenceNumber,i)),r.push(e.generator.mdat(o.concatUint8s(i.map((function(t){return t.data}))))))}}));var n=o.concatUint8s(r);return this.offset+=n.byteLength,n},t.prototype.createSlientFrames=function(t,e,r,n){var o=[];if(r>1.5*n){this.logger.warn("remux audio found pts hole at pts:",t,"timestamp:",(t-this.config.basePTS)/e.timescale,"gap duration:",r,"sample duration:",n);for(var a=Cn.createSilentFrame(e.codec,e.channelCount),i=Math.ceil(r/n),s=0;s<i;s++)o.push({flag:st.DEPENDS_NO,trackType:z.AUDIO,dts:t+n*s,cts:0,duration:n,size:a.byteLength,data:a,isSync:!0});o.length&&(o[o.length-1].duration=r-(i-1)*n)}return o},t.prototype.recaculateAudioSamples=function(t,e){var r=[];this.prevAudioPacket&&(t.unshift(this.prevAudioPacket),this.prevAudioPacket=void 0);var n,a,i=Math.round(Cn.FRAME_DURATION/e.sampleRate*e.timescale);if(!this.audioInited&&t.length){this.audioInited=!0;var s=t[0].pts-this.config.basePTS;this.createSlientFrames(this.config.basePTS,e,s,i).forEach((function(t){r.push(t)}))}for(var u=0,c=0,p=0,f=t.length;u<f;u++){if(n=t[u],a=t[u+1]){if((p=a.dts-n.dts)<0){if(!((c=t.findIndex((function(t){return n.dts<t.dts})))>u+1))break;p=t[c].dts-n.dts,u=c-1,this.logger.warn("remux audio found pts overlap at pts:",n.pts,"timestamp:",(n.pts-(this.config.basePTS||0))/e.timescale,"gap duration:",p,"sample duration:",i)}}else{if(!n.isLast||!r.length){this.prevAudioPacket=n;break}p=r[r.length-1].duration}if(p>0){var d=this.createSlientFrames(n.pts+i,e,p-i,i);d.length&&(p=i);var l=o.concatUint8s(n.data);r.push({flag:st.DEPENDS_NO,trackType:z.AUDIO,size:l.byteLength,dts:n.dts,cts:n.pts-n.dts,duration:p,data:l,isSync:!0}),d.forEach((function(t){r.push(t)}))}}return r.length&&this.recaculateSample(r[0],this.config.baseDTS),r},t.prototype.recaculateVideoSamples=function(t,e){if(this.prevVideoPacket&&(t.unshift(this.prevVideoPacket),this.prevVideoPacket=void 0),!this.videoInited){this.videoInited=!0;var r=Math.min.apply(Math,t.map((function(t){return t.pts})));t.find((function(t){return t.pts===r})).pts=this.config.basePTS}for(var n,a,i,s,u=[],c=function(r,c,f,d){if(n=t[r],a=t[r+1]){if((f=a.dts-n.dts)<0){for(a.dts=n.dts,c=r+1;c<d-1;c++)t[c].dts>t[c+1].dts&&(t[c+1].dts=t[c].dts);p.logger.warn("remux video found pts overlap at pts:",n.pts,"timestamp:",(n.pts-p.config.basePTS)/e.timescale,"gap packet number:",c-r,"gap duration:",f),f=0}}else{if(!n.isLast||!u.length)return p.prevVideoPacket=n,i=c,s=f,"break";f=u[u.length-1].duration}if(f>=0){var l=[];n.data.forEach((function(t){l.push(m.createAVCCStartCode(t.length),t)}));var h=o.concatUint8s(l);u.push({flag:n.isSync?st.DEPENDS_NO:st.IS_NON_SYNC|st.DEPENDS_YES,trackType:z.VIDEO,size:h.byteLength,dts:n.dts,cts:n.pts-n.dts,duration:f,data:h,isSync:n.isSync})}i=c,s=f},p=this,f=0,d=0,l=0,h=t.length;f<h;f++){var y=c(f,d,l,h);if(d=i,l=s,"break"===y)break}return u.length&&this.recaculateSample(u[0],this.config.baseDTS),u},t.prototype.recaculateSample=function(t,e){var r=t.dts-e;return t.dts=r,t},t.prototype.flush=function(){this.prevAudioPacket=void 0,this.prevVideoPacket=void 0},t}(),In=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ln=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return In(e,t),e.prototype.end=function(){this.emit("end",void 0)},e.prototype.pipe=function(t,e){return e?this.on("data",(function(r){return t.write(e(r))})):this.on("data",(function(e){return t.write(e)})),this.on("end",(function(){return t.end()})),t},e}(Tt),kn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dn=function(){return Dn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Dn.apply(this,arguments)},Rn=function(t){function e(){var e=t.call(this)||this;return e.remuxerMap=new Map,e.pendingPacketsMap=new Map,e.metadata={},e.remuxerMap.set(z.VIDEO,new Nn),e.remuxerMap.set(z.AUDIO,new Nn),e}return kn(e,t),e.prototype.remux=function(t,e){var r=this.remuxerMap.get(t);r&&e.length&&this.emit("data",{type:t,buffer:r.createSegment(e).buffer,eos:!!e[e.length-1].isLast})},e.prototype.eos=function(){var t=this;this.pendingPacketsMap.forEach((function(e,r){t.pendingPacketsMap.delete(r),t.remux(r,e)}))},e.prototype.writeMetadata=function(t){var e=this;this.metadata=t,t.tracks.forEach((function(t){return e.writeTrackMetadata(t)}))},e.prototype.writeTrackMetadata=function(t){this.eos();var e=this.remuxerMap.get(t.type);e&&(e.updateConfig(Dn(Dn({},this.metadata),{tracks:[t]})),this.emit("data",{type:t.type,buffer:e.createInitSegment().buffer,eos:!1}))},e.prototype.write=function(t){var e=this,r=t.packets,n=this.pendingPacketsMap;r.forEach((function(t){var r=n.get(t.trackType);r?(r.push(t),r.length>=10&&(n.set(t.trackType,[]),e.remux(t.trackType,r))):n.set(t.trackType,[t])}))},e.prototype.flush=function(){this.remuxerMap.forEach((function(t){return t.flush()})),this.pendingPacketsMap.clear()},e.prototype.end=function(){this.eos(),t.prototype.end.call(this)},e}(Ln)})(),n})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliyun-aliplayer",
3
- "version": "2.29.1",
3
+ "version": "2.29.2",
4
4
  "description": "阿里云 Web 播放器",
5
5
  "main": "./build/aliplayer-min",
6
6
  "style": "./build/skins/default/aliplayer-min.css",
@@ -26,7 +26,7 @@
26
26
  "test:unit:watch": "karma start --no-single-run"
27
27
  },
28
28
  "devDependencies": {
29
- "@ali/mediabox-quality-tracer": "^0.23.0",
29
+ "@ali/mediabox-quality-tracer": "^0.24.0",
30
30
  "@babel/core": "^7.26.0",
31
31
  "@babel/preset-env": "^7.26.0",
32
32
  "@types/chai": "^5.0.1",