Song.Site/Utility/Qiniuyun/qiniu-web-player-1.2.2.js
(开头部分) 511KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.QPlayer=t()}(this,function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u(a,o,s,l){return new(s||(s=Promise))(function(e,t){function r(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(r,n)}i((l=l.apply(a,o||[])).next())})}function d(r,n){var i,a,o,e,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(o=0<(o=s.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){s.label=t[1];break}if(6===t[0]&&s.label<o[1]){s.label=o[1],o=t;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(t);break}o[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(r,s)}catch(e){t=[6,e],a=0}finally{i=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var r={}.toString,i=function(e){return r.call(e).slice(8,-1)},o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t){return e(t={exports:{}},t.exports),t.exports}var c="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),l=function(e){try{return!!e()}catch(e){return!0}},h=!l(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),p=function(e){return"object"==typeof e?null!==e:"function"==typeof e},m=c.document,g=p(m)&&p(m.createElement),y=function(e){return g?m.createElement(e):{}},v=!h&&!l(function(){return 7!=Object.defineProperty(y("div"),"a",{get:function(){return 7}}).a}),_=function(e){if(!p(e))throw TypeError(String(e)+" is not an object");return e},b=function(e,t){if(!p(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!p(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!p(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!p(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},S=Object.defineProperty,E={f:h?S:function(e,t,r){if(_(e),t=b(t,!0),_(r),v)try{return S(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},T=h?function(e,t,r){return E.f(e,t,w(1,r))}:function(e,t,r){return e[t]=r,e},A=function(t,r){try{T(c,t,r)}catch(e){c[t]=r}return r},x=s(function(e){var t="__core-js_shared__",r=c[t]||A(t,{});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.0.0-beta.16",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),L=0,R=Math.random(),I=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++L+R).toString(36))},C=!l(function(){}),D=x("wks"),U=c.Symbol,P=function(e){return D[e]||(D[e]=C&&U[e]||(C?U:I)("Symbol."+e))},k=P("toStringTag"),O="Arguments"==i(function(){return arguments}()),M=function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),k))?r:O?i(t):"Object"==(n=i(t))&&"function"==typeof t.callee?"Arguments":n},F={};F[P("toStringTag")]="z";var B,N,z,j="[object z]"!==String(F)?function(){return"[object "+M(this)+"]"}:F.toString,G={}.hasOwnProperty,H=function(e,t){return G.call(e,t)},q=x("native-function-to-string",Function.toString),V=c.WeakMap,W="function"==typeof V&&/native code/.test(q.call(V)),Y=x("keys"),K=function(e){return Y[e]||(Y[e]=I(e))},X={},Z=c.WeakMap;if(W){var Q=new Z,J=Q.get,$=Q.has,ee=Q.set;B=function(e,t){return ee.call(Q,e,t),t},N=function(e){return J.call(Q,e)||{}},z=function(e){return $.call(Q,e)}}else{var te=K("state");X[te]=!0,B=function(e,t){return T(e,te,t),t},N=function(e){return H(e,te)?e[te]:{}},z=function(e){return H(e,te)}}var re={set:B,get:N,has:z,enforce:function(e){return z(e)?N(e):B(e,{})},getterFor:function(r){return function(e){var t;if(!p(e)||(t=N(e)).type!==r)throw TypeError("Incompatible receiver, "+r+" required");return t}}},ne=s(function(e){var t=re.get,s=re.enforce,l=String(q).split("toString");x("inspectSource",function(e){return q.call(e)}),(e.exports=function(e,t,r,n){var i=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,o=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof t||H(r,"name")||T(r,"name",t),s(r).source=l.join("string"==typeof t?t:"")),e!==c?(i?!o&&e[t]&&(a=!0):delete e[t],a?e[t]=r:T(e,t,r)):a?e[t]=r:A(t,r)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||q.call(this)})}),ie=Object.prototype;j!==ie.toString&&ne(ie,"toString",j,{unsafe:!0});var ae,oe,se,le,ue=Math.ceil,de=Math.floor,fe=function(e){return isNaN(e=+e)?0:(0<e?de:ue)(e)},ce=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},he={}.propertyIsEnumerable,pe=Object.getOwnPropertyDescriptor,me={f:pe&&!he.call({1:2},1)?function(e){var t=pe(this,e);return!!t&&t.enumerable}:he},ge="".split,ye=l(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?ge.call(e,""):Object(e)}:Object,ve=function(e){return ye(ce(e))},_e=Object.getOwnPropertyDescriptor,be={f:h?_e:function(e,t){if(e=ve(e),t=b(t,!0),v)try{return _e(e,t)}catch(e){}if(H(e,t))return w(!me.f.call(e,t),e[t])}},Se=Math.min,Ee=function(e){return 0<e?Se(fe(e),9007199254740991):0},we=Math.max,Te=Math.min,Ae=(ae=!1,function(e,t,r){var n,i,a,o=ve(e),s=Ee(o.length),l=(n=s,(i=fe(r))<0?we(i+n,0):Te(i,n));if(ae&&t!=t){for(;l<s;)if((a=o[l++])!=a)return!0}else for(;l<s;l++)if((ae||l in o)&&o[l]===t)return ae||l||0;return!ae&&-1}),xe=function(e,t){var r,n=ve(e),i=0,a=[];for(r in n)!H(X,r)&&H(n,r)&&a.push(r);for(;t.length>i;)H(n,r=t[i++])&&(~Ae(a,r)||a.push(r));return a},Le=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Re=Le.concat("length","prototype"),Ie={f:Object.getOwnPropertyNames||function(e){return xe(e,Re)}},Ce={f:Object.getOwnPropertySymbols},De=c.Reflect,Ue=De&&De.ownKeys||function(e){var t=Ie.f(_(e)),r=Ce.f;return r?t.concat(r(e)):t},Pe=function(e,t){for(var r=Ue(t),n=E.f,i=be.f,a=0;a<r.length;a++){var o=r[a];H(e,o)||n(e,o,i(t,o))}},ke=/#|\.prototype\./,Oe=function(e,t){var r=Fe[Me(e)];return r==Ne||r!=Be&&("function"==typeof t?l(t):!!t)},Me=Oe.normalize=function(e){return String(e).replace(ke,".").toLowerCase()},Fe=Oe.data={},Be=Oe.NATIVE="N",Ne=Oe.POLYFILL="P",ze=Oe,je=be.f,Ge=function(e,t){var r,n,i,a,o,s=e.target,l=e.global,u=e.stat;if(r=l?c:u?c[s]||A(s,{}):(c[s]||{}).prototype)for(n in t){if(a=t[n],i=e.noTargetGet?(o=je(r,n))&&o.value:r[n],!ze(l?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Pe(a,i)}(e.sham||i&&i.sham)&&T(a,"sham",!0),ne(r,n,a,e)}},He=function(e){return Object(ce(e))},qe=!l(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ve=K("IE_PROTO"),We=Object.prototype,Ye=qe?Object.getPrototypeOf:function(e){return e=He(e),H(e,Ve)?e[Ve]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?We:null},Ke=P("iterator"),Xe=!1;[].keys&&("next"in(le=[].keys())?(se=Ye(Ye(le)))!==Object.prototype&&(oe=se):Xe=!0),null==oe&&(oe={}),H(oe,Ke)||T(oe,Ke,function(){return this});var Ze={IteratorPrototype:oe,BUGGY_SAFARI_ITERATORS:Xe},Qe=Object.keys||function(e){return xe(e,Le)},Je=h?Object.defineProperties:function(e,t){_(e);for(var r,n=Qe(t),i=n.length,a=0;a<i;)E.f(e,r=n[a++],t[r]);return e},$e=c.document,et=$e&&$e.documentElement,tt=K("IE_PROTO"),rt="prototype",nt=function(){},it=function(){var e,t=y("iframe"),r=Le.length,n="script";for(t.style.display="none",et.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object</"+n+">"),e.close(),it=e.F;r--;)delete it[rt][Le[r]];return it()},at=Object.create||function(e,t){var r;return null!==e?(nt[rt]=_(e),r=new nt,nt[rt]=null,r[tt]=e):r=it(),void 0===t?r:Je(r,t)};X[tt]=!0;var ot=E.f,st=P("toStringTag"),lt=function(e,t,r){e&&!H(e=r?e:e.prototype,st)&&ot(e,st,{configurable:!0,value:t})},ut={},dt=Ze.IteratorPrototype,ft=function(){return this},ct=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return function(e,t){if(_(e),!p(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(e,t),n?r.call(e,t):e.__proto__=t,e}}():void 0),ht=P("iterator"),pt=Ze.IteratorPrototype,mt=Ze.BUGGY_SAFARI_ITERATORS,gt="values",yt="entries",vt=function(){return this},_t=function(e,t,r,n,i,a,o){var s,l,u;l=n,u=t+" Iterator",(s=r).prototype=at(dt,{next:w(1,l)}),lt(s,u,!1),ut[u]=ft;var d,f,c,h=function(e){if(e===i&&v)return v;if(!mt&&e in g)return g[e];switch(e){case"keys":case gt:case yt:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",m=!1,g=e.prototype,y=g[ht]||g["@@iterator"]||i&&g[i],v=!mt&&y||h(i),_="Array"==t&&g.entries||y;if(_&&(d=Ye(_.call(new e)),pt!==Object.prototype&&d.next&&(Ye(d)!==pt&&(ct?ct(d,pt):"function"!=typeof d[ht]&&T(d,ht,vt)),lt(d,p,!0))),i==gt&&y&&y.name!==gt&&(m=!0,v=function(){return y.call(this)}),g[ht]!==v&&T(g,ht,v),ut[t]=v,i)if(f={values:h(gt),keys:a?v:h("keys"),entries:h(yt)},o)for(c in f)!mt&&!m&&c in g||ne(g,c,f[c]);else Ge({target:t,proto:!0,forced:mt||m},f);return f},bt="String Iterator",St=re.set,Et=re.getterFor(bt);_t(String,"String",function(e){St(this,{type:bt,string:String(e),index:0})},function(){var e,t,r,n,i,a,o,s,l=Et(this),u=l.string,d=l.index;return d>=u.length?{value:void 0,done:!0}:(t=d,r=!0,a=String(ce(u)),o=fe(t),s=a.length,e=o<0||s<=o?r?"":void 0:(n=a.charCodeAt(o))<55296||56319<n||o+1===s||(i=a.charCodeAt(o+1))<56320||57343<i?r?a.charAt(o):n:r?a.slice(o,o+2):i-56320+(n-55296<<10)+65536,l.index+=e.length,{value:e,done:!1})});var wt={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Tt=P("unscopables"),At=Array.prototype;null==At[Tt]&&T(At,Tt,at(null));var xt=function(e){At[Tt][e]=!0},Lt="Array Iterator",Rt=re.set,It=re.getterFor(Lt),Ct=_t(Array,"Array",function(e,t){Rt(this,{type:Lt,target:ve(e),index:0,kind:t})},function(){var e=It(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");ut.Arguments=ut.Array,xt("keys"),xt("values"),xt("entries");var Dt=P("iterator"),Ut=P("toStringTag"),Pt=Ct.values;for(var kt in wt){var Ot=c[kt],Mt=Ot&&Ot.prototype;if(Mt){if(Mt[Dt]!==Pt)try{T(Mt,Dt,Pt)}catch(e){Mt[Dt]=Pt}if(Mt[Ut]||T(Mt,Ut,kt),wt[kt])for(var Ft in Ct)if(Mt[Ft]!==Ct[Ft])try{T(Mt,Ft,Ct[Ft])}catch(e){Mt[Ft]=Ct[Ft]}}}var Bt,Nt,zt,jt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Gt=P("iterator"),Ht=Array.prototype,qt=function(n,i,e){if(jt(n),void 0===i)return n;switch(e){case 0:return function(){return n.call(i)};case 1:return function(e){return n.call(i,e)};case 2:return function(e,t){return n.call(i,e,t)};case 3:return function(e,t,r){return n.call(i,e,t,r)}}return function(){return n.apply(i,arguments)}},Vt=P("iterator"),Wt=function(t,e,r,n){try{return n?e(_(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&_(i.call(t)),e}},Yt=s(function(e){var c={};(e.exports=function(e,t,r,n,i){var a,o,s,l,u,d,f=qt(t,r,n?2:1);if(i)a=e;else{if("function"!=typeof(o=function(e){if(null!=e)return e[Vt]||e["@@iterator"]||ut[M(e)]}(e)))throw TypeError("Target is not iterable");if(void 0!==(d=o)&&(ut.Array===d||Ht[Gt]===d)){for(s=0,l=Ee(e.length);s<l;s++)if((n?f(_(u=e[s])[0],u[1]):f(e[s]))===c)return c;return}a=o.call(e)}for(;!(u=a.next()).done;)if(Wt(a,f,u.value,n)===c)return c}).BREAK=c}),Kt=P("iterator"),Xt=P("species"),Zt=function(e,t){var r,n=_(e).constructor;return void 0===n||null==(r=_(n)[Xt])?t:jt(r)},Qt=c.setImmediate,Jt=c.clearImmediate,$t=c.process,er=c.MessageChannel,tr=c.Dispatch,rr=0,nr={},ir="onreadystatechange",ar=function(){var e=+this;if(nr.hasOwnProperty(e)){var t=nr[e];delete nr[e],t()}},or=function(e){ar.call(e.data)};Qt&&Jt||(Qt=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return nr[++rr]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Bt(rr),rr},Jt=function(e){delete nr[e]},"process"==i($t)?Bt=function(e){$t.nextTick(qt(ar,e,1))}:tr&&tr.now?Bt=function(e){tr.now(qt(ar,e,1))}:er?(zt=(Nt=new er).port2,Nt.port1.onmessage=or,Bt=qt(zt.postMessage,zt,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(Bt=function(e){c.postMessage(e+"","*")},c.addEventListener("message",or,!1)):Bt=ir in y("script")?function(e){et.appendChild(y("script"))[ir]=function(){et.removeChild(this),ar.call(e)}}:function(e){setTimeout(qt(ar,e,1),0)});var sr,lr,ur,dr,fr,cr,hr,pr={set:Qt,clear:Jt},mr=c.navigator,gr=mr&&mr.userAgent||"",yr=be.f,vr=pr.set,_r=c.MutationObserver||c.WebKitMutationObserver,br=c.process,Sr=c.Promise,Er="process"==i(br),wr=yr(c,"queueMicrotask"),Tr=wr&&wr.value;Tr||(sr=function(){var e,t;for(Er&&(e=br.domain)&&e.exit();lr;){t=lr.fn,lr=lr.next;try{t()}catch(e){throw lr?dr():ur=void 0,e}}ur=void 0,e&&e.enter()},dr=Er?function(){br.nextTick(sr)}:_r&&!/(iPhone|iPod|iPad).*AppleWebKit/i.test(gr)?(fr=!0,cr=document.createTextNode(""),new _r(sr).observe(cr,{characterData:!0}),function(){cr.data=fr=!fr}):Sr&&Sr.resolve?(hr=Sr.resolve(void 0),function(){hr.then(sr)}):function(){vr.call(c,sr)});var Ar,xr,Lr,Rr,Ir,Cr=Tr||function(e){var t={fn:e,next:void 0};ur&&(ur.next=t),lr||(lr=t,dr()),ur=t},Dr=function(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=jt(r),this.reject=jt(n)},Ur={f:function(e){return new Dr(e)}},Pr=function(e,t){if(_(e),p(t)&&t.constructor===e)return t;var r=Ur.f(e);return(0,r.resolve)(t),r.promise},kr=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},Or=c,Mr=function(e){return"function"==typeof e?e:void 0},Fr=function(e,t){return arguments.length<2?Mr(Or[e])||Mr(c[e]):Or[e]&&Or[e][t]||c[e]&&c[e][t]},Br=P("species"),Nr="Promise",zr=pr.set,jr=P("species"),Gr=re.get,Hr=re.set,qr=re.getterFor(Nr),Vr=c[Nr],Wr=c.TypeError,Yr=c.document,Kr=c.process,Xr=c.fetch,Zr=Kr&&Kr.versions,Qr=Zr&&Zr.v8||"",Jr=Ur.f,$r=Jr,en="process"==i(Kr),tn=!!(Yr&&Yr.createEvent&&c.dispatchEvent),rn="unhandledrejection",nn=ze(Nr,function(){var e=Vr.resolve(1),t=function(){},r=(e.constructor={})[jr]=function(e){e(t,t)};return!((en||"function"==typeof PromiseRejectionEvent)&&e.then(t)instanceof r&&0!==Qr.indexOf("6.6")&&-1===gr.indexOf("Chrome/66"))}),an=nn||!function(e,t){if(!t)return!1;var r=!1;try{var n={};n[Kt]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}(function(e){Vr.all(e).catch(function(){})}),on=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},sn=function(d,f,r){if(!f.notified){f.notified=!0;var n=f.reactions;Cr(function(){for(var l=f.value,u=1==f.state,e=0,t=function(e){var t,r,n,i=u?e.ok:e.fail,a=e.resolve,o=e.reject,s=e.domain;try{i?(u||(2===f.rejection&&fn(d,f),f.rejection=1),!0===i?t=l:(s&&s.enter(),t=i(l),s&&(s.exit(),n=!0)),t===e.promise?o(Wr("Promise-chain cycle")):(r=on(t))?r.call(t,a,o):a(t)):o(l)}catch(e){s&&!n&&s.exit(),o(e)}};n.length>e;)t(n[e++]);f.reactions=[],f.notified=!1,r&&!f.rejection&&un(d,f)})}},ln=function(e,t,r){var n,i;tn?((n=Yr.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(i=c["on"+e])?i(n):e===rn&&function(e,t){var r=c.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},un=function(n,i){zr.call(c,function(){var e,t=i.value,r=dn(i);if(r&&(e=kr(function(){en?Kr.emit("unhandledRejection",t,n):ln(rn,n,t)}),i.rejection=en||dn(i)?2:1),r&&e.e)throw e.v})},dn=function(e){return 1!==e.rejection&&!e.parent},fn=function(e,t){zr.call(c,function(){en?Kr.emit("rejectionHandled",e):ln("rejectionhandled",e,t.value)})},cn=function(t,r,n,i){return function(e){t(r,n,e,i)}},hn=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,sn(e,t,!0))},pn=function(r,n,e,t){if(!n.done){n.done=!0,t&&(n=t);try{if(r===e)throw Wr("Promise can't be resolved itself");var i=on(e);i?Cr(function(){var t={done:!1};try{i.call(e,cn(pn,r,t,n),cn(hn,r,t,n))}catch(e){hn(r,t,e,n)}}):(n.value=e,n.state=1,sn(r,n,!1))}catch(e){hn(r,{done:!1},e,n)}}};nn&&(Vr=function(e){!function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}(this,Vr,Nr),jt(e),Ar.call(this);var t=Gr(this);try{e(cn(pn,this,t),cn(hn,this,t))}catch(e){hn(this,t,e)}},(Ar=function(e){Hr(this,{type:Nr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(e,t,r){for(var n in t)ne(e,n,t[n],r);return e}(Vr.prototype,{then:function(e,t){var r=qr(this),n=Jr(Zt(this,Vr));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=en?Kr.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&sn(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),xr=function(){var e=new Ar,t=Gr(e);this.promise=e,this.resolve=cn(pn,e,t),this.reject=cn(hn,e,t)},Ur.f=Jr=function(e){return e===Vr||e===Lr?new xr(e):$r(e)},"function"==typeof Xr&&Ge({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Pr(Vr,Xr.apply(c,arguments))}})),Ge({global:!0,wrap:!0,forced:nn},{Promise:Vr}),lt(Vr,Nr,!1),Rr=Fr(Nr),Ir=E.f,h&&Rr&&!Rr[Br]&&Ir(Rr,Br,{configurable:!0,get:function(){return this}}),Lr=Or[Nr],Ge({target:Nr,stat:!0,forced:nn},{reject:function(e){var t=Jr(this);return t.reject.call(void 0,e),t.promise}}),Ge({target:Nr,stat:!0,forced:nn},{resolve:function(e){return Pr(this,e)}}),Ge({target:Nr,stat:!0,forced:an},{all:function(e){var o=this,t=Jr(o),s=t.resolve,l=t.reject,r=kr(function(){var n=[],i=0,a=1;Yt(e,function(e){var t=i++,r=!1;n.push(void 0),a++,o.resolve(e).then(function(e){r||(r=!0,n[t]=e,--a||s(n))},l)}),--a||s(n)});return r.e&&l(r.v),t.promise},race:function(e){var t=this,r=Jr(t),n=r.reject,i=kr(function(){Yt(e,function(e){t.resolve(e).then(r.resolve,n)})});return i.e&&n(i.v),r.promise}}),Ge({target:"Promise",proto:!0,real:!0},{finally:function(t){var r=Zt(this,Fr("Promise")),e="function"==typeof t;return this.then(e?function(e){return Pr(r,t()).then(function(){return e})}:t,e?function(e){return Pr(r,t()).then(function(){throw e})}:t)}});Or.Promise;Ge({target:"Promise",stat:!0},{allSettled:function(e){var o=this,t=Ur.f(o),s=t.resolve,r=t.reject,n=kr(function(){var n=[],i=0,a=1;Yt(e,function(e){var t=i++,r=!1;n.push(void 0),a++,o.resolve(e).then(function(e){r||(r=!0,n[t]={status:"fulfilled",value:e},--a||s(n))},function(e){r||(r=!0,n[t]={status:"rejected",reason:e},--a||s(n))})}),--a||s(n)});return n.e&&r(n.v),t.promise}}),Ge({target:"Promise",stat:!0},{try:function(e){var t=Ur.f(this),r=kr(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}}),Ge({target:"Promise",stat:!0},{any:function(e){var s=this,t=Ur.f(s),l=t.resolve,u=t.reject,r=kr(function(){var n=[],i=0,a=1,o=!1;Yt(e,function(e){var t=i++,r=!1;n.push(void 0),a++,s.resolve(e).then(function(e){r||o||(o=!0,l(e))},function(e){r||o||(r=!0,n[t]=e,--a||u(n))})}),--a||u(n)});return r.e&&u(r.v),t.promise}});var mn,gn,yn,vn,_n,bn,Sn,En,wn,Tn=Array.isArray||function(e){return"Array"==i(e)},An=P("species"),xn=(yn=1==(mn=5),vn=2==mn,_n=3==mn,bn=4==mn,Sn=6==mn,En=5==mn||Sn,wn=gn||function(e,t){var r;return Tn(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!Tn(r.prototype)?p(r)&&null===(r=r[An])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},function(e,t,r){for(var n,i,a=He(e),o=ye(a),s=qt(t,r,3),l=Ee(o.length),u=0,d=yn?wn(e,l):vn?wn(e,0):void 0;u<l;u++)if((En||u in o)&&(i=s(n=o[u],u,a),mn))if(yn)d[u]=i;else if(i)switch(mn){case 3:return!0;case 5:return n;case 6:return u;case 2:d.push(n)}else if(bn)return!1;return Sn?-1:_n||bn?bn:d}),Ln="find",Rn=!0;Ln in[]&&Array(1)[Ln](function(){Rn=!1}),Ge({target:"Array",proto:!0,forced:Rn},{find:function(e){return xn(this,e,1<arguments.length?arguments[1]:void 0)}}),xt(Ln);var In,Cn,Dn=Function.call;In="find",qt(Dn,c["Array"].prototype[In],Cn);!function(n){function t(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!1),t.dispatchEvent(r)}function r(e){return function(t,r){return e!==o.exit||n[i.element]?(n.addEventListener(i.events.change,function e(){t(),n.removeEventListener(i.events.change,e,!1)},!1),void n.addEventListener(i.events.error,function e(){r(new TypeError),n.removeEventListener(i.events.error,e,!1)},!1)):void setTimeout(function(){r(new TypeError)},1)}}var i,e,a={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},o=a.w3;for(e in a)if(a[e].enabled in n){i=a[e];break}o.enabled in n||!i||(n.addEventListener(i.events.change,function(e){e.stopPropagation(),e.stopImmediatePropagation(),n[o.enabled]=n[i.enabled],n[o.element]=n[i.element],t(o.events.change,e.target)},!1),n.addEventListener(i.events.error,function(e){t(o.events.error,e.target)},!1),n[o.enabled]=n[i.enabled],n[o.element]=n[i.element],n[o.exit]=function(){var e=n[i.exit]();return!e&&Promise?new Promise(r(o.exit)):e},Element.prototype[o.request]=function(){var e=this[i.request].apply(this,arguments);return!e&&Promise?new Promise(r(o.request)):e})}(document),e(s(function(e,t){!function(s){var l={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(l.arrayBuffer)var t=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(e){return e&&-1<t.indexOf(Object.prototype.toString.call(e))};function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function e(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return l.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function a(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function o(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function d(e){var t=new FileReader,r=o(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){var t;(this._bodyInit=e)?"string"==typeof e?this._bodyText=e:l.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:l.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():l.arrayBuffer&&l.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||r(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,n=a(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=o(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=n(e),t=i(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[n(e)]},u.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},u.prototype.set=function(e,t){this.map[n(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),e(r)},u.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),e(t)},u.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),e(r)},l.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var h=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function p(e,t){var r,n,i=(t=t||{}).body;if(e instanceof p){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),-1<h.indexOf(n)?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(e){var i=new FormData;return e.trim().split("&").forEach(function(e){if(e){var t=e.split("="),r=t.shift().replace(/\+/g," "),n=t.join("=").replace(/\+/g," ");i.append(decodeURIComponent(r),decodeURIComponent(n))}}),i}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},c.call(p.prototype),c.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var y=[301,302,303,307,308];g.redirect=function(e,t){if(-1===y.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},s.DOMException=self.DOMException;try{new s.DOMException}catch(e){s.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function v(i,o){return new Promise(function(n,e){var t=new p(i,o);if(t.signal&&t.signal.aborted)return e(new s.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function r(){a.abort()}a.onload=function(){var e,i,t={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",i=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var t=e.split(":"),r=t.shift().trim();if(r){var n=t.join(":").trim();i.append(r,n)}}),i)};t.url="responseURL"in a?a.responseURL:t.headers.get("X-Request-URL");var r="response"in a?a.response:a.responseText;n(new g(r,t))},a.onerror=function(){e(new TypeError("Network request failed"))},a.ontimeout=function(){e(new TypeError("Network request failed"))},a.onabort=function(){e(new s.DOMException("Aborted","AbortError"))},a.open(t.method,t.url,!0),"include"===t.credentials?a.withCredentials=!0:"omit"===t.credentials&&(a.withCredentials=!1),"responseType"in a&&l.blob&&(a.responseType="blob"),t.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),t.signal&&(t.signal.addEventListener("abort",r),a.onreadystatechange=function(){4===a.readyState&&t.signal.removeEventListener("abort",r)}),a.send(void 0===t._bodyInit?null:t._bodyInit)})}v.polyfill=!0,self.fetch||(self.fetch=v,self.Headers=u,self.Request=p,self.Response=g),s.Headers=u,s.Request=p,s.Response=g,s.fetch=v,Object.defineProperty(s,"__esModule",{value:!0})}(t)}));var Un,Pn,kn,On,Mn=s(function(e,t){"undefined"!=typeof window&&(e.exports=function(r){var n={};function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=r,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=24)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);function o(){}var i={trace:o,debug:o,log:o,warn:o,info:o,error:o},s=i,l=n.getSelfScope();t.enableLogs=function(e){if(!0===e||"object"==typeof e){!function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];e.forEach(function(e){var i,a;s[e]=t[e]?t[e].bind(t):(i=e,(a=l.console[i])?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r,n;e[0]&&(e[0]=(r=i,n=e[0],n="["+r+"] > "+n)),a.apply(l.console,e)}:o)})}(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=i}}else s=i},t.logger=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(6).getSelfScope().Number;(t.Number=n).isFinite=n.isFinite||function(e){return"number"==typeof e&&isFinite(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(3),a=r(1),o={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},s=function(){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.hls=e,this.onEvent=this.onEvent.bind(this),this.handledEvents=t,this.useGenericHandler=!0,this.registerListeners()}return e.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},e.prototype.onHandlerDestroying=function(){},e.prototype.onHandlerDestroyed=function(){},e.prototype.isEventHandler=function(){return"object"==typeof this.handledEvents&&this.handledEvents.length&&"function"==typeof this.onEvent},e.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){if(o[e])throw new Error("Forbidden event-name: "+e);this.hls.on(e,this.onEvent)},this)},e.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){this.hls.off(e,this.onEvent)},this)},e.prototype.onEvent=function(e,t){this.onEventGeneric(e,t)},e.prototype.onEventGeneric=function(e,t){try{(function(e,t){var r="on"+e.replace("hls","");if("function"!=typeof this[r])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,t)}).call(this,e,t).call()}catch(t){n.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.hls.trigger(a.default.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}},e}();t.default=s},function(e,t){e.exports=void 0},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getSelfScope=function(){return"undefined"==typeof window?self:window}},function(e,t,r){var n,d,i,a,f;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,d=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,f={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=f.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=f.normalizePath(n.path),f.buildURLFromParts(n)}var i=f.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=f.normalizePath(i.path),f.buildURLFromParts(i)):t;var a=f.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var o=d.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var s={scheme:a.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(s.netLoc=a.netLoc,"/"!==i.path[0]))if(i.path){var l=a.path,u=l.substring(0,l.lastIndexOf("/")+1)+i.path;s.path=f.normalizePath(u)}else s.path=a.path,i.params||(s.params=a.params,i.query||(s.query=a.query));return null===s.path&&(s.path=r.alwaysNormalize?f.normalizePath(i.path):i.path),f.buildURLFromParts(s)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=f},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.isBuffered=function(e,t){try{if(e)for(var r=e.buffered,n=0;n<r.length;n++)if(t>=r.start(n)&&t<=r.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(e,t,r){try{if(e){var n=e.buffered,i=[],a=void 0;for(a=0;a<n.length;a++)i.push({start:n.start(a),end:n.end(a)});return this.bufferedInfo(i,t,r)}}catch(e){}return{len:0,start:t,end:t,nextStart:void 0}},e.bufferedInfo=function(e,t,r){var n,i,a,o,s,l=[];for(e.sort(function(e,t){var r=e.start-t.start;return r||t.end-e.end}),s=0;s<e.length;s++){var u=l.length;if(u){var d=l[u-1].end;e[s].start-d<r?e[s].end>d&&(l[u-1].end=e[s].end):l.push(e[s])}else l.push(e[s])}for(n=s=0,i=a=t;s<l.length;s++){var f=l[s].start,c=l[s].end;if(f<=t+r&&t<c)i=f,n=(a=c)-t;else if(t+r<f){o=f;break}}return{len:n,start:i,end:a,nextStart:o}},e}();t.BufferHelper=n},function(e,s,r){(function(n){var i,t=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(s,"__esModule",{value:!0});var a=r(4),o=r(1);s.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};var e=function(r){function e(e){var t=r.call(this,e,o.default.BUFFER_APPENDED,o.default.FRAG_BUFFERED,o.default.FRAG_LOADED)||this;return t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=e.config,t}return t(e,r),e.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,a.default.prototype.destroy.call(this),r.prototype.destroy.call(this)},e.prototype.getBufferedFrag=function(n,i){var a=this.fragments,e=Object.keys(a).filter(function(e){var t=a[e];if(t.body.type!==i)return!1;if(!t.buffered)return!1;var r=t.body;return r.startPTS<=n&&n<=r.endPTS});if(0===e.length)return null;var t=e.pop();return a[t].body},e.prototype.detectEvictedFragments=function(i,a){var o,s,l=this;Object.keys(this.fragments).forEach(function(e){var t=l.fragments[e];if(!0===t.buffered){var r=t.range[i];if(r){o=r.time;for(var n=0;n<o.length;n++)if(s=o[n],!1===l.isTimeBuffered(s.startPTS,s.endPTS,a)){l.removeFragment(t.body);break}}}})},e.prototype.detectPartialFragments=function(r){var n=this,e=this.getFragmentKey(r),i=this.fragments[e];i&&(i.buffered=!0,Object.keys(this.timeRanges).forEach(function(e){if(r.hasElementaryStream(e)){var t=n.timeRanges[e];i.range[e]=n.getBufferedTimes(r.startPTS,r.endPTS,t)}}))},e.prototype.getBufferedTimes=function(e,t,r){for(var n,i,a=[],o=!1,s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,n<=e&&t<=i){a.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))});break}if(e<i&&n<t)a.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))}),o=!0;else if(t<=n)break}return{time:a,partial:o}},e.prototype.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},e.prototype.getPartialFragment=function(r){var n,i,a,o=this,s=null,l=0;return Object.keys(this.fragments).forEach(function(e){var t=o.fragments[e];o.isPartial(t)&&(i=t.body.startPTS-o.bufferPadding,a=t.body.endPTS+o.bufferPadding,i<=r&&r<=a&&(n=Math.min(r-i,a-r),l<=n&&(s=t.body,l=n)))}),s},e.prototype.getState=function(e){var t=this.getFragmentKey(e),r=this.fragments[t],n=s.FragmentState.NOT_LOADED;return void 0!==r&&(n=r.buffered?!0===this.isPartial(r)?s.FragmentState.PARTIAL:s.FragmentState.OK:s.FragmentState.APPENDING),n},e.prototype.isPartial=function(e){return!0===e.buffered&&(void 0!==e.range.video&&!0===e.range.video.partial||void 0!==e.range.audio&&!0===e.range.audio.partial)},e.prototype.isTimeBuffered=function(e,t,r){for(var n,i,a=0;a<r.length;a++){if(n=r.start(a)-this.bufferPadding,i=r.end(a)+this.bufferPadding,n<=e&&t<=i)return!0;if(t<=n)return!1}return!1},e.prototype.onFragLoaded=function(e){var t=e.frag;n.isFinite(t.sn)&&!t.bitrateTest&&(this.fragments[this.getFragmentKey(t)]={body:t,range:Object.create(null),buffered:!1})},e.prototype.onBufferAppended=function(e){var r=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach(function(e){var t=r.timeRanges[e];r.detectEvictedFragments(e,t)})},e.prototype.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},e.prototype.hasFragment=function(e){var t=this.getFragmentKey(e);return void 0!==this.fragments[t]},e.prototype.removeFragment=function(e){var t=this.getFragmentKey(e);delete this.fragments[t]},e.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},e}(a.default);s.FragmentTracker=e}).call(this,r(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default={search:function(e,t){for(var r=0,n=e.length-1,i=null,a=null;r<=n;){var o=t(a=e[i=(r+n)/2|0]);if(0<o)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function s(){}return s.isHeader=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},s.isFooter=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},s.getID3Data=function(e,t){for(var r=t,n=0;s.isHeader(e,t);)n+=10,n+=s._readSize(e,t+6),s.isFooter(e,t+10)&&(n+=10),t+=n;if(0<n)return e.subarray(r,r+n)},s._readSize=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},s.getTimeStamp=function(e){for(var t=s.getID3Frames(e),r=0;r<t.length;r++){var n=t[r];if(s.isTimeStampFrame(n))return s._readTimeStamp(n)}},s.isTimeStampFrame=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},s._getFrameData=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=s._readSize(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},s.getID3Frames=function(e){for(var t=0,r=[];s.isHeader(e,t);){for(var n=s._readSize(e,t+6),i=(t+=10)+n;t+8<i;){var a=s._getFrameData(e.subarray(t)),o=s._decodeFrame(a);o&&r.push(o),t+=a.size+10}s.isFooter(e,t)&&(t+=10)}return r},s._decodeFrame=function(e){return"PRIV"===e.type?s._decodePrivFrame(e):"T"===e.type[0]?s._decodeTextFrame(e):"W"===e.type[0]?s._decodeURLFrame(e):void 0},s._readTimeStamp=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}},s._decodePrivFrame=function(e){if(!(e.size<2)){var t=s._utf8ArrayToStr(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}}},s._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,r=s._utf8ArrayToStr(e.data.subarray(t));t+=r.length+1;var n=s._utf8ArrayToStr(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=s._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:i}}},s._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,r=s._utf8ArrayToStr(e.data.subarray(t));t+=r.length+1;var n=s._utf8ArrayToStr(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=s._utf8ArrayToStr(e.data);return{key:e.type,data:i}},s._utf8ArrayToStr=function(e,t){void 0===t&&(t=!1);for(var r,n,i,a=e.length,o="",s=0;s<a;){if(0===(r=e[s++])&&t)return o;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:n=e[s++],o+=String.fromCharCode((31&r)<<6|63&n);break;case 14:n=e[s++],i=e[s++],o+=String.fromCharCode((15&r)<<12|(63&n)<<6|(63&i)<<0)}}return o},s}(),i=n._utf8ArrayToStr;t.utf8ArrayToStr=i,t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaSource=function(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}},function(e,o,s){(function(g){var n,e=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(o,"__esModule",{value:!0});var y=s(1),t=s(4),l=s(3),c=s(0),a=s(14),v=s(25),_=window.performance,b={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},i={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},r=function(r){function m(e){var t=r.call(this,e,y.default.MANIFEST_LOADING,y.default.LEVEL_LOADING,y.default.AUDIO_TRACK_LOADING,y.default.SUBTITLE_TRACK_LOADING)||this;return t.loaders={},t}return e(m,r),Object.defineProperty(m,"ContextType",{get:function(){return b},enumerable:!0,configurable:!0}),Object.defineProperty(m,"LevelType",{get:function(){return i},enumerable:!0,configurable:!0}),m.canHaveQualityLevels=function(e){return e!==b.AUDIO_TRACK&&e!==b.SUBTITLE_TRACK},m.mapContextToLevelType=function(e){switch(e.type){case b.AUDIO_TRACK:return i.AUDIO;case b.SUBTITLE_TRACK:return i.SUBTITLE;default:return i.MAIN}},m.getResponseUrl=function(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r},m.prototype.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return e.loader=i,this.loaders[e.type]=i},m.prototype.getInternalLoader=function(e){return this.loaders[e.type]},m.prototype.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},m.prototype.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},m.prototype.destroy=function(){this.destroyInternalLoaders(),r.prototype.destroy.call(this)},m.prototype.onManifestLoading=function(e){this.load(e.url,{type:b.MANIFEST,level:0,id:null})},m.prototype.onLevelLoading=function(e){this.load(e.url,{type:b.LEVEL,level:e.level,id:e.id})},m.prototype.onAudioTrackLoading=function(e){this.load(e.url,{type:b.AUDIO_TRACK,level:null,id:e.id})},m.prototype.onSubtitleTrackLoading=function(e){this.load(e.url,{type:b.SUBTITLE_TRACK,level:null,id:e.id})},m.prototype.load=function(e,t){var r=this.hls.config;c.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var n,i,a,o,s=this.getInternalLoader(t);if(s){var l=s.context;if(l&&l.url===e)return c.logger.trace("playlist request ongoing"),!1;c.logger.warn("aborting previous loader for type: "+t.type),s.abort()}switch(t.type){case b.MANIFEST:n=r.manifestLoadingMaxRetry,i=r.manifestLoadingTimeOut,a=r.manifestLoadingRetryDelay,o=r.manifestLoadingMaxRetryTimeout;break;case b.LEVEL:n=0,i=r.levelLoadingTimeOut;break;default:n=r.levelLoadingMaxRetry,i=r.levelLoadingTimeOut,a=r.levelLoadingRetryDelay,o=r.levelLoadingMaxRetryTimeout}s=this.createInternalLoader(t),t.url=e,t.responseType=t.responseType||"";var u={timeout:i,maxRetry:n,retryDelay:a,maxRetryDelay:o},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return c.logger.debug("Calling internal loader delegate for URL: "+e),s.load(t,u,d),!0},m.prototype.loadsuccess=function(e,t,r,n){if(void 0===n&&(n=null),r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.type);var i=e.data;t.tload=_.now(),0===i.indexOf("#EXTM3U")?0<i.indexOf("#EXTINF:")||0<i.indexOf("#EXT-X-TARGETDURATION:")?this._handleTrackOrLevelPlaylist(e,t,r,n):this._handleMasterPlaylist(e,t,r,n):this._handleManifestParsingError(e,r,"no EXTM3U delimiter",n)},m.prototype.loaderror=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!1,e)},m.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!0)},m.prototype._handleMasterPlaylist=function(e,t,r,n){var i=this.hls,a=e.data,o=m.getResponseUrl(e,r),s=v.default.parseMasterPlaylist(a,o);if(s.length){var l=s.map(function(e){return{id:e.attrs.AUDIO,codec:e.audioCodec}}),u=v.default.parseMasterPlaylistMedia(a,o,"AUDIO",l),d=v.default.parseMasterPlaylistMedia(a,o,"SUBTITLES");if(u.length){var f=!1;u.forEach(function(e){e.url||(f=!0)}),!1===f&&s[0].audioCodec&&!s[0].attrs.AUDIO&&(c.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),u.unshift({type:"main",name:"main"}))}i.trigger(y.default.MANIFEST_LOADED,{levels:s,audioTracks:u,subtitles:d,url:o,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,r,"no level found in manifest",n)},m.prototype._handleTrackOrLevelPlaylist=function(e,t,r,n){var i=this.hls,a=r.id,o=r.level,s=r.type,l=m.getResponseUrl(e,r),u=g.isFinite(a)?a:0,d=g.isFinite(o)?o:u,f=m.mapContextToLevelType(r),c=v.default.parseLevelPlaylist(e.data,l,d,f,u);if(c.tload=t.tload,s===b.MANIFEST){var h={url:l,details:c};i.trigger(y.default.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:l,stats:t,networkDetails:n})}if(t.tparsed=_.now(),c.needSidxRanges){var p=c.initSegment.url;this.load(p,{isSidxRequest:!0,type:s,level:o,levelDetails:c,id:a,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}else r.levelDetails=c,this._handlePlaylistLoaded(e,t,r,n)},m.prototype._handleSidxRequest=function(e,t){var r=a.default.parseSegmentIndex(new Uint8Array(e.data));if(r){var n=r.references,i=t.levelDetails;n.forEach(function(e,t){var r=e.info,n=i.fragments[t];0===n.byteRange.length&&(n.rawByteRange=String(1+r.end-r.start)+"@"+String(r.start))}),i.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"}},m.prototype._handleManifestParsingError=function(e,t,r,n){this.hls.trigger(y.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:r,networkDetails:n})},m.prototype._handleNetworkError=function(e,t,r,n){var i,a;void 0===r&&(r=!1),void 0===n&&(n=null),c.logger.info("A network error occured while loading a "+e.type+"-type playlist");var o=this.getInternalLoader(e);switch(e.type){case b.MANIFEST:i=r?l.ErrorDetails.MANIFEST_LOAD_TIMEOUT:l.ErrorDetails.MANIFEST_LOAD_ERROR,a=!0;break;case b.LEVEL:i=r?l.ErrorDetails.LEVEL_LOAD_TIMEOUT:l.ErrorDetails.LEVEL_LOAD_ERROR,a=!1;break;case b.AUDIO_TRACK:i=r?l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,a=!1;break;default:a=!1}o&&(o.abort(),this.resetInternalLoader(e.type));var s={type:l.ErrorTypes.NETWORK_ERROR,details:i,fatal:a,url:o.url,loader:o,context:e,networkDetails:t};n&&(s.response=n),this.hls.trigger(y.default.ERROR,s)},m.prototype._handlePlaylistLoaded=function(e,t,r,n){var i=r.type,a=r.level,o=r.id,s=r.levelDetails;if(s.targetduration)if(m.canHaveQualityLevels(r.type))this.hls.trigger(y.default.LEVEL_LOADED,{details:s,level:a||0,id:o||0,stats:t,networkDetails:n});else switch(i){case b.AUDIO_TRACK:this.hls.trigger(y.default.AUDIO_TRACK_LOADED,{details:s,id:o,stats:t,networkDetails:n});break;case b.SUBTITLE_TRACK:this.hls.trigger(y.default.SUBTITLE_TRACK_LOADED,{details:s,id:o,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,r,"invalid target duration",n)},m}(t.default);o.default=r}).call(this,s(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var c=r(0),l=r(1),s=Math.pow(2,32)-1,n=function(){function m(e,t){this.observer=e,this.remuxer=t}return m.prototype.resetTimeStamp=function(e){this.initPTS=e},m.prototype.resetInitSegment=function(e,t,r,n){if(e&&e.byteLength){var i=this.initData=m.parseInitSegment(e);null==t&&(t="mp4a.40.5"),null==r&&(r="avc1.42e01e");var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:n?e:null}:(i.audio&&(a.audio={container:"audio/mp4",codec:t,initSegment:n?e:null}),i.video&&(a.video={container:"video/mp4",codec:r,initSegment:n?e:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:a})}else t&&(this.audioCodec=t),r&&(this.videoCodec=r)},m.probe=function(e){return 0<m.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length},m.bin2str=function(e){return String.fromCharCode.apply(null,e)},m.readUint16=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r},m.readUint32=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r},m.writeUint32=function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},m.findBox=function(e,t){var r,n,i,a,o,s,l=[];if(e.data?(o=e.start,i=e.end,e=e.data):(o=0,i=e.byteLength),!t.length)return null;for(r=o;r<i;)s=1<(n=m.readUint32(e,r))?r+n:i,m.bin2str(e.subarray(r+4,r+8))===t[0]&&(1===t.length?l.push({data:e,start:r+8,end:s}):(a=m.findBox({data:e,start:r+8,end:s},t.slice(1))).length&&(l=l.concat(a))),r=s;return l},m.parseSegmentIndex=function(e){var t,r=m.findBox(e,["moov"])[0],n=r?r.end:null,i=0,a=m.findBox(e,["sidx"]);if(!a||!a[0])return null;t=[];var o=(a=a[0]).data[0],s=m.readUint32(a,i=0===o?8:16);i+=4,i+=0===o?8:16,i+=2;var l=a.end+0,u=m.readUint16(a,i);i+=2;for(var d=0;d<u;d++){var f=i,c=m.readUint32(a,f);f+=4;var h=2147483647&c;if(1==(2147483648&c)>>>31)return void console.warn("SIDX has hierarchical references (not supported)");var p=m.readUint32(a,f);f+=4,t.push({referenceSize:h,subsegmentDuration:p,info:{duration:p/s,start:l,end:l+h-1}}),l+=h,i=f+=4}return{earliestPresentationTime:0,timescale:s,version:o,referencesCount:u,references:t,moovEndOffset:n}},m.parseInitSegment=function(e){var f=[];return m.findBox(e,["moov","trak"]).forEach(function(e){var t=m.findBox(e,["tkhd"])[0];if(t){var r=t.data[t.start],n=0===r?12:20,i=m.readUint32(t,n),a=m.findBox(e,["mdia","mdhd"])[0];if(a){n=0===(r=a.data[a.start])?12:20;var o=m.readUint32(a,n),s=m.findBox(e,["mdia","hdlr"])[0];if(s){var l={soun:"audio",vide:"video"}[m.bin2str(s.data.subarray(s.start+8,s.start+12))];if(l){var u=m.findBox(e,["mdia","minf","stbl","stsd"]);if(u.length){u=u[0];var d=m.bin2str(u.data.subarray(u.start+12,u.start+16));c.logger.log("MP4Demuxer:"+l+":"+d+" found")}f[i]={timescale:o,type:l},f[l]={timescale:o,id:i}}}}}}),f},m.getStartDTS=function(i,e){var t,r,n;return t=m.findBox(e,["moof","traf"]),r=[].concat.apply([],t.map(function(n){return m.findBox(n,["tfhd"]).map(function(e){var t,r;return t=m.readUint32(e,4),r=i[t].timescale||9e4,m.findBox(n,["tfdt"]).map(function(e){var t,r;return t=e.data[e.start],r=m.readUint32(e,4),1===t&&(r*=Math.pow(2,32),r+=m.readUint32(e,8)),r})[0]/r})})),n=Math.min.apply(null,r),isFinite(n)?n:0},m.offsetStartDTS=function(n,e,o){m.findBox(e,["moof","traf"]).map(function(r){return m.findBox(r,["tfhd"]).map(function(e){var t=m.readUint32(e,4),a=n[t].timescale||9e4;m.findBox(r,["tfdt"]).map(function(e){var t=e.data[e.start],r=m.readUint32(e,4);if(0===t)m.writeUint32(e,4,r-o*a);else{r*=Math.pow(2,32),r+=m.readUint32(e,8),r-=o*a,r=Math.max(r,0);var n=Math.floor(r/(s+1)),i=Math.floor(r%(s+1));m.writeUint32(e,4,n),m.writeUint32(e,8,i)}})})})},m.prototype.append=function(e,t,r,n){var i=this.initData;i||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),i=this.initData);var a,o=this.initPTS;if(void 0===o){var s=m.getStartDTS(i,e);this.initPTS=o=s-t,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:o})}m.offsetStartDTS(i,e,o),a=m.getStartDTS(i,e),this.remuxer.remux(i.audio,i.video,null,null,a,r,n,e)},m.prototype.destroy=function(){},m}();t.default=n},function(e,i,a){(function(r){Object.defineProperty(i,"__esModule",{value:!0});var e=a(7),n=a(16),t=function(){function t(){var e;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=((e={})[t.ElementaryStreamTypes.AUDIO]=!1,e[t.ElementaryStreamTypes.VIDEO]=!1,e)}return Object.defineProperty(t,"ElementaryStreamTypes",{get:function(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return!this._url&&this.relurl&&(this._url=e.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRange",{get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeStartOffset",{get:function(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"byteRangeEndOffset",{get:function(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"decryptdata",{get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endProgramDateTime",{get:function(){if(!r.isFinite(this.programDateTime))return null;var e=r.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encrypted",{get:function(){return!(!this.decryptdata.isQiniuDRM||null!==this.decryptdata.key)||!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)},enumerable:!0,configurable:!0}),t.prototype.addElementaryStream=function(e){this._elementaryStreams[e]=!0},t.prototype.hasElementaryStream=function(e){return!0===this._elementaryStreams[e]},t.prototype.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},t.prototype.fragmentDecryptdataFromLevelkey=function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new n.default).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r},t}();i.default=t}).call(this,a(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),i=function(){function e(){this.method=null,this.key=null,this.iv=null,this._uri=null,this.isQiniuDRM=!1}return Object.defineProperty(e.prototype,"uri",{get:function(){return!this._uri&&this.reluri&&(this._uri=n.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),e}();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};t.isCodecType=function(e,t){var r=n[t];return!!r&&!0===r[e.slice(0,4)]},t.isCodecSupportedInMp4=function(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var m,w=r(1),T=r(3),g=r(19),A=r(36),x=r(14),L=r(37),R=r(42),I=r(43),C=r(46),n=r(6),i=r(0),a=n.getSelfScope();try{m=a.performance.now.bind(a.performance)}catch(e){i.logger.debug("Unable to use Performance API on this environment"),m=a.Date.now}var o=function(){function e(e,t,r,n){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,r,n,i,a,o,s,l,u,d,f,c){var h=this;if(0<e.byteLength&&null!=r&&null!=r.key&&("AES-128"===r.method||r.isQiniuDRM)){var t=this.decrypter;null==t&&(t=this.decrypter=new g.default(this.observer,this.config));var p=m();t.decrypt(e,r.key.buffer,r.iv.buffer,function(e){var t=m();h.observer.trigger(w.default.FRAG_DECRYPTED,{stats:{tstart:p,tdecrypt:t}}),h.pushDecrypted(new Uint8Array(e),r,new Uint8Array(n),i,a,o,s,l,u,d,f,c)})}else this.pushDecrypted(new Uint8Array(e),r,new Uint8Array(n),i,a,o,s,l,u,d,f,c)},e.prototype.pushDecrypted=function(e,t,r,n,i,a,o,s,l,u,d,f){var c=this.demuxer;if(!c||(o||s)&&!this.probe(e)){for(var h=this.observer,p=this.typeSupported,m=this.config,g=[{demux:L.default,remux:I.default},{demux:x.default,remux:C.default},{demux:A.default,remux:I.default},{demux:R.default,remux:I.default}],y=0,v=g.length;y<v;y++){var _=g[y],b=_.demux.probe;if(b(e)){var S=this.remuxer=new _.remux(h,m,p,this.vendor);c=new _.demux(h,S,m,p),this.probe=b;break}}if(!c)return void h.trigger(w.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=c}var E=this.remuxer;(o||s)&&(c.resetInitSegment(r,n,i,u),E.resetInitSegment()),o&&(c.resetTimeStamp(f),E.resetTimeStamp(f)),"function"==typeof c.setDecryptData&&c.setDecryptData(t),c.append(e,a,l,d)},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var s=r(33),l=r(34),u=r(35),a=r(3),d=r(0),o=r(1),f=r(6).getSelfScope(),n=function(){function e(e,t,r){var n=(void 0===r?{}:r).removePKCS7Padding,i=void 0===n||n;if(this.logEnabled=!0,this.observer=e,this.config=t,this.removePKCS7Padding=i)try{var a=f.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(e){}this.disableWebCrypto=!this.subtle}return e.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},e.prototype.decrypt=function(t,r,n,i){var a=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(d.logger.log("JS AES decrypt"),this.logEnabled=!1);var e=this.decryptor;e||(this.decryptor=e=new u.default),e.expandKey(r),i(e.decrypt(t,0,n,this.removePKCS7Padding))}else{this.logEnabled&&(d.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==r&&(this.key=r,this.fastAesKey=new l.default(o,r)),this.fastAesKey.expandKey().then(function(e){new s.default(o,n).decrypt(t,e).catch(function(e){a.onWebCryptoError(e,t,r,n,i)}).then(function(e){i(e)})}).catch(function(e){a.onWebCryptoError(e,t,r,n,i)})}},e.prototype.onWebCryptoError=function(e,t,r,n,i){this.config.enableSoftwareAES?(d.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,r,n,i)):(d.logger.error("decrypting error : "+e.message),this.observer.trigger(o.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))},e.prototype.destroy=function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var c=r(0),h=r(3),p=r(1);function o(e,t,r,n){var i,a,o,s,l,u=navigator.userAgent.toLowerCase(),d=n,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(i=1+((192&t[r+2])>>>6),!((a=(60&t[r+2])>>>2)>f.length-1))return s=(1&t[r+2])<<2,s|=(192&t[r+3])>>>6,c.logger.log("manifest codec:"+n+",ADTS data:type:"+i+",sampleingIndex:"+a+"["+f[a]+"Hz],channelConfig:"+s),o=/firefox/i.test(u)?6<=a?(i=5,l=new Array(4),a-3):(i=2,l=new Array(2),a):-1!==u.indexOf("android")?(i=2,l=new Array(2),a):(i=5,l=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&6<=a?a-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(6<=a&&1===s||/vivaldi/i.test(u))||!n&&1===s)&&(i=2,l=new Array(2)),a)),l[0]=i<<3,l[0]|=(14&a)>>1,l[1]|=(1&a)<<7,l[1]|=s<<3,5===i&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:f[a],channelCount:s,codec:"mp4a.40."+i,manifestCodec:d};e.trigger(p.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+a})}function i(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function u(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function d(e){return 9216e4/e}function f(e,t,r,n,i){var a,o,s=e.length;if(a=l(e,t),o=u(e,t),0<(o-=a)&&t+a+o<=s)return{headerLength:a,frameLength:o,stamp:r+n*i}}t.getAudioConfig=o,t.isHeaderPattern=i,t.getHeaderLength=l,t.getFullFrameLength=u,t.isHeader=function(e,t){return!!(t+1<e.length&&i(e,t))},t.probe=function(e,t){if(t+1<e.length&&i(e,t)){var r=l(e,t);t+5<e.length&&(r=u(e,t));var n=t+r;if(n===e.length||n+1<e.length&&i(e,n))return!0}return!1},t.initTrackConfig=function(e,t,r,n,i){if(!e.samplerate){var a=o(t,r,n,i);e.config=a.config,e.samplerate=a.samplerate,e.channelCount=a.channelCount,e.codec=a.codec,e.manifestCodec=a.manifestCodec,c.logger.log("parsed codec:"+e.codec+",rate:"+a.samplerate+",nb channel:"+a.channelCount)}},t.getFrameDuration=d,t.parseFrameHeader=f,t.appendFrame=function(e,t,r,n,i){var a=f(t,r,n,i,d(e.samplerate));if(a){var o=a.stamp,s=a.headerLength,l=a.frameLength,u={unit:t.subarray(r+s,r+s+l),pts:o,dts:o};return e.samples.push(u),e.len+=l,{sample:u,length:l+s}}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var m={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(e,t,r,n,i){if(!(r+24>t.length)){var a=this.parseHeader(t,r);if(a&&r+a.frameLength<=t.length){var o=n+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:t.subarray(r,r+a.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(s),e.len+=a.frameLength,{sample:s,length:a.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,n=e[t+1]>>1&3,i=e[t+2]>>4&15,a=e[t+2]>>2&3,o=e[t+2]>>1&1;if(1!==r&&0!==i&&15!==i&&3!==a){var s=3===r?3-n:3===n?3:4,l=1e3*m.BitratesMap[14*s+i-1],u=3===r?0:2===r?1:2,d=m.SamplingRateMap[3*u+a],f=e[t+3]>>6==3?1:2,c=m.SamplesCoefficients[r][n],h=m.BytesInSlot[n],p=8*c*h;return{sampleRate:d,channelCount:f,frameLength:parseInt(c*l/d+o,10)*h,samplesPerFrame:p}}},isHeaderPattern:function(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=this.parseHeader(e,t),n=4;r&&r.frameLength&&(n=r.frameLength);var i=t+n;if(i===e.length||i+1<e.length&&this.isHeaderPattern(e,i))return!0}return!1}};t.default=m},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.emit.apply(this,[e,e].concat(t))},t}(r(47).EventEmitter);t.Observer=a},function(e,t,r){(function(h){Object.defineProperty(t,"__esModule",{value:!0});var p=r(0);function m(e,t,r){var n=e[t],i=e[r],a=i.startPTS;h.isFinite(a)?t<r?(n.duration=a-n.start,n.duration<0&&p.logger.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!")):(i.duration=n.start-a,i.duration<0&&p.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):i.start=t<r?n.start+n.duration:Math.max(n.start-i.duration,0)}function g(e,t,r,n,i,a){var o=r;if(h.isFinite(t.startPTS)){var s=Math.abs(t.startPTS-r);h.isFinite(t.deltaPTS)?t.deltaPTS=Math.max(s,t.deltaPTS):t.deltaPTS=s,o=Math.max(r,t.startPTS),r=Math.min(r,t.startPTS),n=Math.max(n,t.endPTS),i=Math.min(i,t.startDTS),a=Math.max(a,t.endDTS)}var l=r-t.start;t.start=t.startPTS=r,t.maxStartPTS=o,t.endPTS=n,t.startDTS=i,t.endDTS=a,t.duration=n-r;var u,d,f,c=t.sn;if(!e||c<e.startSN||c>e.endSN)return 0;for(u=c-e.startSN,(d=e.fragments)[u]=t,f=u;0<f;f--)m(d,f,f-1);for(f=u;f<d.length-1;f++)m(d,f,f+1);return e.PTSKnown=!0,l}t.addGroupId=function(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}},t.updatePTS=m,t.updateFragPTSDTS=g,t.mergeDetails=function(e,t){var r,n=Math.max(e.startSN,t.startSN)-t.startSN,i=Math.min(e.endSN,t.endSN)-t.startSN,a=t.startSN-e.startSN,o=e.fragments,s=t.fragments,l=0;if(t.initSegment&&e.initSegment&&(t.initSegment=e.initSegment),i<n)t.PTSKnown=!1;else{for(var u=n;u<=i;u++){var d=o[a+u],f=s[u];f&&d&&(l=d.cc-f.cc,h.isFinite(d.startPTS)&&(f.start=f.startPTS=d.startPTS,f.endPTS=d.endPTS,f.duration=d.duration,f.backtracked=d.backtracked,f.dropped=d.dropped,r=f))}if(l)for(p.logger.log("discontinuity sliding from playlist, take drift into account"),u=0;u<s.length;u++)s[u].cc+=l;if(r)g(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS);else if(0<=a&&a<o.length){var c=o[a].start;for(u=0;u<s.length;u++)s[u].start+=c}t.PTSKnown=e.PTSKnown}}}).call(this,r(2).Number)},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(7),o=r(3),E=r(13),w=r(28),T=r(29),A=r(9),x=r(30),L=r(56),R=r(57),s=r(59),I=r(0),l=r(60),u=r(1),d=function(b){function S(e){void 0===e&&(e={});var t=b.call(this)||this,r=S.DefaultConfig;if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var n in r)n in e||(e[n]=r[n]);if(void 0!==e.liveMaxLatencyDurationCount&&e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(e.liveMaxLatencyDuration<=e.liveSyncDuration||void 0===e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');I.enableLogs(e.debug),t.config=e,t._autoLevelCapping=-1;var i=t.abrController=new e.abrController(t),a=new e.bufferController(t),o=new e.capLevelController(t),s=new e.fpsController(t),l=new E.default(t),u=new w.default(t),d=new T.default(t),f=new R.default(t),c=t.levelController=new L.default(t),h=new A.FragmentTracker(t),p=[c,t.streamController=new x.default(t,h)],m=e.audioStreamController;m&&p.push(new m(t,h)),t.networkControllers=p;var g=[l,u,d,i,a,o,s,f,h];if(m=e.audioTrackController){var y=new m(t);t.audioTrackController=y,g.push(y)}if(m=e.subtitleTrackController){var v=new m(t);t.subtitleTrackController=v,g.push(v)}if(m=e.emeController){var _=new m(t);t.emeController=_,g.push(_)}return(m=e.subtitleStreamController)&&g.push(new m(t,h)),(m=e.timelineController)&&g.push(new m(t)),t.coreComponents=g,t}return i(S,b),Object.defineProperty(S,"version",{get:function(){return"1.2.1"},enumerable:!0,configurable:!0}),S.isSupported=function(){return s.isSupported()},Object.defineProperty(S,"Events",{get:function(){return u.default},enumerable:!0,configurable:!0}),Object.defineProperty(S,"ErrorTypes",{get:function(){return o.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(S,"ErrorDetails",{get:function(){return o.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(S,"DefaultConfig",{get:function(){return S.defaultConfig?S.defaultConfig:l.hlsDefaultConfig},set:function(e){S.defaultConfig=e},enumerable:!0,configurable:!0}),S.prototype.destroy=function(){I.logger.log("destroy"),this.trigger(u.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(e){e.destroy()}),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},S.prototype.attachMedia=function(e){I.logger.log("attachMedia"),this.media=e,this.trigger(u.default.MEDIA_ATTACHING,{media:e})},S.prototype.detachMedia=function(){I.logger.log("detachMedia"),this.trigger(u.default.MEDIA_DETACHING),this.media=null},S.prototype.loadSource=function(e){e=a.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),I.logger.log("loadSource:"+e),this.url=e,this.trigger(u.default.MANIFEST_LOADING,{url:e})},S.prototype.startLoad=function(t){void 0===t&&(t=-1),I.logger.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},S.prototype.stopLoad=function(){I.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})},S.prototype.swapAudioCodec=function(){I.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},S.prototype.recoverMediaError=function(){I.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Object.defineProperty(S.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(e){I.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(e){I.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(e){I.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){I.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(e){I.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(e){I.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"autoLevelEnabled",{get:function(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"minAutoLevel",{get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++)if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>t)return n;return 0},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"maxAutoLevel",{get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"nextAutoLevel",{get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"audioTracks",{get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"audioTrack",{get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleTracks",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleTrack",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"subtitleDisplay",{get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),S}(r(22).Observer);t.default=d},function(e,t,n){(function(D){Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),U=n(15),P=n(26),k=n(16),O=n(27),M=n(0),l=n(17),u=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,f=/#EXT-X-MEDIA:(.*)/g,F=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),B=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,N=/\.(mp4|m4s|m4v|m4a)$/i,e=function(){function d(){}return d.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;n<e.length;n++){var i=e[n];i.id===t&&(r=i)}return r},d.convertAVC1ToAVCOTI=function(e){var t,r=e.split(".");return 2<r.length?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},d.resolve=function(e,t){return r.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},d.parseMasterPlaylist=function(e,t){var r,n=[];function i(n,i){["video","audio"].forEach(function(t){var r=n.filter(function(e){return l.isCodecType(e,t)});if(r.length){var e=r.filter(function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)});i[t+"Codec"]=0<e.length?e[0]:r[0],n=n.filter(function(e){return-1===r.indexOf(e)})}}),i.unknownCodecs=n}for(u.lastIndex=0;null!=(r=u.exec(e));){var a={},o=a.attrs=new O.default(r[1]);a.url=d.resolve(r[2],t);var s=o.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),a.name=o.NAME,i([].concat((o.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=d.convertAVC1ToAVCOTI(a.videoCodec)),n.push(a)}return n},d.parseMasterPlaylistMedia=function(e,t,r,n){var i;void 0===n&&(n=[]);var a=[],o=0;for(f.lastIndex=0;null!==(i=f.exec(e));){var s={},l=new O.default(i[1]);if(l.TYPE===r){if(s.groupId=l["GROUP-ID"],s.name=l.NAME,s.type=r,s.default="YES"===l.DEFAULT,s.autoselect="YES"===l.AUTOSELECT,s.forced="YES"===l.FORCED,l.URI&&(s.url=d.resolve(l.URI,t)),s.lang=l.LANGUAGE,s.name||(s.name=s.lang),n.length){var u=d.findGroup(n,s.groupId);s.audioCodec=u?u.codec:n[0].codec}s.id=o++,a.push(s)}}return a},d.parseLevelPlaylist=function(e,t,r,n,i){var a,o,s,l,u=0,d=0,f=new P.default(t),c=new k.default,h=0,p=null,m=new U.default,g=null;for(F.lastIndex=0;null!==(a=F.exec(e));){var y=a[1];if(y){m.duration=parseFloat(y);var v=(" "+a[2]).slice(1);m.title=v||null,m.tagList.push(v?["INF",y,v]:["INF",y])}else if(a[3]){if(D.isFinite(m.duration)){var _=u++;m.type=n,m.start=d,m.levelkey=c,m.sn=_,m.level=r,m.cc=h,m.urlId=i,m.baseurl=t,m.relurl=(" "+a[3]).slice(1),l=p,(s=m).rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):l&&l.programDateTime&&(s.programDateTime=l.endProgramDateTime),D.isFinite(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null),f.fragments.push(m),d+=(p=m).duration,m=new U.default}}else if(a[4]){if(m.rawByteRange=(" "+a[4]).slice(1),p){var b=p.byteRangeEndOffset;b&&(m.lastByteRangeEndOffset=b)}}else if(a[5])m.rawProgramDateTime=(" "+a[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),null===g&&(g=f.fragments.length);else{for(a=a[0].match(B),o=1;o<a.length&&void 0===a[o];o++);var S=(" "+a[o+1]).slice(1),E=(" "+a[o+2]).slice(1);switch(a[o]){case"#":m.tagList.push(E?[S,E]:[S]);break;case"PLAYLIST-TYPE":f.type=S.toUpperCase();break;case"MEDIA-SEQUENCE":u=f.startSN=parseInt(S);break;case"TARGETDURATION":f.targetduration=parseFloat(S);break;case"VERSION":f.version=parseInt(S);break;case"EXTM3U":break;case"ENDLIST":f.live=!1;break;case"DIS":h++,m.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":h=parseInt(S);break;case"KEY":var w=S,T=new O.default(w),A=T.enumeratedString("METHOD"),x=T.URI,L=T.hexadecimalInteger("IV");A&&(c=new k.default,x&&0<=["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(A)?(c.method=A,c.baseuri=t,c.reluri=x,c.key=null,c.iv=L):A.startsWith("QINIU-PROTECT")&&(c.method=A,c.iv=L,c.key=null,c.isQiniuDRM=!0));break;case"START":var R=S,I=new O.default(R).decimalFloatingPoint("TIME-OFFSET");D.isFinite(I)&&(f.startTimeOffset=I);break;case"MAP":var C=new O.default(S);m.relurl=C.URI,m.rawByteRange=C.BYTERANGE,m.baseurl=t,m.level=r,m.type=n,m.sn="initSegment",f.initSegment=m,(m=new U.default).rawProgramDateTime=f.initSegment.rawProgramDateTime;break;default:M.logger.warn("line parsed but not handled: "+a)}}}return(m=p)&&!m.relurl&&(f.fragments.pop(),d-=m.duration),f.totalduration=d,f.averagetargetduration=d/f.fragments.length,f.endSN=u-1,f.startCC=f.fragments[0]?f.fragments[0].cc:0,f.endCC=h,!f.initSegment&&f.fragments.length&&f.fragments.every(function(e){return N.test(e.relurl)})&&(M.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(m=new U.default).relurl=f.fragments[0].relurl,m.baseurl=t,m.level=r,m.type=n,m.sn="initSegment",f.initSegment=m,f.needSidxRanges=!0),g&&function(e,t){for(var r=e[t],n=t-1;0<=n;n--){var i=e[n];i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(f.fragments,g),f},d}();t.default=e}).call(this,n(2).Number)},function(e,r,t){(function(t){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function e(e){this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=e,this.version=null}return Object.defineProperty(e.prototype,"hasProgramDateTime",{get:function(){return!(!this.fragments[0]||!t.isFinite(this.fragments[0].programDateTime))},enumerable:!0,configurable:!0}),e}();r.default=e}).call(this,t(2).Number)},function(e,t,r){(function(n){Object.defineProperty(t,"__esModule",{value:!0});var i=/^(\d+)x(\d+)$/,a=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,e=function(){function r(e){for(var t in"string"==typeof e&&(e=r.parseAttrList(e)),e)e.hasOwnProperty(t)&&(this[t]=e[t])}return r.prototype.decimalInteger=function(e){var t=parseInt(this[e],10);return t>n.MAX_SAFE_INTEGER?1/0:t},r.prototype.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(2*n,2*n+2),16);return r}return null},r.prototype.hexadecimalIntegerAsNumber=function(e){var t=parseInt(this[e],16);return t>n.MAX_SAFE_INTEGER?1/0:t},r.prototype.decimalFloatingPoint=function(e){return parseFloat(this[e])},r.prototype.enumeratedString=function(e){return this[e]},r.prototype.decimalResolution=function(e){var t=i.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},r.parseAttrList=function(e){var t,r={};for(a.lastIndex=0;null!==(t=a.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r},r}();t.default=e}).call(this,r(2).Number)},function(e,i,s){(function(h){var n,t=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0});var o=s(1),e=s(4),a=s(3),p=s(0),r=function(n){function e(e){var t=n.call(this,e,o.default.FRAG_LOADING)||this;return t.loaders={},t}return t(e,n),e.prototype.destroy=function(){var e=this.loaders;for(var t in e){var r=e[t];r&&r.destroy()}this.loaders={},n.prototype.destroy.call(this)},e.prototype.onFragLoading=function(e){var t=e.frag,r=t.type,n=this.loaders,i=this.hls.config,a=i.fLoader,o=i.loader;t.loaded=0;var s,l,u,d=n[r];d&&(p.logger.warn("abort previous fragment loader for type: "+r),d.abort()),d=n[r]=t.loader=i.fLoader?new a(i):new o(i),s={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var f=t.byteRangeStartOffset,c=t.byteRangeEndOffset;h.isFinite(f)&&h.isFinite(c)&&(s.rangeStart=f,s.rangeEnd=c),l={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},d.load(s,l,u)},e.prototype.loadsuccess=function(e,t,r,n){void 0===n&&(n=null);var i=e.data,a=r.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(o.default.FRAG_LOADED,{payload:i,frag:a,stats:t,networkDetails:n})},e.prototype.loaderror=function(e,t,r){void 0===r&&(r=null);var n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})},e.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null);var n=t.frag,i=n.loader;i&&i.abort(),this.loaders[n.type]=void 0,this.hls.trigger(o.default.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})},e.prototype.loadprogress=function(e,t,r,n){void 0===n&&(n=null);var i=t.frag;i.loaded=e.loaded,this.hls.trigger(o.default.FRAG_LOAD_PROGRESS,{frag:i,stats:e,networkDetails:n})},e}(e.default);i.default=r}).call(this,s(2).Number)},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),a=r(4),o=r(3),f=r(0),s=function(r){function e(e){var t=r.call(this,e,d.default.KEY_LOADING)||this;return t.loaders={},t.decryptkey=null,t.decrypturl=null,t.qiniuDRMKey=e.config.qiniuDRMKey,t}return i(e,r),e.prototype.destroy=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},a.default.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(e){if(this.qiniuDRMKey)this.loadQiniuDRMKey(e);else{var t=e.frag,r=t.type,n=this.loaders[r],i=t.decryptdata,a=i.uri;if(a!==this.decrypturl||null===this.decryptkey){var o,s,l,u=this.hls.config;n&&(f.logger.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new u.loader(u),this.decrypturl=a,this.decryptkey=null,o={url:a,frag:t,responseType:"arraybuffer"},s={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(o,s,l)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:t}))}},e.prototype.loadsuccess=function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(d.default.KEY_LOADED,{frag:n})},e.prototype.loaderror=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(d.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},e.prototype.loadtimeout=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(d.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e.prototype.loadQiniuDRMKey=function(e){var t=e.frag;this.decryptkey=t.decryptdata.key=new Uint8Array(this.qiniuDRMKey),t.loader=void 0,this.loaders[t.type]=void 0,this.hls.trigger(d.default.KEY_LOADED,{frag:t})},e}(a.default);t.default=s},function(e,l,b){(function(u){var n,t=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(l,"__esModule",{value:!0});var p=b(10),c=b(8),h=b(31),m=b(1),r=b(9),d=b(15),i=b(13),f=b(23),a=b(50),o=b(3),g=b(0),y=b(51),v=b(52),s=b(53),_=b(54),e=function(n){function e(e,t){var r=n.call(this,e,m.default.MEDIA_ATTACHED,m.default.MEDIA_DETACHING,m.default.MANIFEST_LOADING,m.default.MANIFEST_PARSED,m.default.LEVEL_LOADED,m.default.KEY_LOADED,m.default.FRAG_LOADED,m.default.FRAG_LOAD_EMERGENCY_ABORTED,m.default.FRAG_PARSING_INIT_SEGMENT,m.default.FRAG_PARSING_DATA,m.default.FRAG_PARSED,m.default.ERROR,m.default.AUDIO_TRACK_SWITCHING,m.default.AUDIO_TRACK_SWITCHED,m.default.BUFFER_CREATED,m.default.BUFFER_APPENDED,m.default.BUFFER_FLUSHED)||this;return r.fragmentTracker=t,r.config=e.config,r.audioCodecSwap=!1,r._state=_.State.STOPPED,r.stallReported=!1,r.gapController=null,r.lastAutoLevelEnabled=r.hls.autoLevelEnabled,r}return t(e,n),e.prototype.onHandlerDestroying=function(){this.stopLoad(),n.prototype.onHandlerDestroying.call(this)},e.prototype.onHandlerDestroyed=function(){this.state=_.State.STOPPED,this.fragmentTracker=null,n.prototype.onHandlerDestroyed.call(this)},e.prototype.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}0<t&&-1===e&&(g.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=_.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=_.State.STOPPED},e.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=_.State.STOPPED,this.forceStartLoad=!1},e.prototype.doTick=function(){switch(this.state){case _.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case _.State.IDLE:this._doTickIdle();break;case _.State.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=_.State.IDLE);break;case _.State.FRAG_LOADING_WAITING_RETRY:var t=window.performance.now(),r=this.retryDate;(!r||r<=t||this.media&&this.media.seeking)&&(g.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=_.State.IDLE);break;case _.State.ERROR:case _.State.STOPPED:case _.State.FRAG_LOADING:case _.State.PARSING:case _.State.PARSED:case _.State.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},e.prototype._doTickIdle=function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&t.startFragPrefetch)){var n;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,a=this.levels[i];if(a){var o,s=a.bitrate;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);var l=c.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),u=l.len;if(!(o<=u)){g.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var d=a.details;if(!d||d.live&&this.levelLastLoaded!==i)this.state=_.State.WAITING_LEVEL;else{if(this._streamEnded(l,d)){var f={};return this.altAudio&&(f.type="video"),this.hls.trigger(m.default.BUFFER_EOS,f),void(this.state=_.State.ENDED)}this._fetchPayloadOrEos(n,l,d)}}}}},e.prototype._fetchPayloadOrEos=function(e,t,r){var n=this.fragPrevious,i=this.level,a=r.fragments,o=a.length;if(0!==o){var s,l=a[0].start,u=a[o-1].start+a[o-1].duration,d=t.end;if(r.initSegment&&!r.initSegment.data)s=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(o<f)return void g.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+f);if(null===(s=this._ensureFragmentAtLivePoint(r,d,l,u,n,a,o)))return}else d<l&&(s=a[0]);s||(s=this._findFragment(l,n,o,a,d,u,r)),s&&(s.encrypted?(g.logger.log("Loading key for "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i),this._loadKey(s)):(g.logger.log("Loading "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i+", currentTime:"+e.toFixed(3)+",bufferEnd:"+d.toFixed(3)),this._loadFragment(s)))}},e.prototype._ensureFragmentAtLivePoint=function(e,t,r,n,i,a,o){var s,l=this.hls.config,u=this.media,d=void 0!==l.liveMaxLatencyDuration?l.liveMaxLatencyDuration:l.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-l.maxFragLookUpTolerance,n-d)){var f=this.liveSyncPosition=this.computeLivePosition(r,e);g.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),t=f,u&&u.readyState&&u.duration>f&&(u.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&n<t&&u&&u.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(i)if(e.hasProgramDateTime)g.logger.log("live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),s=v.findFragmentByPDT(a,i.endProgramDateTime,l.maxFragLookUpTolerance);else{var c=i.sn+1;if(c>=e.startSN&&c<=e.endSN){var h=a[c-e.startSN];i.cc===h.cc&&(s=h,g.logger.log("live playlist, switching playlist, load frag with next SN: "+s.sn))}s||(s=p.default.search(a,function(e){return i.cc-e.cc}))&&g.logger.log("live playlist, switching playlist, load frag with same CC: "+s.sn)}s||(s=a[Math.min(o-1,Math.round(o/2))],g.logger.log("live playlist, switching playlist, unknown, load middle frag : "+s.sn))}return s},e.prototype._findFragment=function(e,t,r,n,i,a,o){var s,l=this.hls.config;if(i<a){var u=i>a-l.maxFragLookUpTolerance?0:l.maxFragLookUpTolerance;s=v.findFragmentByPTS(t,n,i,u)}else s=n[r-1];if(s){var d=s.sn-o.startSN,f=t&&s.level===t.level,c=n[d-1],h=n[d+1];if(t&&s.sn===t.sn)if(f&&!s.backtracked)if(s.sn<o.endSN){var p=t.deltaPTS;p&&p>l.maxBufferHole&&t.dropped&&d?(s=c,g.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(s=h,g.logger.log("SN just loaded, load next one: "+s.sn,s))}else s=null;else s.backtracked&&(h&&h.backtracked?(g.logger.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+s.sn+". Loading fragment "+h.sn),s=h):(g.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),s.dropped=0,c?(s=c).backtracked=!0:d&&(s=null)))}return s},e.prototype._loadKey=function(e){this.state=_.State.KEY_LOADING,this.hls.trigger(m.default.KEY_LOADING,{frag:e})},e.prototype._loadFragment=function(e){var t=this.fragmentTracker.getState(e);this.fragCurrent=e,this.startFragRequested=!0,u.isFinite(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||t===r.FragmentState.NOT_LOADED||t===r.FragmentState.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(m.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new h.default(this.hls,"main")),this.state=_.State.FRAG_LOADING):t===r.FragmentState.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){if(this.state!==e){var t=this.state;this._state=e,g.logger.log("main stream:"+t+"->"+e),this.hls.trigger(m.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},enumerable:!0,configurable:!0}),e.prototype.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,i.default.LevelType.MAIN)},Object.defineProperty(e.prototype,"currentLevel",{get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextBufferedFrag",{get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null},enumerable:!0,configurable:!0}),e.prototype.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},Object.defineProperty(e.prototype,"nextLevel",{get:function(){var e=this.nextBufferedFrag;return e?e.level:-1},enumerable:!0,configurable:!0}),e.prototype._checkFragmentChanged=function(){var e,t,r=this.media;if(r&&r.readyState&&(!1===r.seeking||1===r.readyState)&&((t=r.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=t),c.BufferHelper.isBuffered(r,t)?e=this.getBufferedFrag(t):c.BufferHelper.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(this.hls.autoLevelEnabled!==this.lastAutoLevelEnabled&&(this.hls.trigger(m.default.LEVEL_SWITCHED,{level:n.level}),this.lastAutoLevelEnabled=this.hls.autoLevelEnabled),n!==this.fragPlaying){this.hls.trigger(m.default.FRAG_CHANGED,{frag:n});var i=n.level;this.lastAutoLevelEnabled=this.hls.autoLevelEnabled,this.fragPlaying&&this.fragPlaying.level===i&&this.fragPlaying.autoLevel===n.autoLevel||this.hls.trigger(m.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}},e.prototype.immediateLevelSwitch=function(){if(g.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,u.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,c.BufferHelper.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},e.prototype.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var t,r=void 0,n=void 0;if((t=this.getBufferedFrag(e.currentTime))&&1<t.startPTS&&this.flushMainBuffer(0,t.startPTS-1),e.paused)r=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;r=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(e.currentTime+r))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,u.POSITIVE_INFINITY)}}},e.prototype.flushMainBuffer=function(e,t){this.state=_.State.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(m.default.BUFFER_FLUSHING,r)},e.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new s.default(r,t,this.fragmentTracker,this.hls)},e.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(g.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:void 0;u.isFinite(t)&&g.logger.log("media seeked to "+t.toFixed(3)),this.tick()},e.prototype.onManifestLoading=function(){g.logger.log("trigger BUFFER_RESET"),this.hls.trigger(m.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestParsed=function(e){var t,r=!1,n=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(n=!0))}),this.audioCodecSwitch=r&&n,this.audioCodecSwitch&&g.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)},e.prototype.onLevelLoaded=function(e){var t=e.details,r=e.level,n=this.levels[this.levelLastLoaded],i=this.levels[r],a=t.totalduration,o=0;if(g.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&0<t.fragments.length?(f.mergeDetails(s,t),o=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),t.PTSKnown&&u.isFinite(o)?g.logger.log("live playlist sliding:"+o.toFixed(3)):(g.logger.log("live playlist - outdated PTS, unknown sliding"),y.alignStream(this.fragPrevious,n,t))):(g.logger.log("live playlist - first load, unknown sliding"),t.PTSKnown=!1,y.alignStream(this.fragPrevious,n,t))}else t.PTSKnown=!1;if(i.details=t,this.levelLastLoaded=r,this.hls.trigger(m.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var l=t.startTimeOffset;u.isFinite(l)?(l<0&&(g.logger.log("negative start time offset "+l+", count from end of last fragment"),l=o+a+l),g.logger.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):t.live?(this.startPosition=this.computeLivePosition(o,t),g.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===_.State.WAITING_LEVEL&&(this.state=_.State.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===_.State.KEY_LOADING&&(this.state=_.State.IDLE,this.tick())},e.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=this.hls,n=this.levels,i=this.media,a=e.frag;if(this.state===_.State.FRAG_LOADING&&t&&"main"===a.type&&a.level===t.level&&a.sn===t.sn){var o=e.stats,s=n[t.level],l=s.details;if(this.bitrateTest=!1,this.stats=o,g.logger.log("Loaded "+t.sn+" of ["+l.startSN+" ,"+l.endSN+"],level "+t.level),a.bitrateTest&&r.nextLoadLevel)this.state=_.State.IDLE,this.startFragRequested=!1,o.tparsed=o.tbuffered=window.performance.now(),r.trigger(m.default.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else if("initSegment"===a.sn)this.state=_.State.IDLE,o.tparsed=o.tbuffered=window.performance.now(),l.initSegment.data=e.payload,r.trigger(m.default.FRAG_BUFFERED,{stats:o,frag:t,id:"main"}),this.tick();else{g.logger.log("Parsing "+t.sn+" of ["+l.startSN+" ,"+l.endSN+"],level "+t.level+", cc "+t.cc),this.state=_.State.PARSING,this.pendingBuffering=!0,this.appended=!1,a.bitrateTest&&(a.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:a}));var u=!(i&&i.seeking)&&(l.PTSKnown||!l.live),d=l.initSegment?l.initSegment.data:[],f=this._getAudioCodec(s);(this.demuxer=this.demuxer||new h.default(this.hls,"main")).push(e.payload,d,f,s.videoCodec,t,l.totalduration,u)}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===_.State.PARSING){var n=e.tracks,i=void 0,a=void 0;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(g.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",g.logger.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=e.id}for(i in(a=n.video)&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(m.default.BUFFER_CODECS,n),n){a=n[i],g.logger.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(m.default.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}},e.prototype.onFragParsingData=function(t){var r=this,e=this.fragCurrent,n=t.frag;if(e&&"main"===t.id&&n.sn===e.sn&&n.level===e.level&&("audio"!==t.type||!this.altAudio)&&this.state===_.State.PARSING){var i=this.levels[this.level],a=e;if(u.isFinite(t.endPTS)||(t.endPTS=t.startPTS+e.duration,t.endDTS=t.startDTS+e.duration),!0===t.hasAudio&&a.addElementaryStream(d.default.ElementaryStreamTypes.AUDIO),!0===t.hasVideo&&a.addElementaryStream(d.default.ElementaryStreamTypes.VIDEO),g.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(a.dropped=t.dropped,a.dropped)if(a.backtracked)g.logger.warn("Already backtracked on this fragment, appending with the gap",a.sn);else{var o=i.details;if(!o||a.sn!==o.startSN)return g.logger.warn("missing video frame(s), backtracking fragment",a.sn),this.fragmentTracker.removeFragment(a),a.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=_.State.IDLE,this.fragPrevious=a,void this.tick();g.logger.warn("missing video frame(s) on first frag, appending with gap",a.sn)}else a.backtracked=!1;var s=f.updateFragPTSDTS(i.details,a,t.startPTS,t.endPTS,t.startDTS,t.endDTS),l=this.hls;l.trigger(m.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:s,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(e){e&&e.length&&r.state===_.State.PARSING&&(r.appended=!0,r.pendingBuffering=!0,l.trigger(m.default.BUFFER_APPENDING,{type:t.type,data:e,parent:"main",content:"data"}))}),this.tick()}},e.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===_.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=_.State.PARSED,this._checkAppendedParsed())},e.prototype.onAudioTrackSwitching=function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){g.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(g.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=_.State.IDLE}var i=this.hls;i.trigger(m.default.BUFFER_FLUSHING,{startOffset:0,endOffset:u.POSITIVE_INFINITY,type:"audio"}),i.trigger(m.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}},e.prototype.onAudioTrackSwitched=function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(g.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()},e.prototype.onBufferCreated=function(e){var t,r,n=e.tracks,i=!1;for(var a in n){var o=n[a];"main"===o.id?(t=o,"video"===(r=a)&&(this.videoBuffer=n[a].buffer)):i=!0}this.mediaBuffer=i&&t?(g.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),t.buffer):this.media},e.prototype.onBufferAppended=function(e){if("main"===e.parent){var t=this.state;t!==_.State.PARSING&&t!==_.State.PARSED||(this.pendingBuffering=0<e.pending,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==_.State.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;g.logger.log("main buffered : "+a.default.toString(t.buffered)),this.fragPrevious=e;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(m.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=_.State.IDLE}this.tick()}},e.prototype.onError=function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=!!this.media&&c.BufferHelper.isBuffered(this.media,this.media.currentTime)&&c.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(e.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var n=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);g.logger.warn("mediaController: frag loading failed, retry in "+n+" ms"),this.retryDate=window.performance.now()+n,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=_.State.FRAG_LOADING_WAITING_RETRY}else g.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=_.State.ERROR;break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_.State.ERROR&&(e.fatal?(this.state=_.State.ERROR,g.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==_.State.WAITING_LEVEL||(this.state=_.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==_.State.PARSING&&this.state!==_.State.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=_.State.IDLE):(g.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,u.POSITIVE_INFINITY)))}}},e.prototype._reduceMaxBufferLength=function(e){var t=this.config;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,g.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},e.prototype._checkBuffer=function(){var e=this.media;if(e&&0!==e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,t)}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(d.default.ElementaryStreamTypes.VIDEO,e.buffered),this.state=_.State.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)},e.prototype._seekToStartPos=function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(g.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)},e.prototype._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(g.logger.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t},Object.defineProperty(e.prototype,"liveSyncPosition",{get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e},enumerable:!0,configurable:!0}),e}(_.default);l.default=e}).call(this,b(2).Number)},function(e,n,i){(function(y){Object.defineProperty(n,"__esModule",{value:!0});var u=i(32),d=i(1),f=i(18),v=i(0),c=i(3),e=i(12),t=i(6),h=i(22),p=t.getSelfScope(),m=e.getMediaSource(),r=function(){function e(r,e){var n=this;this.hls=r,this.id=e;var t=this.observer=new h.Observer,i=r.config,a=function(e,t){(t=t||{}).frag=n.frag,t.id=n.id,r.trigger(e,t)};t.on(d.default.FRAG_DECRYPTED,a),t.on(d.default.FRAG_PARSING_INIT_SEGMENT,a),t.on(d.default.FRAG_PARSING_DATA,a),t.on(d.default.FRAG_PARSED,a),t.on(d.default.ERROR,a),t.on(d.default.FRAG_PARSING_METADATA,a),t.on(d.default.FRAG_PARSING_USERDATA,a),t.on(d.default.INIT_PTS_FOUND,a);var o={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},s=navigator.vendor;if(i.enableWorker&&"undefined"!=typeof Worker){v.logger.log("demuxing in webworker");var l=void 0;try{l=this.w=u(48),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(e){r.trigger(d.default.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},l.postMessage({cmd:"init",typeSupported:o,vendor:s,id:e,config:JSON.stringify(i)})}catch(r){v.logger.warn("Error in worker:",r),v.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),l&&p.URL.revokeObjectURL(l.objectURL),this.demuxer=new f.default(t,o,i,s),this.w=void 0}}else this.demuxer=new f.default(t,o,i,s)}return e.prototype.destroy=function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},e.prototype.push=function(e,t,r,n,i,a,o,s){var l=this.w,u=y.isFinite(i.startPTS)?i.startPTS:i.start,d=i.decryptdata,f=this.frag,c=!(f&&i.cc===f.cc),h=!(f&&i.level===f.level),p=f&&i.sn===f.sn+1,m=!h&&p;if(c&&v.logger.log(this.id+":discontinuity detected"),h&&v.logger.log(this.id+":switch detected"),this.frag=i,l)l.postMessage({cmd:"demux",data:e,decryptdata:d,initSegment:t,audioCodec:r,videoCodec:n,timeOffset:u,discontinuity:c,trackSwitch:h,contiguous:m,duration:a,accurateTimeOffset:o,defaultInitPTS:s},e instanceof ArrayBuffer?[e]:[]);else{var g=this.demuxer;g&&g.push(e,d,t,r,n,u,c,h,m,a,o,s)}},e.prototype.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":p.URL.revokeObjectURL(this.w.objectURL);break;case d.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},e}();n.default=r}).call(this,i(2).Number)},function(e,t,h){function l(r){var n={};function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=r,i.c=n,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var e=i(i.s=ENTRY_MODULE);return e.default||e}var p="[\\.|\\-|\\+|\\w|/|@]+",m="\\((/\\*.*?\\*/)?s?.*?("+p+").*?\\)";function g(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function c(e,t,r){var n={};n[r]=[];var i=t.toString(),a=i.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return n;for(var o,s=a[1],l=new RegExp("(\\\\n|\\W)"+g(s)+m,"g");o=l.exec(i);)"dll-reference"!==o[3]&&n[r].push(o[3]);for(l=new RegExp("\\("+g(s)+'\\("(dll-reference\\s('+p+'))"\\)\\)'+m,"g");o=l.exec(i);)e[o[2]]||(n[r].push(o[1]),e[o[2]]=h(o[1]).m),n[o[2]]=n[o[2]]||[],n[o[2]].push(o[4]);for(var u,d=Object.keys(n),f=0;f<d.length;f++)for(var c=0;c<n[d[f]].length;c++)u=n[d[f]][c],isNaN(1*u)||(n[d[f]][c]=1*n[d[f]][c]);return n}function y(r){return Object.keys(r).reduce(function(e,t){return e||0<r[t].length},!1)}e.exports=function(e,t){t=t||{};var r={main:h.m},n=t.all?{main:Object.keys(r.main)}:function(e,t){for(var r={main:[t]},n={main:[]},i={main:{}};y(r);)for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],l=r[s].pop();if(i[s]=i[s]||{},!i[s][l]&&e[s][l]){i[s][l]=!0,n[s]=n[s]||[],n[s].push(l);for(var u=c(e,e[s][l],s),d=Object.keys(u),f=0;f<d.length;f++)r[d[f]]=r[d[f]]||[],r[d[f]]=r[d[f]].concat(u[d[f]])}}return n}(r,e),i="";Object.keys(n).filter(function(e){return"main"!==e}).forEach(function(t){for(var e=0;n[t][e];)e++;n[t].push(e),r[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",i=i+"var "+t+" = ("+l.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+n[t].map(function(e){return JSON.stringify(e)+": "+r[t][e].toString()}).join(",")+"});\n"}),i=i+"new (("+l.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+n.main.map(function(e){return JSON.stringify(e)+": "+r.main[e].toString()}).join(",")+"}))(self);";var a=new window.Blob([i],{type:"text/javascript"});if(t.bare)return a;var o=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),s=new window.Worker(o);return s.objectURL=o,s}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}();t.default=n},function(e,t,r){function k(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePadding=k;var n=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},e.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],a=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],f=s[3],c=new Uint32Array(256),h=0,p=0,m=0;for(m=0;m<256;m++)c[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[h]=g,t[g]=h;var y=c[h],v=c[y],_=c[v],b=257*c[g]^16843008*g;n[h]=b<<24|b>>>8,i[h]=b<<16|b>>>16,a[h]=b<<8|b>>>24,o[h]=b,b=16843009*_^65537*v^257*y^16843008*h,l[g]=b<<24|b>>>8,u[g]=b<<16|b>>>16,d[g]=b<<8|b>>>24,f[g]=b,h?(h=y^c[c[c[_^y]]],p^=c[c[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n<t.length&&r;)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a,o,s,l,u=this.ksRows=4*(i+6+1),d=this.keySchedule=new Uint32Array(u),f=this.invKeySchedule=new Uint32Array(u),c=this.sBox,h=this.rcon,p=this.invSubMix,m=p[0],g=p[1],y=p[2],v=p[3];for(a=0;a<u;a++)a<i?s=d[a]=t[a]:(l=s,a%i==0?(l=c[(l=l<<8|l>>>24)>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l],l^=h[a/i|0]<<24):6<i&&a%i==4&&(l=c[l>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l]),d[a]=s=(d[a-i]^l)>>>0);for(o=0;o<u;o++)a=u-o,l=3&o?d[a]:d[a-4],f[o]=o<4||a<=4?l:m[c[l>>>24]]^g[c[l>>>16&255]]^y[c[l>>>8&255]]^v[c[255&l]],f[o]=f[o]>>>0}},e.prototype.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},e.prototype.decrypt=function(e,t,r,n){for(var i,a,o,s,l,u,d,f,c,h,p,m,g,y,v=this.keySize+6,_=this.invKeySchedule,b=this.invSBox,S=this.invSubMix,E=S[0],w=S[1],T=S[2],A=S[3],x=this.uint8ArrayToUint32Array_(r),L=x[0],R=x[1],I=x[2],C=x[3],D=new Int32Array(e),U=new Int32Array(D.length),P=this.networkToHostOrderSwap;t<D.length;){for(c=P(D[t]),h=P(D[t+1]),p=P(D[t+2]),m=P(D[t+3]),l=c^_[0],u=m^_[1],d=p^_[2],f=h^_[3],g=4,y=1;y<v;y++)i=E[l>>>24]^w[u>>16&255]^T[d>>8&255]^A[255&f]^_[g],a=E[u>>>24]^w[d>>16&255]^T[f>>8&255]^A[255&l]^_[g+1],o=E[d>>>24]^w[f>>16&255]^T[l>>8&255]^A[255&u]^_[g+2],s=E[f>>>24]^w[l>>16&255]^T[u>>8&255]^A[255&d]^_[g+3],l=i,u=a,d=o,f=s,g+=4;i=b[l>>>24]<<24^b[u>>16&255]<<16^b[d>>8&255]<<8^b[255&f]^_[g],a=b[u>>>24]<<24^b[d>>16&255]<<16^b[f>>8&255]<<8^b[255&l]^_[g+1],o=b[d>>>24]<<24^b[f>>16&255]<<16^b[l>>8&255]<<8^b[255&u]^_[g+2],s=b[f>>>24]<<24^b[l>>16&255]<<16^b[u>>8&255]<<8^b[255&d]^_[g+3],g+=3,U[t]=P(i^L),U[t+1]=P(s^R),U[t+2]=P(o^I),U[t+3]=P(a^C),L=c,R=h,I=p,C=m,t+=4}return n?k(U.buffer):U.buffer},e.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},e}();t.default=n},function(e,t,r){(function(p){Object.defineProperty(t,"__esModule",{value:!0});var m=r(20),g=r(0),y=r(11),e=function(){function e(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return e.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(e){if(!e)return!1;for(var t=(y.default.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(m.probe(e,t))return g.logger.log("ADTS sync word found !"),!0;return!1},e.prototype.append=function(e,t,r,n){for(var i=this._audioTrack,a=y.default.getID3Data(e,0)||[],o=y.default.getTimeStamp(a),s=p.isFinite(o)?90*o:9e4*t,l=0,u=s,d=e.length,f=a.length,c=[{pts:u,dts:u,data:a}];f<d-1;)if(m.isHeader(e,f)&&f+5<d){m.initTrackConfig(i,this.observer,e,f,i.manifestCodec);var h=m.appendFrame(i,e,f,s,l);if(!h){g.logger.log("Unable to parse AAC frame");break}f+=h.length,u=h.sample.pts,l++}else y.default.isHeader(e,f)?(a=y.default.getID3Data(e,f),c.push({pts:u,dts:u,data:a}),f+=a.length):f++;this.remuxer.remux(i,{samples:[]},{samples:c,inputTimeScale:9e4},{samples:[]},t,r,n)},e.prototype.destroy=function(){},e}();t.default=e}).call(this,r(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var g=r(20),s=r(21),P=r(1),T=r(38),n=r(39),k=r(0),O=r(3),i=r(40),a={video:1,audio:2,id3:3,text:4},o=function(){function U(e,t,r,n){this.observer=e,this.config=r,this.typeSupported=n,this.remuxer=t,this.sampleAes=null,this.g711buffer=[]}return U.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new n.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},U.probe=function(e){var t=U._syncOffset(e);return!(t<0||(t&&k.logger.warn("MPEG2-TS detected but first sync word found @ offset "+t+", junk ahead ?"),0))},U._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},U.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:a[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}},U.prototype.resetInitSegment=function(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=U.createTrack("video",n),this._audioTrack=U.createTrack("audio",n),this._id3Track=U.createTrack("id3",n),this._txtTrack=U.createTrack("text",n),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=r,this._duration=n,this.g711Codec&&(this.g711Codec.needUpdateConfig=!0,this.g711Codec.overlap_pcm=void 0)},U.prototype.resetTimeStamp=function(){},U.prototype.append=function(e,t,r,n){var i,a,o,s,l,u=e.length,d=!1;this.contiguous=r;var f=this.pmtParsed,c=this._avcTrack,h=this._audioTrack,p=this._id3Track,m=c.pid,g=h.pid,y=p.pid,v=this._pmtId,_=c.pesData,b=h.pesData,S=p.pesData,E=this._parsePAT,w=this._parsePMT,T=this._parsePES,A=this._parseAVCPES.bind(this),x=this._parseAACPES.bind(this),L=this._parseG711PES.bind(this),R=this._parseMPEGPES.bind(this),I=this._parseID3PES.bind(this),C=U._syncOffset(e);for(u-=(u+C)%188,i=C;i<u;i+=188)if(71===e[i]){if(a=!!(64&e[i+1]),o=((31&e[i+1])<<8)+e[i+2],1<(48&e[i+3])>>4){if((s=i+5+e[i+4])===i+188)continue}else s=i+4;switch(o){case m:a&&(_&&(l=T(_))&&void 0!==l.pts&&A(l,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(s,i+188)),_.size+=i+188-s);break;case g:a&&(b&&(l=T(b))&&void 0!==l.pts&&(h.isAAC&&!h.g711Config?x(l):h.g711Config?L(l):R(l)),b={data:[],size:0}),b&&(b.data.push(e.subarray(s,i+188)),b.size+=i+188-s);break;case y:a&&(S&&(l=T(S))&&void 0!==l.pts&&I(l),S={data:[],size:0}),S&&(S.data.push(e.subarray(s,i+188)),S.size+=i+188-s);break;case 0:a&&(s+=e[s]+1),v=this._pmtId=E(e,s);break;case v:a&&(s+=e[s]+1);var D=w(e,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);0<(m=D.avc)&&(c.pid=m),0<(g=D.audio)&&(h.pid=g,h.isAAC=D.isAAC,h.g711Config=D.g711Config),0<(y=D.id3)&&(p.pid=y),d&&!f&&(k.logger.log("reparse from beginning"),d=!1,i=C-188),f=this.pmtParsed=!0;break;case 17:case 8191:break;default:d=!0}}else this.observer.trigger(P.default.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(l=T(_))&&void 0!==l.pts?(A(l,!0),c.pesData=null):c.pesData=_,b&&(l=T(b))&&void 0!==l.pts?(h.isAAC&!h.g711Config?x(l):h.g711Config?L(l,!0):R(l),h.pesData=null):(b&&b.size&&k.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=b),S&&(l=T(S))&&void 0!==l.pts?(I(l),p.pesData=null):p.pesData=S,null==this.sampleAes?this.remuxer.remux(h,c,p,this._txtTrack,t,r,n):this.decryptAndRemux(h,c,p,this._txtTrack,t,r,n)},U.prototype.decryptAndRemux=function(e,t,r,n,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,r,n,i,a,o)})}else this.decryptAndRemuxAvc(e,t,r,n,i,a,o)},U.prototype.decryptAndRemuxAvc=function(e,t,r,n,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,r,n,i,a,o)})}else this.remuxer.remux(e,t,r,n,i,a,o)},U.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},U.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},U.prototype._parsePMT=function(e,t,r,n){var i,a,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<i;){switch(a=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){k.logger.log("unkown stream type:"+e[t]);break}case 15:-1===o.audio&&(o.audio=a);break;case 6:if(-1===o.audio&&(o.audio=a,o.isAAC=!1),15!==e[t+5]||4!==e[t+6]){k.logger.warn("G.711: unkonwn private data");break}if(o.g711Config={},117===e[t+7])o.g711Config.ulaw=!0;else{if(97!==e[t+7]){k.logger.warn("G.711: can not parse private data");break}o.g711Config.alaw=!0}o.g711Config.sampleRate=e[t+8]<<8|e[t+9],k.logger.log("G711 Config:"+JSON.stringify(o.g711Config));case 21:-1===o.id3&&(o.id3=a);break;case 219:if(!n){k.logger.log("unkown stream type:"+e[t]);break}case 27:-1===o.avc&&(o.avc=a);break;case 3:case 4:r?-1===o.audio&&(o.audio=a,o.isAAC=!1):k.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:k.logger.warn("HEVC stream type found, not supported for now");break;default:k.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return o},U.prototype._parsePES=function(e){var t,r,n,i,a,o,s,l,u=0,d=e.data;if(!e||0===e.size)return null;for(;d[0].length<19&&1<d.length;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(1!==((t=d[0])[0]<<16)+(t[1]<<8)+t[2])return null;if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&(4294967295<(o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)&&(o-=8589934592),64&r?(4294967295<(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)&&(s-=8589934592),54e5<o-s&&(k.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),l=(i=t[8])+9,e.size-=l,a=new Uint8Array(e.size);for(var c=0,h=d.length;c<h;c++){var p=(t=d[c]).byteLength;if(l){if(p<l){l-=p;continue}t=t.subarray(l),p-=l,l=0}a.set(t,u),u+=p}return n&&(n-=i+3),{data:a,pts:o,dts:s,len:n}},U.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&k.logger.log(e.pts+"/"+e.dts+":"+e.debug)},U.prototype._parseAVCPES=function(p,e){var m,g,y,v=this,_=this._avcTrack,t=this._parseAVCNALu(p.data),b=this.avcSample,S=!1,E=this.pushAccesUnit.bind(this),w=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};p.data=null,b&&t.length&&!_.audFound&&(E(b,_),b=this.avcSample=w(!1,p.pts,p.dts,"")),t.forEach(function(e){switch(e.type){case 1:g=!0,b||(b=v.avcSample=w(!0,p.pts,p.dts,"")),b.frame=!0;var t=e.data;if(S&&4<t.length){var r=new T.default(t).readSliceType();2!==r&&4!==r&&7!==r&&9!==r||(b.key=!0)}break;case 5:g=!0,b||(b=v.avcSample=w(!0,p.pts,p.dts,"")),b.key=!0,b.frame=!0;break;case 6:g=!0,(m=new T.default(v.discardEPB(e.data))).readUByte();for(var n=0,i=0,a=!1,o=0;!a&&1<m.bytesAvailable;){for(n=0;n+=o=m.readUByte(),255===o;);for(i=0;i+=o=m.readUByte(),255===o;);if(4===n&&0!==m.bytesAvailable){if(a=!0,181===m.readUByte()&&49===m.readUShort()&&1195456820===m.readUInt()&&3===m.readUByte()){var s=m.readUByte(),l=31&s,u=[s,m.readUByte()];for(y=0;y<l;y++)u.push(m.readUByte()),u.push(m.readUByte()),u.push(m.readUByte());v._insertSampleInOrder(v._txtTrack.samples,{type:3,pts:p.pts,bytes:u})}}else if(i<m.bytesAvailable)for(y=0;y<i;y++)m.readUByte()}break;case 7:if(S=g=!0,!_.sps){var d=(m=new T.default(e.data)).readSPS();_.width=d.width,_.height=d.height,_.pixelRatio=d.pixelRatio,_.sps=[e.data],_.duration=v._duration;var f=e.data.subarray(1,4),c="avc1.";for(y=0;y<3;y++){var h=f[y].toString(16);h.length<2&&(h="0"+h),c+=h}_.codec=c}break;case 8:g=!0,_.pps||(_.pps=[e.data]);break;case 9:g=!1,_.audFound=!0,b&&E(b,_),b=v.avcSample=w(!1,p.pts,p.dts,"");break;case 12:g=!1;break;default:g=!1,b&&(b.debug+="unknown NAL "+e.type+" ")}b&&g&&b.units.push(e)}),e&&b&&(E(b,_),this.avcSample=null)},U.prototype._insertSampleInOrder=function(e,t){var r=e.length;if(0<r){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;0<=n;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)},U.prototype._getLastNalUnit=function(){var e,t=this.avcSample;if(!t||0===t.units.length){var r=this._avcTrack.samples;t=r[r.length-1]}if(t){var n=t.units;e=n[n.length-1]}return e},U.prototype._parseAVCNALu=function(e){var t,r,n,i,a=0,o=e.byteLength,s=this._avcTrack,l=s.naluState||0,u=l,d=[],f=-1;for(-1===l&&(i=31&e[f=0],l=0,a=1);a<o;)if(t=e[a++],l)if(1!==l)if(t)if(1===t){var c,h;0<=f?(n={data:e.subarray(f,a-l-1),type:i},d.push(n)):(c=this._getLastNalUnit())&&(u&&a<=4-u&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-u)),0<(r=a-l-1)&&((h=new Uint8Array(c.data.byteLength+r)).set(c.data,0),h.set(e.subarray(0,r),c.data.byteLength),c.data=h)),l=a<o?(i=31&e[f=a],0):-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;return 0<=f&&0<=l&&(n={data:e.subarray(f,o),type:i,state:l},d.push(n)),0===d.length&&(c=this._getLastNalUnit())&&((h=new Uint8Array(c.data.byteLength+e.byteLength)).set(c.data,0),h.set(e,c.data.byteLength),c.data=h),s.naluState=l,d},U.prototype.discardEPB=function(e){for(var t,r,n=e.byteLength,i=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var o=0;for(a=0;a<t;o++,a++)o===i[0]&&(o++,i.shift()),r[a]=e[o];return r},U.prototype._parseG711PES=function(e,t){if(this.g711Codec||(this.g711Codec=new i.default(this.config.g711WasmModule)),this.g711Codec.config&&!this.g711Codec.needUpdateConfig||(this.g711Codec.initTrackConfig(this._audioTrack,this.observer,this.audioCodec),this.g711Codec.needUpdateConfig=!1),this.g711Data&&t&&(this.g711Data.lastPts=e.pts),this.g711Data){var r=new Uint8Array(this.g711Data.data.length+e.data.length);r.set(this.g711Data.data,0),r.set(e.data,this.g711Data.data.length),this.g711Data.data=r,this.g711Data.g711FrameCount+=1}else this.g711Data={data:e.data,pts:e.pts,g711FrameCount:1};if(t){var n=this.g711Codec.getPCMData(this.g711Data);this.g711Codec.appendPCMSamples(this._audioTrack,n,this.g711Data.pts,this.g711Data.lastPts,this.g711Data.g711FrameCount),this.g711Data=void 0,this.g711Codec.config=void 0}},U.prototype._parseAACPES=function(e){var t,r,n,i,a,o=this._audioTrack,s=e.data,l=e.pts,u=this.aacOverFlow,d=this.aacLastPTS;if(u){var f=new Uint8Array(u.byteLength+s.byteLength);f.set(u,0),f.set(s,u.byteLength),s=f}for(n=0,a=s.length;n<a-1&&!g.isHeader(s,n);n++);if(n){var c=void 0,h=void 0;if(h=n<a-1?(c="AAC PES did not start with ADTS header,offset:"+n,!1):(c="no ADTS header found in AAC PES",!0),k.logger.warn("parsing error:"+c),this.observer.trigger(P.default.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:h,reason:c}),h)return}if(g.initTrackConfig(o,this.observer,s,n,this.audioCodec),r=0,t=g.getFrameDuration(o.samplerate),u&&d){var p=d+t;1<Math.abs(p-l)&&(k.logger.log("AAC: align PTS for overlapping frames by "+Math.round((p-l)/90)),l=p)}for(;n<a;)if(g.isHeader(s,n)&&n+5<a){var m=g.appendFrame(o,s,n,l,r);if(!m)break;n+=m.length,i=m.sample.pts,r++}else n++;u=n<a?s.subarray(n,a):null,this.aacOverFlow=u,this.aacLastPTS=i},U.prototype._parseMPEGPES=function(e){for(var t=e.data,r=t.length,n=0,i=0,a=e.pts;i<r;)if(s.default.isHeader(t,i)){var o=s.default.appendFrame(this._audioTrack,t,i,a,n);if(!o)break;i+=o.length,n++}else i++},U.prototype._parseID3PES=function(e){this._id3Track.samples.push(e)},U}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e){this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return e.prototype.loadWord=function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},e.prototype.skipBits=function(e){var t;this.bitsAvailable>e||(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord()),this.word<<=e,this.bitsAvailable-=e},e.prototype.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return 32<e&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,0<this.bitsAvailable?this.word<<=t:0<this.bytesAvailable&&this.loadWord(),0<(t=e-t)&&this.bitsAvailable?r<<t|this.readBits(t):r},e.prototype.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},e.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},e.prototype.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},e.prototype.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},e.prototype.readBoolean=function(){return 1===this.readBits(1)},e.prototype.readUByte=function(){return this.readBits(8)},e.prototype.readUShort=function(){return this.readBits(16)},e.prototype.readUInt=function(){return this.readBits(32)},e.prototype.skipScalingList=function(e){var t,r=8,n=8;for(t=0;t<e;t++)0!==n&&(n=(r+this.readEG()+256)%256),r=0===n?r:n},e.prototype.readSPS=function(){var e,t,r,n,i,a,o,s=0,l=0,u=0,d=0,f=this.readUByte.bind(this),c=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),m=this.skipBits.bind(this),g=this.skipEG.bind(this),y=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);if(f(),e=f(),c(5),m(3),f(),y(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var _=h();if(3===_&&m(1),y(),y(),m(1),p())for(a=3!==_?8:12,o=0;o<a;o++)p()&&v(o<6?16:64)}y();var b=h();if(0===b)h();else if(1===b)for(m(1),g(),g(),t=h(),o=0;o<t;o++)g();y(),m(1),r=h(),n=h(),0===(i=c(1))&&m(1),m(1),p()&&(s=h(),l=h(),u=h(),d=h());var S=[1,1];if(p()&&p())switch(f()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[f()<<8|f(),f()<<8|f()]}return{width:Math.ceil(16*(r+1)-2*s-2*l),height:(2-i)*(n+1)*16-(i?2:4)*(u+d),pixelRatio:S}},e.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var i=r(19),n=function(){function e(e,t,r,n){this.decryptdata=r,this.discardEPB=n,this.decrypter=new i.default(e,t,{removePKCS7Padding:!1})}return e.prototype.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)},e.prototype.decryptAacSample=function(t,r,n,i){var a=t[r].unit,e=a.subarray(16,a.length-a.length%16),o=e.buffer.slice(e.byteOffset,e.byteOffset+e.length),s=this;this.decryptBuffer(o,function(e){e=new Uint8Array(e),a.set(e,16),i||s.decryptAacSamples(t,r+1,n)})},e.prototype.decryptAacSamples=function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},e.prototype.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r},e.prototype.getAvcDecryptedUnit=function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e},e.prototype.decryptAvcSample=function(t,r,n,i,a,o){var s=this.discardEPB(a.data),e=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(e.buffer,function(e){a.data=l.getAvcDecryptedUnit(s,e),o||l.decryptAvcSamples(t,r,n+1,i)})},e.prototype.decryptAvcSamples=function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,o),!o)return}}}},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(41),a=function(){function e(e){this.Module=e}return e.prototype.getPCMData=function(e){if(this.config)return this.config.ulaw?i.decodeUlaw(e.data):i.decodeAlaw(e.data);n.logger.warn("can not find g711 config")},e.prototype.appendPCMSamples=function(e,t,r,n,i){var a;this.overlap_pcm?((a=new Uint8Array(t.length+this.overlap_pcm.length)).set(this.overlap_pcm,0),a.set(t,this.overlap_pcm.length),r-=this.overlap_pcm.length/2*9e4/e.samplerate):a=t;var o=a.length%2048,s=a.subarray(0,a.length-o);this.overlap_pcm=a.subarray(a.length-o,a.length),this._encodePCMtoAAC(s,e,r)},e.prototype._encodePCMtoAAC=function(e,t,r,n,i){var a=this.Module,o=e,s=a._malloc(o.length*o.BYTES_PER_ELEMENT);a.HEAPU8.set(o,s);var l=new Uint8Array(o.length),u=a._malloc(l.length*o.BYTES_PER_ELEMENT);a.HEAPU8.set(l,u);var d=new Uint32Array(Math.round(o.length/1024)),f=a._malloc(d.length*d.BYTES_PER_ELEMENT);a.HEAPU32.set(d,f);var c=new Uint32Array(1);c[0]=this.config.sampleRate;for(var h=a.ccall("pcm2aac","number",["number","number","number","number","number"],[c[0],s,o.length,u,f]),p=0;p<h;p+=1){var m=a.HEAPU32[f/Uint32Array.BYTES_PER_ELEMENT+p];d[p]=m}for(var g=0,y=0,v=this._getFrameDuration();y<h;)if(m=d[y],0!==y){var _={unit:a.HEAPU8.subarray(g+u/Uint8Array.BYTES_PER_ELEMENT,g+m+u/Uint8Array.BYTES_PER_ELEMENT),pts:r+y*v-v,dts:r+y*v-v};t.samples.push(_),t.len+=_.unit.length,g+=m,y+=1}else y+=1,g+=m;a._free(s),a._free(u),a._free(f)},e.prototype.initTrackConfig=function(e,t,r){var n=this;this.config=e.g711Config;var i=-1;[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350].forEach(function(e,t){e===n.config.sampleRate&&(i=t)}),i<0&&t.trigger(Event.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid G711 sampling rate:"+this.config.sampleRate});var a=[];a[0]=16,a[0]|=(14&i)>>1,a[1]|=(1&i)<<7,a[1]|=8,e.config=a,e.channelCount=1,e.samplerate=this.config.sampleRate,e.codec="mp4a.40.2",e.manifestCodec=r,e.isAAC=!0},e.prototype._getFrameDuration=function(){return 9216e4/this.config.sampleRate},e}();t.default=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var a=[-5504,-5248,-6016,-5760,-4480,-4224,-4992,-4736,-7552,-7296,-8064,-7808,-6528,-6272,-7040,-6784,-2752,-2624,-3008,-2880,-2240,-2112,-2496,-2368,-3776,-3648,-4032,-3904,-3264,-3136,-3520,-3392,-22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944,-30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136,-11008,-10496,-12032,-11520,-8960,-8448,-9984,-9472,-15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568,-344,-328,-376,-360,-280,-264,-312,-296,-472,-456,-504,-488,-408,-392,-440,-424,-88,-72,-120,-104,-24,-8,-56,-40,-216,-200,-248,-232,-152,-136,-184,-168,-1376,-1312,-1504,-1440,-1120,-1056,-1248,-1184,-1888,-1824,-2016,-1952,-1632,-1568,-1760,-1696,-688,-656,-752,-720,-560,-528,-624,-592,-944,-912,-1008,-976,-816,-784,-880,-848,5504,5248,6016,5760,4480,4224,4992,4736,7552,7296,8064,7808,6528,6272,7040,6784,2752,2624,3008,2880,2240,2112,2496,2368,3776,3648,4032,3904,3264,3136,3520,3392,22016,20992,24064,23040,17920,16896,19968,18944,30208,29184,32256,31232,26112,25088,28160,27136,11008,10496,12032,11520,8960,8448,9984,9472,15104,14592,16128,15616,13056,12544,14080,13568,344,328,376,360,280,264,312,296,472,456,504,488,408,392,440,424,88,72,120,104,24,8,56,40,216,200,248,232,152,136,184,168,1376,1312,1504,1440,1120,1056,1248,1184,1888,1824,2016,1952,1632,1568,1760,1696,688,656,752,720,560,528,624,592,944,912,1008,976,816,784,880,848],o=[-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,-15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,-11900,-11388,-10876,-10364,-9852,-9340,-8828,-8316,-7932,-7676,-7420,-7164,-6908,-6652,-6396,-6140,-5884,-5628,-5372,-5116,-4860,-4604,-4348,-4092,-3900,-3772,-3644,-3516,-3388,-3260,-3132,-3004,-2876,-2748,-2620,-2492,-2364,-2236,-2108,-1980,-1884,-1820,-1756,-1692,-1628,-1564,-1500,-1436,-1372,-1308,-1244,-1180,-1116,-1052,-988,-924,-876,-844,-812,-780,-748,-716,-684,-652,-620,-588,-556,-524,-492,-460,-428,-396,-372,-356,-340,-324,-308,-292,-276,-260,-244,-228,-212,-196,-180,-164,-148,-132,-120,-112,-104,-96,-88,-80,-72,-64,-56,-48,-40,-32,-24,-16,-8,0,32124,31100,30076,29052,28028,27004,25980,24956,23932,22908,21884,20860,19836,18812,17788,16764,15996,15484,14972,14460,13948,13436,12924,12412,11900,11388,10876,10364,9852,9340,8828,8316,7932,7676,7420,7164,6908,6652,6396,6140,5884,5628,5372,5116,4860,4604,4348,4092,3900,3772,3644,3516,3388,3260,3132,3004,2876,2748,2620,2492,2364,2236,2108,1980,1884,1820,1756,1692,1628,1564,1500,1436,1372,1308,1244,1180,1116,1052,988,924,876,844,812,780,748,716,684,652,620,588,556,524,492,460,428,396,372,356,340,324,308,292,276,260,244,228,212,196,180,164,148,132,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,0];t.decodeAlaw=function(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r<e.length;){var i=a[e[r]];if(void 0===i)throw new Error("can not decode g711 data!");t[n]=255&i,t[n+1]=i>>8,r+=1,n+=2}return t},t.decodeUlaw=function(e){for(var t=new Uint8Array(2*e.length),r=0,n=0;r<e.length;){var i=o[e[r]];if(void 0===i)throw new Error("can not decode g711 data!");t[n]=255&i,t[n+1]=i>>8,r+=1,n+=2}return t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var p=r(11),i=r(0),m=r(21),n=function(){function e(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return e.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(e){var t,r,n=p.default.getID3Data(e,0);if(n&&void 0!==p.default.getTimeStamp(n))for(t=n.length,r=Math.min(e.length-1,t+100);t<r;t++)if(m.default.probe(e,t))return i.logger.log("MPEG Audio sync word found !"),!0;return!1},e.prototype.append=function(e,t,r,n){for(var i=p.default.getID3Data(e,0),a=p.default.getTimeStamp(i),o=a?90*a:9e4*t,s=i.length,l=e.length,u=0,d=0,f=this._audioTrack,c=[{pts:o,dts:o,data:i}];s<l;)if(m.default.isHeader(e,s)){var h=m.default.appendFrame(f,e,s,o,u);if(!h)break;s+=h.length,d=h.sample.pts,u++}else p.default.isHeader(e,s)?(i=p.default.getID3Data(e,s),c.push({pts:d,dts:d,data:i}),s+=i.length):s++;this.remuxer.remux(f,{samples:[]},{samples:c,inputTimeScale:9e4},{samples:[]},t,r,n)},e.prototype.destroy=function(){},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var H=r(44),X=r(45),Z=r(1),Q=r(3),J=r(0),n=function(){function e(e,t,r,n){this.observer=e,this.config=t,this.typeSupported=r;var i=navigator.userAgent;this.isSafari=n&&-1<n.indexOf("Apple")&&i&&!i.match("CriOS"),this.ISGenerated=!1}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},e.prototype.resetInitSegment=function(){this.ISGenerated=!1},e.prototype.remux=function(e,t,r,n,i,a,o){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var s=e.samples.length,l=t.samples.length,u=i,d=i;if(s&&l){var f=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;u+=Math.max(0,f),d+=Math.max(0,-f)}if(s){e.timescale||(J.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var c=this.remuxAudio(e,u,a,o);if(l){var h=void 0;c&&(h=c.endPTS-c.startPTS),t.timescale||(J.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,d,a,h,o)}}else if(l){var p=this.remuxVideo(t,d,a,0,o);p&&e.codec&&this.remuxEmptyAudio(e,u,a,p)}}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(Z.default.FRAG_PARSED)},e.prototype.generateIS=function(e,t,r){var n,i,a=this.observer,o=e.samples,s=t.samples,l=this.typeSupported,u="audio/mp4",d={},f={tracks:d},c=void 0===this._initPTS;if(c&&(n=i=1/0),e.config&&o.length&&(e.timescale=e.samplerate,J.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(l.mpeg?(u="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3")),d.audio={container:u,codec:e.codec,initSegment:!e.isAAC&&l.mpeg?new Uint8Array:X.default.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(n=i=o[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&s.length){var h=t.inputTimeScale;t.timescale=h,d.video={container:"video/mp4",codec:t.codec,initSegment:X.default.initSegment([t]),metadata:{width:t.width,height:t.height}},c&&(n=Math.min(n,s[0].pts-h*r),i=Math.min(i,s[0].dts-h*r),this.observer.trigger(Z.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(d).length?(console.log("trigger INIT Segment",f),a.trigger(Z.default.FRAG_PARSING_INIT_SEGMENT,f),this.ISGenerated=!0,c&&(this._initPTS=n,this._initDTS=i)):a.trigger(Z.default.ERROR,{type:Q.ErrorTypes.MEDIA_ERROR,details:Q.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},e.prototype.remuxVideo=function(e,t,r,n,i){var a,o,s,l,u,d,f,c=8,h=e.timescale,p=e.samples,m=[],g=p.length,y=this._PTSNormalize,v=this._initPTS,_=this.nextAvcDts,b=this.isSafari;if(0!==g){b&&(r|=p.length&&_&&(i&&Math.abs(t-_/h)<.1||Math.abs(p[0].pts-_-v)<h/5)),r||(_=t*h),p.forEach(function(e){e.pts=y(e.pts-v,_),e.dts=y(e.dts-v,_)}),p.sort(function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id});var S=p.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(S<0){J.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(S/90)+" ms to overcome this issue");for(var E=0;E<p.length;E++)p[E].dts+=S}var w=p[0];u=Math.max(w.dts,0),l=Math.max(w.pts,0);var T=Math.round((u-_)/90);r&&T&&(1<T?J.logger.log("AVC:"+T+" ms hole between fragments detected,filling it"):T<-1&&J.logger.log("AVC:"+-T+" ms overlapping between fragments detected"),u=_,p[0].dts=u,l=Math.max(l-T,_),p[0].pts=l,J.logger.log("Video/PTS/DTS adjusted: "+Math.round(l/90)+"/"+Math.round(u/90)+",delta:"+T+" ms")),w=p[p.length-1],f=Math.max(w.dts,0),d=Math.max(w.pts,0,f),b&&(a=Math.round((f-u)/(p.length-1)));var A=0,x=0;for(E=0;E<g;E++){for(var L=p[E],R=L.units,I=R.length,C=0,D=0;D<I;D++)C+=R[D].data.length;x+=C,A+=I,L.length=C,L.dts=b?u+E*a:Math.max(L.dts,u),L.pts=Math.max(L.pts,L.dts)}var U=x+4*A+8;try{o=new Uint8Array(U)}catch(e){return void this.observer.trigger(Z.default.ERROR,{type:Q.ErrorTypes.MUX_ERROR,details:Q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:U,reason:"fail allocating video mdat "+U})}var P=new DataView(o.buffer);for(P.setUint32(0,U),o.set(X.default.types.mdat,4),E=0;E<g;E++){var k=p[E],O=k.units,M=0,F=void 0;for(D=0,I=O.length;D<I;D++){var B=O[D],N=B.data,z=B.data.byteLength;P.setUint32(c,z),c+=4,o.set(N,c),c+=z,M+=4+z}if(b)F=Math.max(0,a*Math.round((k.pts-k.dts)/a));else{if(E<g-1)a=p[E+1].dts-k.dts;else{var j=this.config,G=k.dts-p[0<E?E-1:E].dts;if(j.stretchShortVideoTrack){var H=j.maxBufferHole,q=Math.floor(H*h),V=(n?l+n*h:this.nextAudioPts)-k.pts;q<V?((a=V-G)<0&&(a=G),J.logger.log("It is approximately "+V/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=G}else a=G}F=Math.round(k.pts-k.dts)}m.push({size:M,duration:a,cts:F,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:k.key?2:1,isNonSync:k.key?0:1}})}this.nextAvcDts=f+a;var W=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,m.length&&-1<navigator.userAgent.toLowerCase().indexOf("chrome")){var Y=m[0].flags;Y.dependsOn=2,Y.isNonSync=0}e.samples=m,s=X.default.moof(e.sequenceNumber++,u,e),e.samples=[];var K={data1:s,data2:o,startPTS:l/h,endPTS:(d+a)/h,startDTS:u/h,endDTS:this.nextAvcDts/h,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:W};return this.observer.trigger(Z.default.FRAG_PARSING_DATA,K),K}},e.prototype.remuxAudio=function(e,t,r,n){var i,a,o,s,l,u,d,f=e.inputTimeScale,c=e.timescale,h=f/c,p=(e.isAAC?1024:1152)*h,m=this._PTSNormalize,g=this._initPTS,y=!e.isAAC&&this.typeSupported.mpeg,v=e.samples,_=[],b=this.nextAudioPts;if(r|=v.length&&b&&(n&&Math.abs(t-b/f)<.1||Math.abs(v[0].pts-b-g)<20*p),v.forEach(function(e){e.pts=e.dts=m(e.pts-g,t*f)}),0!==(v=v.filter(function(e){return 0<=e.pts})).length){if(r||(b=n?t*f:v[0].pts),e.isAAC)for(var S=this.config.maxAudioFramesDrift,E=0,w=b;E<v.length;){var T,A=v[E];T=(P=A.pts)-w;var x=Math.abs(1e3*T/f);if(T<=-S*p)J.logger.warn("Dropping 1 audio frame @ "+(w/f).toFixed(3)+"s due to "+Math.round(x)+" ms overlap."),v.splice(E,1),e.len-=A.unit.length;else if(S*p<=T&&x<1e4&&w){var L=Math.round(T/p);J.logger.warn("Injecting "+L+" audio frame @ "+(w/f).toFixed(3)+"s due to "+Math.round(1e3*T/f)+" ms gap.");for(var R=0;R<L;R++){var I=Math.max(w,0);(o=H.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(J.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=A.unit.subarray()),v.splice(E,0,{unit:o,pts:I,dts:I}),e.len+=o.length,w+=p,E++}A.pts=A.dts=w,w+=p,E++}else A.pts=A.dts=w,w+=p,E++}R=0;for(var C=v.length;R<C;R++){var D=v[R],U=D.unit,P=D.pts;if(void 0!==d)a.duration=Math.round((P-d)/h);else{var k=Math.round(1e3*(P-b)/f),O=0;if(r&&e.isAAC&&k){if(0<k&&k<1e4)O=Math.round((P-b)/p),J.logger.log(k+" ms hole between AAC samples detected,filling it"),0<O&&((o=H.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(o=U.subarray()),e.len+=O*o.length);else if(k<-12){J.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(b/f).toFixed(3)+"s/"+(P/f).toFixed(3)+"s/"+-k+"ms"),e.len-=U.byteLength;continue}P=b}if(u=P,!(0<e.len))return;var M=y?e.len:e.len+8;i=y?0:8;try{s=new Uint8Array(M)}catch(e){return void this.observer.trigger(Z.default.ERROR,{type:Q.ErrorTypes.MUX_ERROR,details:Q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:M,reason:"fail allocating audio mdat "+M})}for(y||(new DataView(s.buffer).setUint32(0,M),s.set(X.default.types.mdat,4)),E=0;E<O;E++)(o=H.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(J.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=U.subarray()),s.set(o,i),i+=o.byteLength,a={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},_.push(a)}s.set(U,i);var F=U.byteLength;i+=F,a={size:F,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},_.push(a),d=P}var B=0,N=_.length;if(2<=N&&(B=_[N-2].duration,a.duration=B),N){this.nextAudioPts=b=d+h*B,e.len=0,e.samples=_,l=y?new Uint8Array:X.default.moof(e.sequenceNumber++,u/h,e),e.samples=[];var z=u/f,j=b/f,G={data1:l,data2:s,startPTS:z,endPTS:j,startDTS:z,endDTS:j,type:"audio",hasAudio:!0,hasVideo:!1,nb:N};return this.observer.trigger(Z.default.FRAG_PARSING_DATA,G),G}return null}},e.prototype.remuxEmptyAudio=function(e,t,r,n){var i=e.inputTimeScale,a=i/(e.samplerate?e.samplerate:i),o=this.nextAudioPts,s=(void 0!==o?o:n.startDTS*i)+this._initDTS,l=n.endDTS*i+this._initDTS,u=1024*a,d=Math.ceil((l-s)/u),f=H.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(J.logger.warn("remux empty Audio"),f){for(var c=[],h=0;h<d;h++){var p=s+h*u;c.push({unit:f,pts:p,dts:p}),e.len+=f.length}e.samples=c,this.remuxAudio(e,t,r)}else J.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")},e.prototype.remuxID3=function(e){var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS,a=this._initDTS;if(r){for(var o=0;o<r;o++)(t=e.samples[o]).pts=(t.pts-i)/n,t.dts=(t.dts-a)/n;this.observer.trigger(Z.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]},e.prototype.remuxText=function(e){e.samples.sort(function(e,t){return e.pts-t.pts});var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS;if(r){for(var a=0;a<r;a++)(t=e.samples[a]).pts=(t.pts-i)/n;this.observer.trigger(Z.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]},e.prototype._PTSNormalize=function(e,t){var r;if(void 0===t)return e;for(r=t<e?-8589934592:8589934592;4294967296<Math.abs(e-t);)e+=r;return e},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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]);break;default:if(1===t)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===t)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===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var s=Math.pow(2,32)-1,n=function(){function c(){}return c.init=function(){var e;for(e in c.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]})c.types.hasOwnProperty(e)&&(c.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);c.HDLR_TYPES={video:t,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);c.STTS=c.STSC=c.STCO=i,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);c.FTYP=c.box(c.types.ftyp,a,s,a,o),c.DINF=c.box(c.types.dinf,c.box(c.types.dref,n))},c.box=function(e){for(var t,r=Array.prototype.slice.call(arguments,1),n=8,i=r.length,a=i;i--;)n+=r[i].byteLength;for((t=new Uint8Array(n))[0]=n>>24&255,t[1]=n>>16&255,t[2]=n>>8&255,t[3]=255&n,t.set(e,4),i=0,n=8;i<a;i++)t.set(r[i],n),n+=r[i].byteLength;return t},c.hdlr=function(e){return c.box(c.types.hdlr,c.HDLR_TYPES[e])},c.mdat=function(e){return c.box(c.types.mdat,e)},c.mdhd=function(e,t){t*=e;var r=Math.floor(t/(s+1)),n=Math.floor(t%(s+1));return c.box(c.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},c.mdia=function(e){return c.box(c.types.mdia,c.mdhd(e.timescale,e.duration),c.hdlr(e.type),c.minf(e))},c.mfhd=function(e){return c.box(c.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},c.minf=function(e){return"audio"===e.type?c.box(c.types.minf,c.box(c.types.smhd,c.SMHD),c.DINF,c.stbl(e)):c.box(c.types.minf,c.box(c.types.vmhd,c.VMHD),c.DINF,c.stbl(e))},c.moof=function(e,t,r){return c.box(c.types.moof,c.mfhd(e),c.traf(r,t))},c.moov=function(e){for(var t=e.length,r=[];t--;)r[t]=c.trak(e[t]);return c.box.apply(null,[c.types.moov,c.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(c.mvex(e)))},c.mvex=function(e){for(var t=e.length,r=[];t--;)r[t]=c.trex(e[t]);return c.box.apply(null,[c.types.mvex].concat(r))},c.mvhd=function(e,t){t*=e;var r=Math.floor(t/(s+1)),n=Math.floor(t%(s+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return c.box(c.types.mvhd,i)},c.sdtp=function(e){var t,r,n=e.samples||[],i=new Uint8Array(4+n.length);for(r=0;r<n.length;r++)t=n[r].flags,i[r+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return c.box(c.types.sdtp,i)},c.stbl=function(e){return c.box(c.types.stbl,c.stsd(e),c.box(c.types.stts,c.STTS),c.box(c.types.stsc,c.STSC),c.box(c.types.stsz,c.STSZ),c.box(c.types.stco,c.STCO))},c.avc1=function(e){var t,r,n,i=[],a=[];for(t=0;t<e.sps.length;t++)n=(r=e.sps[t]).byteLength,i.push(n>>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(r));for(t=0;t<e.pps.length;t++)n=(r=e.pps[t]).byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(r));var o=c.box(c.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(a))),s=e.width,l=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return c.box(c.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,c.box(c.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),c.box(c.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))},c.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},c.mp4a=function(e){var t=e.samplerate;return c.box(c.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),c.box(c.types.esds,c.esds(e)))},c.mp3=function(e){var t=e.samplerate;return c.box(c.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))},c.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?c.box(c.types.stsd,c.STSD,c.mp4a(e)):c.box(c.types.stsd,c.STSD,c.mp3(e)):c.box(c.types.stsd,c.STSD,c.avc1(e))},c.tkhd=function(e){var t=e.id,r=e.duration*e.timescale,n=e.width,i=e.height,a=Math.floor(r/(s+1)),o=Math.floor(r%(s+1));return c.box(c.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))},c.traf=function(e,t){var r=c.sdtp(e),n=e.id,i=Math.floor(t/(s+1)),a=Math.floor(t%(s+1));return c.box(c.types.traf,c.box(c.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),c.box(c.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a])),c.trun(e,r.length+16+20+8+16+8+8),r)},c.trak=function(e){return e.duration=e.duration||4294967295,c.box(c.types.trak,c.tkhd(e),c.mdia(e))},c.trex=function(e){var t=e.id;return c.box(c.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},c.trun=function(e,t){var r,n,i,a,o,s,l=e.samples||[],u=l.length,d=12+16*u,f=new Uint8Array(d);for(t+=8+d,f.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),r=0;r<u;r++)i=(n=l[r]).duration,a=n.size,o=n.flags,s=n.cts,f.set([i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12+16*r);return c.box(c.types.trun,f)},c.initSegment=function(e){c.types||c.init();var t,r=c.moov(e);return(t=new Uint8Array(c.FTYP.byteLength+r.byteLength)).set(c.FTYP),t.set(r,c.FTYP.byteLength),t},c}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),n=function(){function e(e){this.observer=e}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(){},e.prototype.resetInitSegment=function(){},e.prototype.remux=function(e,t,r,n,i,a,o,s){var l=this.observer,u="";e&&(u+="audio"),t&&(u+="video"),l.trigger(d.default.FRAG_PARSING_DATA,{data1:s,startPTS:i,startDTS:i,type:u,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),l.trigger(d.default.FRAG_PARSED)},e}();t.default=n},function(e,t,r){var n=Object.prototype.hasOwnProperty,h="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||e,i),o=h?h+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(h=!1)),o.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(h?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=h?h+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,a=new Array(i);n<i;n++)a[n]=r[n].fn;return a},o.prototype.listenerCount=function(e){var t=h?h+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,n,i,a){var o=h?h+e:e;if(!this._events[o])return!1;var s,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,i),!0;case 6:return u.fn.call(u.context,t,r,n,i,a),!0}for(l=1,s=new Array(d-1);l<d;l++)s[l-1]=arguments[l];u.fn.apply(u.context,s)}else{var f,c=u.length;for(l=0;l<c;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,n);break;default:if(!s)for(f=1,s=new Array(d-1);f<d;f++)s[f-1]=arguments[f];u[l].fn.apply(u[l].context,s)}}return!0},o.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,r,n){var i=h?h+e:e;if(!this._events[i])return this;if(!t)return u(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||u(this,i);else{for(var o=0,s=[],l=a.length;o<l;o++)(a[o].fn!==t||n&&!a[o].once||r&&a[o].context!==r)&&s.push(a[o]);s.length?this._events[i]=1===s.length?s[0]:s:u(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=h?h+e:e,this._events[t]&&u(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=h,o.EventEmitter=o,e.exports=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(18),s=r(1),l=r(0),u=r(49);t.default=function(i){var n=new u.EventEmitter;n.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];n.emit.apply(n,[e,e].concat(t))},n.off=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];n.removeListener.apply(n,[e].concat(t))};var a=function(e,t){i.postMessage({event:e,data:t})};i.addEventListener("message",function(e){var t=e.data;switch(t.cmd){case"init":var r=JSON.parse(t.config);i.demuxer=new o.default(n,t.typeSupported,r,t.vendor),l.enableLogs(r.debug),a("init",null);break;case"demux":i.demuxer.push(t.data,t.decryptdata,t.initSegment,t.audioCodec,t.videoCodec,t.timeOffset,t.discontinuity,t.trackSwitch,t.contiguous,t.duration,t.accurateTimeOffset,t.defaultInitPTS)}}),n.on(s.default.FRAG_DECRYPTED,a),n.on(s.default.FRAG_PARSING_INIT_SEGMENT,a),n.on(s.default.FRAG_PARSED,a),n.on(s.default.ERROR,a),n.on(s.default.FRAG_PARSING_METADATA,a),n.on(s.default.FRAG_PARSING_USERDATA,a),n.on(s.default.INIT_PTS_FOUND,a),n.on(s.default.FRAG_PARSING_DATA,function(e,t){var r=[],n={event:e,data:t};t.data1&&(n.data1=t.data1.buffer,r.push(t.data1.buffer),delete t.data1),t.data2&&(n.data2=t.data2.buffer,r.push(t.data2.buffer),delete t.data2),i.postMessage(n,r)})}},function(h,e,t){(function(e){var t,r="object"==typeof Reflect?Reflect:null,d=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=e.isNaN||function(e){return e!=e};function i(){i.init.call(this)}((h.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function o(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),0<(i=u(e))&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function s(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,d(this.listener,this.target,e))}.bind(n);return i.listener=r,n.wrapFn=i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):c(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function c(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(0<t.length&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)d(s,this,t);else{var l=s.length,u=c(s,l);for(r=0;r<l;++r)d(u[r],this,t)}return!0},i.prototype.on=i.prototype.addListener=function(e,t){return o(this,e,t,!1)},i.prototype.prependListener=function(e,t){return o(this,e,t,!0)},i.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,s(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,s(this,e,t)),this},i.prototype.off=i.prototype.removeListener=function(e,t){var r,n,i,a,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;0<=a;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;0<=n;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return l(this,e,!0)},i.prototype.rawListeners=function(e){return l(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return 0<this._eventsCount?t(this._events):[]}}).call(this,t(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default={toString:function(e){for(var t="",r=e.length,n=0;n<r;n++)t+="["+e.start(n).toFixed(3)+","+e.end(n).toFixed(3)+"]";return t}}},function(e,t,f){(function(i){Object.defineProperty(t,"__esModule",{value:!0});var r=f(10),a=f(0);function o(e,t){for(var r=null,n=0;n<e.length;n+=1){var i=e[n];if(i&&i.cc===t){r=i;break}}return r}function s(e,t,r){var n=!1;return t&&t.details&&r&&(r.endCC>r.startCC||e&&e.cc<r.startCC)&&(n=!0),n}function l(e,t){var r=e.fragments,n=t.fragments;if(n.length&&r.length){var i=o(r,n[0].cc);if(i&&(!i||i.startPTS))return i;a.logger.log("No frag in previous level to align on")}else a.logger.log("No fragments to align")}function u(r,e){e.fragments.forEach(function(e){if(e){var t=e.start+r;e.start=e.startPTS=t,e.endPTS=t+e.duration}}),e.PTSKnown=!0}function n(e,t,r){if(s(e,r,t)){var n=l(r.details,t);n&&(a.logger.log("Adjusting PTS using last level due to CC increase within current level"),u(n.start,t))}}function d(e,t){if(t&&t.fragments.length){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;var r=t.fragments[0].programDateTime,n=(e.fragments[0].programDateTime-r)/1e3+t.fragments[0].start;i.isFinite(n)&&(a.logger.log("adjusting PTS using programDateTime delta, sliding:"+n.toFixed(3)),u(n,e))}}t.findFirstFragWithCC=o,t.findFragWithCC=function(e,t){return r.default.search(e,function(e){return e.cc<t?1:e.cc>t?-1:0})},t.shouldAlignOnDiscontinuities=s,t.findDiscontinuousReferenceFrag=l,t.adjustPts=u,t.alignStream=function(e,t,r){n(e,r,t),!r.PTSKnown&&t&&d(r,t.details)},t.alignDiscontinuities=n,t.alignPDT=d}).call(this,f(2).Number)},function(e,t,r){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var o=r(10);function s(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function l(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-n>e}t.findFragmentByPDT=function(e,t,r){if(!Array.isArray(e)||!e.length||!a.isFinite(t))return null;if(t<e[0].programDateTime)return null;if(t>=e[e.length-1].endProgramDateTime)return null;r=r||0;for(var n=0;n<e.length;++n){var i=e[n];if(l(t,r,i))return i}return null},t.findFragmentByPTS=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=e?t[e.sn-t[0].sn+1]:null;return i&&!s(r,n,i)?i:o.default.search(t,s.bind(null,r,n))},t.fragmentWithinToleranceTest=s,t.pdtWithinToleranceTest=l}).call(this,r(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var l=r(8),s=r(3),u=r(1),d=r(0),n=function(){function e(e,t,r,n){this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n,this.stallReported=!1}return e.prototype.poll=function(e,t){var r=this.config,n=this.media,i=n.currentTime,a=window.performance.now();if(i!==e)return this.stallReported&&(d.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(a-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(n.ended||!n.buffered.length||2<n.readyState||n.seeking&&l.BufferHelper.isBuffered(n,i))){var o=a-this.stalled,s=l.BufferHelper.bufferInfo(n,i,r.maxBufferHole);this.stalled?(1e3<=o&&this._reportStall(s.len),this._tryFixBufferStall(s,o)):this.stalled=a}},e.prototype._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media.currentTime,a=n.getPartialFragment(i);a&&this._trySkipBufferHole(a),.5<e.len&&t>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,d.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(u.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},e.prototype._trySkipBufferHole=function(e){for(var t=this.hls,r=this.media,n=r.currentTime,i=0,a=0;a<r.buffered.length;a++){var o=r.buffered.start(a);if(i<=n&&n<o)return r.currentTime=Math.max(o,r.currentTime+.1),d.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+r.currentTime),this.stalled=null,void t.trigger(u.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+r.currentTime,frag:e});i=r.buffered.end(a)}},e.prototype._tryNudgeBuffer=function(){var e=this.config,t=this.hls,r=this.media,n=r.currentTime,i=(this.nudgeRetry||0)+1;if((this.nudgeRetry=i)<e.nudgeMaxRetry){var a=n+i*e.nudgeOffset;d.logger.log("adjust currentTime from "+n+" to "+a),r.currentTime=a,t.trigger(u.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else d.logger.error("still stuck in high buffer @"+n+" after "+e.nudgeMaxRetry+", raise fatal error"),t.trigger(u.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},e}();t.default=n},function(e,h,i){(function(d){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(h,"__esModule",{value:!0});var e=i(55),a=i(9),f=i(8),c=i(0);h.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};var t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.doTick=function(){},t.prototype._streamEnded=function(e,t){var r=this.fragCurrent,n=this.fragmentTracker;if(t.live||!r||r.backtracked||r.sn!==t.endSN||e.nextStart)return!1;var i=n.getState(r);return i===a.FragmentState.PARTIAL||i===a.FragmentState.OK},t.prototype.onMediaSeeking=function(){var e=this.config,t=this.media,r=this.mediaBuffer,n=this.state,i=t?t.currentTime:null,a=f.BufferHelper.bufferInfo(r||t,i,this.config.maxBufferHole);if(d.isFinite(i)&&c.logger.log("media seeking to "+i.toFixed(3)),n===h.State.FRAG_LOADING){var o=this.fragCurrent;if(0===a.len&&o){var s=e.maxFragLookUpTolerance,l=o.start-s,u=o.start+o.duration+s;i<l||u<i?(o.loader&&(c.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),o.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=h.State.IDLE):c.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else n===h.State.ENDED&&(0===a.len&&(this.fragPrevious=null,this.fragCurrent=null),this.state=h.State.IDLE);t&&(this.lastCurrentTime=i),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=i),this.tick()},t.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},t}(e.default);h.default=t}).call(this,i(2).Number)},function(e,t,r){var n,a=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(i){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=i.apply(this,[e].concat(t))||this;return n._tickInterval=null,n._tickTimer=null,n._tickCallCount=0,n._boundTick=n.tick.bind(n),n}return a(e,i),e.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.prototype.hasInterval=function(){return!!this._tickInterval},e.prototype.hasNextTick=function(){return!!this._tickTimer},e.prototype.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,e),!0)},e.prototype.clearInterval=function(){return!(!this._tickInterval||(clearInterval(this._tickInterval),this._tickInterval=null))},e.prototype.clearNextTick=function(){return!(!this._tickTimer||(clearTimeout(this._tickTimer),this._tickTimer=null))},e.prototype.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),1<this._tickCallCount&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},e.prototype.doTick=function(){},e}(r(4).default);t.default=i},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(1),a=r(4),f=r(0),c=r(3),h=r(17),p=r(23),l=window.performance,o=function(r){function e(e){var t=r.call(this,e,d.default.MANIFEST_LOADED,d.default.LEVEL_LOADED,d.default.AUDIO_TRACK_SWITCHED,d.default.FRAG_LOADED,d.default.ERROR)||this;return t.canload=!1,t.currentLevelIndex=null,t.manualLevelIndex=-1,t.timer=null,u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),t}return i(e,r),e.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},e.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.startLoad=function(){var e=this._levels;this.canload=!0,this.levelRetryCount=0,e&&e.forEach(function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)}),null!==this.timer&&this.loadLevel()},e.prototype.stopLoad=function(){this.canload=!1},e.prototype.onManifestLoaded=function(e){var t,r=[],n=[],i={},a=null,o=!1,s=!1;if(e.levels.forEach(function(e){var t=e.attrs;e.loadError=0,e.fragmentError=!1,o=o||!!e.videoCodec,s=s||!!e.audioCodec,u&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(a=i[e.bitrate])?a.url.push(e.url):(e.url=[e.url],e.urlId=0,i[e.bitrate]=e,r.push(e)),t&&(t.AUDIO&&(s=!0,p.addGroupId(a||e,"audio",t.AUDIO)),t.SUBTITLES&&p.addGroupId(a||e,"text",t.SUBTITLES))}),o&&s&&(r=r.filter(function(e){return!!e.videoCodec})),r=r.filter(function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||h.isCodecSupportedInMp4(t,"audio"))&&(!r||h.isCodecSupportedInMp4(r,"video"))}),e.audioTracks&&(n=e.audioTracks.filter(function(e){return!e.audioCodec||h.isCodecSupportedInMp4(e.audioCodec,"audio")})).forEach(function(e,t){e.id=t}),0<r.length){t=r[0].bitrate,r.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=r;for(var l=0;l<r.length;l++)if(r[l].bitrate===t){this._firstLevel=l,f.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+t);break}this.hls.trigger(d.default.MANIFEST_PARSED,{levels:r,audioTracks:n,firstLevel:this._firstLevel,stats:e.stats,audio:s,video:o,altAudio:n.some(function(e){return!!e.url})})}else this.hls.trigger(d.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},Object.defineProperty(e.prototype,"levels",{get:function(){return this._levels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;t&&(e=Math.min(e,t.length-1),this.currentLevelIndex===e&&t[e].details||this.setLevelInternal(e))},enumerable:!0,configurable:!0}),e.prototype.setLevelInternal=function(e){var t=this._levels,r=this.hls;if(0<=e&&e<t.length){if(this.clearTimer(),this.currentLevelIndex!==e){f.logger.log("switching to level "+e),this.currentLevelIndex=e;var n=t[e];n.level=e,r.trigger(d.default.LEVEL_SWITCHING,n)}var i=t[e],a=i.details;if(!a||a.live){var o=i.urlId;r.trigger(d.default.LEVEL_LOADING,{url:i.url[o],level:e,id:o})}}else r.trigger(d.default.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})},Object.defineProperty(e.prototype,"manualLevel",{get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLevel",{get:function(){return this._firstLevel},set:function(e){this._firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startLevel",{get:function(){if(void 0!==this._startLevel)return this._startLevel;var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel},set:function(e){this._startLevel=e},enumerable:!0,configurable:!0}),e.prototype.onError=function(e){if(e.fatal)e.type===c.ErrorTypes.NETWORK_ERROR&&this.clearTimer();else{var t,r=!1,n=!1;switch(e.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:t=e.frag.level,n=!0;break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:t=e.context.level,r=!0;break;case c.ErrorDetails.REMUX_ALLOC_ERROR:t=e.level,r=!0}void 0!==t&&this.recoverLevel(e,t,r,n)}},e.prototype.recoverLevel=function(e,t,r,n){var i,a,o,s=this,l=this.hls.config,u=e.details,d=this._levels[t];if(d.loadError++,d.fragmentError=n,r){if(!(this.levelRetryCount+1<=l.levelLoadingMaxRetry))return f.logger.error("level controller, cannot recover from "+u+" error"),this.currentLevelIndex=null,this.clearTimer(),void(e.fatal=!0);a=Math.min(Math.pow(2,this.levelRetryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return s.loadLevel()},a),e.levelRetry=!0,this.levelRetryCount++,f.logger.warn("level controller, "+u+", retry in "+a+" ms, current retry count is "+this.levelRetryCount)}(r||n)&&(1<(i=d.url.length)&&d.loadError<i?(d.urlId=(d.urlId+1)%i,d.details=void 0,f.logger.warn("level controller, "+u+" for level "+t+": switching to redundant URL-id "+d.urlId)):-1===this.manualLevelIndex?(o=0===t?this._levels.length-1:t-1,f.logger.warn("level controller, "+u+": switch to "+o),this.hls.nextAutoLevel=this.currentLevelIndex=o):n&&(f.logger.warn("level controller, "+u+": reload a fragment"),this.currentLevelIndex=null))},e.prototype.onFragLoaded=function(e){var t=e.frag;if(void 0!==t&&"main"===t.type){var r=this._levels[t.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},e.prototype.onLevelLoaded=function(e){var t=this,r=e.level;if(r===this.currentLevelIndex){var n=this._levels[r];n.fragmentError||(n.loadError=0,this.levelRetryCount=0);var i=e.details;if(i.live){var a=1e3*(i.averagetargetduration?i.averagetargetduration:i.targetduration),o=a,s=n.details;s&&i.endSN===s.endSN&&(o/=2,f.logger.log("same live playlist, reload twice faster")),o-=l.now()-e.stats.trequest,o=Math.max(a/2,Math.round(o)),f.logger.log("live playlist, reload in "+Math.round(o)+" ms"),this.timer=setTimeout(function(){return t.loadLevel()},o)}else this.clearTimer()}},e.prototype.onAudioTrackSwitched=function(e){var t=this.hls.audioTracks[e.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){var n=r.audioGroupIds.findIndex(function(e){return e===t});n!==r.urlId&&(r.urlId=n,this.startLoad())}},e.prototype.loadLevel=function(){if(f.logger.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var e=this._levels[this.currentLevelIndex];if("object"==typeof e&&0<e.url.length){var t=this.currentLevelIndex,r=e.urlId,n=e.url[r];f.logger.log("Attempt loading level index "+t+" with URL-id "+r),this.hls.trigger(d.default.LEVEL_LOADING,{url:n,level:t,id:r})}}},Object.defineProperty(e.prototype,"nextLoadLevel",{get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)},enumerable:!0,configurable:!0}),e}(a.default);t.default=o},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),o=r(4),f=r(11),s=r(58),l=function(r){function e(e){var t=r.call(this,e,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.FRAG_PARSING_METADATA)||this;return t.id3Track=void 0,t.media=void 0,t}return i(e,r),e.prototype.destroy=function(){o.default.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(e){this.media=e.media,this.media},e.prototype.onMediaDetaching=function(){s.clearCurrentCues(this.id3Track),this.id3Track=void 0,this.media=void 0},e.prototype.getID3Track=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return s.sendAddTrackEvent(r,this.media),r}return this.media.addTextTrack("metadata","id3")},e.prototype.onFragParsingMetadata=function(e){var t=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,i=0;i<r.length;i++){var a=f.default.getID3Frames(r[i].data);if(a){var o=r[i].pts,s=i<r.length-1?r[i+1].pts:t.endPTS;o===s&&(s+=1e-4);for(var l=0;l<a.length;l++){var u=a[l];if(!f.default.isTimeStampFrame(u)){var d=new n(o,s,"");d.value=u,this.id3Track.addCue(d)}}}}},e}(o.default);t.default=l},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.sendAddTrackEvent=function(e,t){var r=null;try{r=new window.Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)},t.clearCurrentCues=function(e){if(e&&e.cues)for(;0<e.cues.length;)e.removeCue(e.cues[0])}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var i=r(12);t.isSupported=function(){var e=i.getMediaSource(),t=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!n}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(61),i=r(64),a=r(65),o=r(66),s=r(67),l=(r(5),r(5),r(5),r(5),r(5),r(5),r(5),r(68));t.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:n.default,bufferController:i.default,capLevelController:a.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:l.requestMediaKeySystemAccess,qiniuDRMKey:void 0,g711WasmModule:void 0}},function(e,r,l){(function(o){var n,t=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var _=l(1),i=l(4),b=l(8),a=l(3),S=l(0),s=l(62),E=window.performance,e=function(r){function e(e){var t=r.call(this,e,_.default.FRAG_LOADING,_.default.FRAG_LOADED,_.default.FRAG_BUFFERED,_.default.ERROR)||this;return t.lastLoadedFragLevel=0,t._nextAutoLevel=-1,t.hls=e,t.timer=null,t._bwEstimator=null,t.onCheck=t._abandonRulesCheck.bind(t),t}return t(e,r),e.prototype.destroy=function(){this.clearTimer(),i.default.prototype.destroy.call(this)},e.prototype.onFragLoading=function(e){var t=e.frag;if("main"===t.type&&(this.timer||(this.fragCurrent=t,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,n=r.config,i=t.level,a=void 0,o=void 0;o=r.levels[i].details.live?(a=n.abrEwmaFastLive,n.abrEwmaSlowLive):(a=n.abrEwmaFastVoD,n.abrEwmaSlowVoD),this._bwEstimator=new s.default(r,o,a,n.abrEwmaDefaultEstimate)}},e.prototype._abandonRulesCheck=function(){var e=this.hls,t=e.media,r=this.fragCurrent;if(r){var n=r.loader,i=e.minAutoLevel;if(!n||n.stats&&n.stats.aborted)return S.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var a=n.stats;if(t&&a&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&r.autoLevel&&r.level){var o=E.now()-a.trequest,s=Math.abs(t.playbackRate);if(o>500*r.duration/s){var l=e.levels,u=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),d=l[r.level],f=d.realBitrate?Math.max(d.realBitrate,d.bitrate):d.bitrate,c=a.total?a.total:Math.max(a.loaded,Math.round(r.duration*f/8)),h=t.currentTime,p=(c-a.loaded)/u,m=(b.BufferHelper.bufferInfo(t,h,e.config.maxBufferHole).end-h)/s;if(m<2*r.duration/s&&m<p){var g=void 0,y=void 0;for(y=r.level-1;i<y;y--){var v=l[y].realBitrate?Math.max(l[y].realBitrate,l[y].bitrate):l[y].bitrate;if((g=r.duration*v/(6.4*u))<m)break}g<p&&(S.logger.warn("loading too slow, abort fragment loading and switch to level "+y+":fragLoadedDelay["+y+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+g.toFixed(1)+"<"+p.toFixed(1)+":"+m.toFixed(1)),e.nextLoadLevel=y,this._bwEstimator.sample(o,a.loaded),n.abort(),this.clearTimer(),e.trigger(_.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:a}))}}}}},e.prototype.onFragLoaded=function(e){var t=e.frag;if("main"===t.type&&o.isFinite(t.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=this.hls.levels[t.level],n=(r.loaded?r.loaded.bytes:0)+e.stats.loaded,i=(r.loaded?r.loaded.duration:0)+e.frag.duration;r.loaded={bytes:n,duration:i},r.realBitrate=Math.round(8*n/i)}if(e.frag.bitrateTest){var a=e.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(e)}}},e.prototype.onFragBuffered=function(e){var t=e.stats,r=e.frag;if(!0!==t.aborted&&"main"===r.type&&o.isFinite(r.sn)&&(!r.bitrateTest||t.tload===t.tbuffered)){var n=t.tparsed-t.trequest;S.logger.log("latency/loading/parsing/append/kbps:"+Math.round(t.tfirst-t.trequest)+"/"+Math.round(t.tload-t.tfirst)+"/"+Math.round(t.tparsed-t.tload)+"/"+Math.round(t.tbuffered-t.tparsed)+"/"+Math.round(8*t.loaded/(t.tbuffered-t.trequest))),this._bwEstimator.sample(n,t.loaded),t.bwEstimate=this._bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}},e.prototype.onError=function(e){switch(e.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},e.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},Object.defineProperty(e.prototype,"nextAutoLevel",{get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var r=this._nextABRAutoLevel;return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_nextABRAutoLevel",{get:function(){var e=this.hls,t=e.maxAutoLevel,r=e.levels,n=e.config,i=e.minAutoLevel,a=e.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,l=a?a.currentTime:0,u=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this._bwEstimator?this._bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,f=(b.BufferHelper.bufferInfo(a,l,n.maxBufferHole).end-l)/u,c=this._findBestLevel(o,s,d,i,t,f,n.abrBandWidthFactor,n.abrBandWidthUpFactor,r);if(0<=c)return c;S.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var h=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,p=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(0===f){var g=this.bitrateTestDelay;g&&(h=(s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay)-g,S.logger.trace("bitrate test took "+Math.round(1e3*g)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*h)+" ms"),p=m=1)}return c=this._findBestLevel(o,s,d,i,t,f+h,p,m,r),Math.max(c,0)},enumerable:!0,configurable:!0}),e.prototype._findBestLevel=function(e,t,r,n,i,a,o,s,l){for(var u=i;n<=u;u--){var d=l[u];if(d){var f=d.details,c=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,p=void 0;p=u<=e?o*r:s*r;var m=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,g=m*c/p;if(S.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(p)+"/"+m+"/"+c+"/"+a+"/"+g),m<p&&(!g||h&&!this.bitrateTestDelay||g<a))return u}}return-1},e}(i.default);r.default=e}).call(this,l(2).Number)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var i=r(63),n=function(){function e(e,t,r,n){this.hls=e,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(t),this.fast_=new i.default(r)}return e.prototype.sample=function(e,t){var r=8e3*t/(e=Math.max(e,this.minDelayMs_)),n=e/1e3;this.fast_.sample(n,r),this.slow_.sample(n,r)},e.prototype.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},e.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.prototype.destroy=function(){},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return e.prototype.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},e.prototype.getTotalWeight=function(){return this.totalWeight_},e.prototype.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_},e}();t.default=n},function(e,r,s){(function(n){var i,t=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var l=s(1),a=s(4),u=s(0),d=s(3),o=s(12).getMediaSource(),e=function(r){function e(e){var t=r.call(this,e,l.default.MEDIA_ATTACHING,l.default.MEDIA_DETACHING,l.default.MANIFEST_PARSED,l.default.BUFFER_RESET,l.default.BUFFER_APPENDING,l.default.BUFFER_CODECS,l.default.BUFFER_EOS,l.default.BUFFER_FLUSHING,l.default.LEVEL_PTS_UPDATED,l.default.LEVEL_UPDATED)||this;return t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t.bufferCodecEventsExpected=0,t.onsbue=t.onSBUpdateEnd.bind(t),t.onsbe=t.onSBUpdateError.bind(t),t.pendingTracks={},t.tracks={},t}return t(e,r),e.prototype.destroy=function(){a.default.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio;if(.1<Math.abs(n.timestampOffset-e.start)){var i=n.updating;try{n.abort()}catch(e){u.logger.warn("can not abort audio buffer: "+e)}i?this.audioTimestampOffset=e.start:(u.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}},e.prototype.onManifestParsed=function(e){this.bufferCodecEventsExpected=e.altAudio?2:1,u.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.prototype.onMediaAttaching=function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new o;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=window.URL.createObjectURL(r),this._objectUrl=t.src}},e.prototype.onMediaDetaching=function(){u.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){u.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):u.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(l.default.MEDIA_DETACHED)},e.prototype.onMediaSourceOpen=function(){u.logger.log("media source opened"),this.hls.trigger(l.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},e.prototype.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.pendingTracks,r=Object.keys(t).length;(r&&!e||2===r)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},e.prototype.onMediaSourceClose=function(){u.logger.log("media source closed")},e.prototype.onMediaSourceEnded=function(){u.logger.log("media source ended")},e.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;u.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var r=this.parent,t=this.segments.reduce(function(e,t){return t.parent===r?e+1:e},0),n={},i=this.sourceBuffer;for(var a in i)n[a]=i[a].buffered;this.hls.trigger(l.default.BUFFER_APPENDED,{parent:r,pending:t,timeRanges:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),0===t&&this.flushLiveBackBuffer()},e.prototype.onSBUpdateError=function(e){u.logger.error("sourceBuffer error:",e),this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferReset=function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},e.prototype.onBufferCodecs=function(t){var r=this;if(!Object.keys(this.sourceBuffer).length){Object.keys(t).forEach(function(e){r.pendingTracks[e]=t[e]});var e=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),e&&"open"===e.readyState&&this.checkPendingTracks()}},e.prototype.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var i=e[n],a=i.levelCodec||i.codec,o=i.container+";codecs="+a;u.logger.log("creating sourceBuffer("+o+")");try{var s=t[n]=r.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[n]={codec:a,container:i.container},i.buffer=s}catch(e){u.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:o})}}this.hls.trigger(l.default.BUFFER_CREATED,{tracks:e})},e.prototype.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},e.prototype.onBufferAppendFail=function(e){u.logger.error("sourceBuffer error:",e.event),this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferEos=function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,u.logger.log(n+" sourceBuffer now EOS"));this.checkEos()},e.prototype.checkEos=function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}u.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){u.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1},e.prototype.onBufferFlushing=function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()},e.prototype.flushLiveBackBuffer=function(){if(this._live){var e=this.hls.config.liveBackBufferLength;if(isFinite(e)&&!(e<0))for(var t=this.media.currentTime,r=this.sourceBuffer,n=Object.keys(r),i=t-Math.max(e,this._levelTargetDuration),a=n.length-1;0<=a;a--){var o=n[a],s=r[o].buffered;0<s.length&&i>s.start(0)&&this.removeBufferRange(o,r[o],0,i)}}},e.prototype.onLevelUpdated=function(e){var t=e.details;0<t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this._levelTargetDuration=t.averagetargetduration||t.targetduration||10,this._live=t.live,this.updateMediaElementDuration())},e.prototype.updateMediaElementDuration=function(){var e,t=this.hls.config;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(!0===this.sourceBuffer[r].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===t.liveDurationInfinity?(u.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||!n.isFinite(e))&&(u.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(e){u.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(l.default.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var e=this.hls,t=this.segments,r=this.sourceBuffer;if(Object.keys(r).length){if(this.media.error)return this.segments=[],void u.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(t&&t.length){var n=t.shift();try{var i=r[n.type];i?i.updating?t.unshift(n):(i.ended=!1,this.parent=n.parent,i.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(r){u.logger.error("error while trying to append buffer:"+r.message),t.unshift(n);var a={type:d.ErrorTypes.MEDIA_ERROR,parent:n.parent};22!==r.code?(this.appendError?this.appendError++:this.appendError=1,a.details=d.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(u.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],a.fatal=!0):a.fatal=!1):(this.segments=[],a.details=d.ErrorDetails.BUFFER_FULL_ERROR,a.fatal=!1),e.trigger(l.default.ERROR,a)}}}},e.prototype.flushBuffer=function(e,t,r){var n,i=this.sourceBuffer;if(Object.keys(i).length){if(u.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var a in i)if(!r||a===r){if((n=i[a]).ended=!1,n.updating)return u.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(a,n,e,t))return this.flushBufferCounter++,!1}}else u.logger.warn("abort flushing too many retries");u.logger.log("buffer flushed")}return!0},e.prototype.removeBufferRange=function(e,t,r,n){try{for(var i=0;i<t.buffered.length;i++){var a=t.buffered.start(i),o=t.buffered.end(i),s=Math.max(a,r),l=Math.min(o,n);if(.5<Math.min(l,o)-s)return u.logger.log("sb remove "+e+" ["+s+","+l+"], of ["+a+","+o+"], pos:"+this.media.currentTime),t.remove(s,l),!0}}catch(e){u.logger.warn("removeBufferRange failed",e)}return!1},e}(a.default);r.default=e}).call(this,s(2).Number)},function(e,r,o){(function(n){var i,e=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var a=o(1),t=function(r){function i(e){var t=r.call(this,e,a.default.FPS_DROP_LEVEL_CAPPING,a.default.MEDIA_ATTACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_CODECS,a.default.MEDIA_DETACHING)||this;return t.autoLevelCapping=n.POSITIVE_INFINITY,t.firstLevel=null,t.levels=[],t.media=null,t.restrictedLevels=[],t.timer=null,t}return e(i,r),i.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},i.prototype.onFpsDropLevelCapping=function(e){i.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)},i.prototype.onMediaAttaching=function(e){this.media=e.media instanceof window.HTMLVideoElement?e.media:null},i.prototype.onManifestParsed=function(e){var t=this.hls;this.restrictedLevels=[],this.levels=e.levels,this.firstLevel=e.firstLevel,t.config.capLevelToPlayerSize&&e.video&&this._startCapping()},i.prototype.onBufferCodecs=function(e){this.hls.config.capLevelToPlayerSize&&e.video&&this._startCapping()},i.prototype.onLevelsUpdated=function(e){this.levels=e.levels},i.prototype.onMediaDetaching=function(){this._stopCapping()},i.prototype.detectPlayerSize=function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},i.prototype.getMaxLevel=function(r){var n=this;if(!this.levels)return-1;var e=this.levels.filter(function(e,t){return i.isLevelAllowed(t,n.restrictedLevels)&&t<=r});return i.getMaxLevelByMediaSize(e,this.mediaWidth,this.mediaHeight)},i.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=n.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},i.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=n.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(i.prototype,"mediaWidth",{get:function(){var e,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=i.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mediaHeight",{get:function(){var e,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=i.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(i,"contentScaleFactor",{get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e},enumerable:!0,configurable:!0}),i.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},i.getMaxLevelByMediaSize=function(e,t,r){if(!e||e&&!e.length)return-1;for(var n,i,a=e.length-1,o=0;o<e.length;o+=1){var s=e[o];if((s.width>=t||s.height>=r)&&(n=s,!(i=e[o+1])||n.width!==i.width||n.height!==i.height)){a=o;break}}return a},i}(o(4).default);r.default=t}).call(this,o(2).Number)},function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var d=r(1),a=r(4),f=r(0),c=window.performance,o=function(t){function e(e){return t.call(this,e,d.default.MEDIA_ATTACHING)||this}return i(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"==typeof(this.video=e.media instanceof window.HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))},e.prototype.checkFPS=function(e,t,r){var n=c.now();if(t){if(this.lastTime){var i=n-this.lastTime,a=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*a/i,l=this.hls;if(l.trigger(d.default.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:r}),0<s&&a>l.config.fpsDroppedMonitoringThreshold*o){var u=l.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),0<u&&(-1===l.autoLevelCapping||l.autoLevelCapping>=u)&&(u-=1,l.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,l.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},e.prototype.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}(a.default);t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var d=r(0),f=window.performance,i=window.XMLHttpRequest,n=function(){function e(e){e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return e.prototype.destroy=function(){this.abort(),this.loader=null},e.prototype.abort=function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},e.prototype.load=function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:f.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},e.prototype.loadInternal=function(){var e,t=this.context;e=this.loader=new i;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(r){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){return void this.callbacks.onError({code:e.status,text:r.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()},e.prototype.readystatechange=function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,i=this.context,a=this.config;if(!n.aborted&&2<=r)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(f.now(),n.trequest)),4===r){var o=t.status;if(200<=o&&o<300){n.tload=Math.max(n.tfirst,f.now());var s=void 0,l=void 0;l="arraybuffer"===i.responseType?(s=t.response).byteLength:(s=t.responseText).length,n.loaded=n.total=l;var u={url:t.responseURL,data:s};this.callbacks.onSuccess(u,n,i,t)}else n.retry>=a.maxRetry||400<=o&&o<499?(d.logger.error(o+" while loading "+i.url),this.callbacks.onError({code:o,text:t.statusText},i,t)):(d.logger.warn(o+" while loading "+i.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),a.timeout)},e.prototype.loadtimeout=function(){d.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},e.prototype.loadprogress=function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)},e}();t.default=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n="undefined"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null;t.requestMediaKeySystemAccess=n}]).default)}),Fn=e(Mn),Bn=(Mn.Hls,function(){function e(e,t,r){this.category=e,this.code=t,this.name=t.toString(),this.message=r;try{throw new Error(this.toString())}catch(e){this.stack=e.stack}}return e.prototype.toString=function(){return"QPlayError."+this.category+"."+this.code+": "+this.message},e}());(Pn=Un||(Un={})).COMMON="COMMON",Pn.HLS="HLS",Pn.NATIVE="NATIVE",Pn.MP4="MP4",(On=kn||(kn={}))[On.UNSUPPORT=1e4]="UNSUPPORT",On[On.UNKNOWN_FORMAT=10001]="UNKNOWN_FORMAT",On[On.CAN_NOT_FETCH=10002]="CAN_NOT_FETCH",On[On.FULLSCRREN_NOTSUPPORT=10003]="FULLSCRREN_NOTSUPPORT",On[On.VIDEO_SOURCE_STALLED=10004]="VIDEO_SOURCE_STALLED",On[On.VIDEO_ELEMENT_ERROR=10005]="VIDEO_ELEMENT_ERROR",On[On.VIDEO_PLAY_FAILD=10006]="VIDEO_PLAY_FAILD",On[On.INVALID_CONFIG=10007]="INVALID_CONFIG",On[On.UNEXPECTED_ERROR=10008]="UNEXPECTED_ERROR",On[On.HLS_FATAL_ERROR=10009]="HLS_FATAL_ERROR",On[On.CAN_NOT_FETCH_WASM=10010]="CAN_NOT_FETCH_WASM",On[On.MP4_DRM_KEY_ERROR=10011]="MP4_DRM_KEY_ERROR";var Nn,zn="object"==typeof Reflect?Reflect:null,jn=zn&&"function"==typeof zn.apply?zn.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Nn=zn&&"function"==typeof zn.ownKeys?zn.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Gn=Number.isNaN||function(e){return e!=e};function Hn(){Hn.init.call(this)}var qn=Hn;(Hn.EventEmitter=Hn).prototype._events=void 0,Hn.prototype._eventsCount=0,Hn.prototype._maxListeners=void 0;var Vn=10;function Wn(e){return void 0===e._maxListeners?Hn.defaultMaxListeners:e._maxListeners}function Yn(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),0<(i=Wn(e))&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function Kn(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,jn(this.listener,this.target,e))}.bind(n);return i.listener=r,n.wrapFn=i}function Xn(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):Qn(i,i.length)}function Zn(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function Qn(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(Hn,"defaultMaxListeners",{enumerable:!0,get:function(){return Vn},set:function(e){if("number"!=typeof e||e<0||Gn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Vn=e}}),Hn.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Hn.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Gn(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Hn.prototype.getMaxListeners=function(){return Wn(this)},Hn.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(0<t.length&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)jn(s,this,t);else{var l=s.length,u=Qn(s,l);for(r=0;r<l;++r)jn(u[r],this,t)}return!0},Hn.prototype.on=Hn.prototype.addListener=function(e,t){return Yn(this,e,t,!1)},Hn.prototype.prependListener=function(e,t){return Yn(this,e,t,!0)},Hn.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,Kn(this,e,t)),this},Hn.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,Kn(this,e,t)),this},Hn.prototype.off=Hn.prototype.removeListener=function(e,t){var r,n,i,a,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;0<=a;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},Hn.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;0<=n;n--)this.removeListener(e,t[n]);return this},Hn.prototype.listeners=function(e){return Xn(this,e,!0)},Hn.prototype.rawListeners=function(e){return Xn(this,e,!1)},Hn.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Zn.call(e,t)},Hn.prototype.listenerCount=Zn,Hn.prototype.eventNames=function(){return 0<this._eventsCount?Nn(this._events):[]};var Jn=function(i){function e(e,t,r){var n=i.call(this)||this;return n.supportFeatures={bitrate:!1},n.eventList=[],n.config=t,n.render=e,n.eventList=n.eventList.concat(r),n}return t(e,i),Object.defineProperty(e.prototype,"video",{get:function(){return this.render.video},enumerable:!0,configurable:!0}),e.probe=function(e,t,r){return!1},e.playConfigToEngineConfig=function(e,t){},e.isSupport=function(e){return!1},e.prototype.replaceRender=function(e){this.render=e},e.prototype.handleRenderEvents=function(){var t=this;this.render.canplay?this.emit("ready",this.render.totalTime):this.render.once("canplay",function(e){t.emit("ready",e)})},e}(qn),$n=function(n){function e(e,t,r){return n.call(this,e,t,r)||this}return t(e,n),e}(Jn),ei={VERBOSE:0,DEBUG:1,WARNING:2,DISABLE:3},ti=new(function(){function e(e){this.name=e,this.level="VERBOSE"}return e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(ei[this.level]>ei.VERBOSE)){var r="%c"+this.name+"-verbose";console.info.apply(console,[r,"color: #66ccff;"].concat(e))}},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(ei[this.level]>ei.DEBUG)){var r="%c"+this.name+"-debug";console.info.apply(console,[r,"color: #A28148; font-weight: bold;"].concat(e))}},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(ei[this.level]>ei.WARNING)){var r="%c"+this.name+"-WARNING";console.warn.apply(console,[r,"color: #E44F44; font-weight: bold;"].concat(e))}},e.prototype.setLevel=function(e){for(var t in ei)if(ei[t]===e)return void(this.level=t);this.level="DEBUG"},e}())("QPLAYER"),ri=function(n){function i(e,t){var r=n.call(this,e,t,["#hls:mainfest-parsed"])||this;if(r.supportFeatures={bitrate:!0},r.config=t,!i.isSupport())throw new Bn(Un.HLS,kn.UNSUPPORT,"not support hls");return r.initHLS(),r}return t(i,n),i.isSupport=function(e){return(!(e&&e.hls&&e.hls.isG711)||"object"==typeof window.WebAssembly&&"function"==typeof window.WebAssembly.Memory)&&Fn.isSupported()},i.probe=function(e,t){return!!e.split("?")[0].endsWith("m3u8")||("application/x-mpegurl"===t||"vnd.apple.mpegURL"===t)},i.prototype.toggleAutoQualityControl=function(){this.hls.autoLevelEnabled?this.hls.nextLevel=this.hls.currentLevel:this.hls.nextLevel=-1,this.emit("@auto-quality-switch-change",this.hls.autoLevelEnabled)},Object.defineProperty(i.prototype,"currentQuality",{get:function(){var t=-1===this.hls.currentLevel?this.hls.firstLevel:this.hls.currentLevel;return{quality:this.qualityList.find(function(e){return e.id===t})||null,isAuto:this.hls.autoLevelEnabled}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"qualityList",{get:function(){var r=this;return this.hls.levels.sort().map(function(e,t){return{id:t,name:r.config.qualityName?r.config.qualityName[t]:r.getHLSLevelName(e),bitrate:e.bitrate,url:e.url[0],type:"hls"}})},enumerable:!0,configurable:!0}),i.prototype.changeQuality=function(e){this.hls.autoLevelEnabled&&-1!==e&&this.emit("@auto-quality-switch-change",!1),this.hls.currentLevel=e},i.playConfigToEngineConfig=function(e,t){return a({url:e},t.hls)},i.prototype.reload=function(){this.hls.destroy(),this.initHLS()},i.prototype.destroy=function(){this.hls.destroy(),this.removeAllListeners()},i.prototype.getHLSLevelName=function(e){return e.name?e.name:e.height?e.height+"p":e.bitrate?Math.round(e.bitrate/1e3)+"kbps":"unkonwn"},i.prototype.initHLS=function(){var r=this,e={debug:"WARNING"!==ti.level&&"DISABLE"!==ti.level,qiniuDRMKey:this.config.DRMKey?this.config.DRMKey:void 0,g711WasmModule:this.config.g711WasmModule,enableWorker:!this.config.g711WasmModule},n=!0,i=!0;this.hls=new Fn(e),this.hls.loadSource(this.config.url),this.hls.attachMedia(this.render.video),this.hls.once(Fn.Events.MANIFEST_PARSED,function(){ti.verbose("hls: mainfest parsed"),r.emit("#hls:mainfest-parsed"),r.emit("@get-quality-list",r.qualityList)}),this.hls.on(Fn.Events.LEVEL_SWITCHING,function(e,t){r.hls.autoLevelEnabled||(r.render.isLoading=!0,r.render.setLoadingStateLock(!0)),n?n=!1:r.emit("@quality-switching",t.level)}),this.hls.on(Fn.Events.LEVEL_SWITCHED,function(e,t){r.render.setLoadingStateLock(!1),r.render.isLoading=!1,i?i=!1:r.emit("@quality-switched",r.currentQuality.quality.id)}),this.hls.on(Fn.Events.ERROR,function(e,t){switch(console.log("handle hls error!",t),r.render.isLoading=!1,t.type){case Fn.ErrorTypes.NETWORK_ERROR:if(t.response&&400<t.response.code&&t.response.code<500)return r.emit("error",new Bn(Un.COMMON,kn.CAN_NOT_FETCH,t.details)),void r.hls.destroy();if(!t.fatal)return;ti.warning("hls network fatal error, try to recovery"),r.hls.startLoad();break;case Fn.ErrorTypes.MEDIA_ERROR:if(!t.fatal)return;ti.warning("hls media fatal error, try to recovery"),r.hls.recoverMediaError();break;default:if(!t.fatal)return;r.emit("error",new Bn(Un.HLS,kn.HLS_FATAL_ERROR,t.details))}}),this.handleRenderEvents()},i}($n),ni=function(e,t){return(ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function ii(e,t){function r(){this.constructor=e}ni(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ai,oi="object"==typeof Reflect?Reflect:null,si=oi&&"function"==typeof oi.apply?oi.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};ai=oi&&"function"==typeof oi.ownKeys?oi.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var li=Number.isNaN||function(e){return e!=e};function ui(){ui.init.call(this)}var di=ui;(ui.EventEmitter=ui).prototype._events=void 0,ui.prototype._eventsCount=0,ui.prototype._maxListeners=void 0;var fi,ci,hi,pi,mi,gi,yi=10;function vi(e){return void 0===e._maxListeners?ui.defaultMaxListeners:e._maxListeners}function _i(e,t,r,n){var i,a,o,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),0<(i=vi(e))&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function bi(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,si(this.listener,this.target,e))}.bind(n);return i.listener=r,n.wrapFn=i}function Si(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):wi(i,i.length)}function Ei(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function wi(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function Ti(e,t){var r=e[t+0]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],n=8,i=String.fromCharCode(e[t+4])+String.fromCharCode(e[t+5])+String.fromCharCode(e[t+6])+String.fromCharCode(e[t+7]);return 1===r&&(r=e[t+8]<<56|e[t+9]<<48|e[t+10]<<40|e[t+11]<<32|e[t+12]<<24|e[t+11]<<16|e[t+12]<<8|e[t+13],n=16),{size:r,type:i,headerSize:n}}function Ai(e,t){for(var r=0;r<e.length;r+=1)if(t>=e.start(r)&&t<=e.end(r))return!0;return!1}function xi(e,t){if(0===e.length)return[t];for(var r=0,n=e;r<n.length;r++){var i=n[r];if(t.start>=i.start&&t.end<=i.end)return e;if(t.start>i.end||t.end<i.start)return e.push(t),e;var a=t.start<i.start?t.start:i.start,o=t.end>i.end?t.end:i.end;return i.start=a,i.end=o,e}return e}function Li(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}function Ri(e,t,r){var n={type:t,message:r};console.warn("DRM MP4 ERROR: "+t+", "+r),e.emit("error",n)}Object.defineProperty(ui,"defaultMaxListeners",{enumerable:!0,get:function(){return yi},set:function(e){if("number"!=typeof e||e<0||li(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");yi=e}}),ui.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ui.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||li(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},ui.prototype.getMaxListeners=function(){return vi(this)},ui.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(0<t.length&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)si(s,this,t);else{var l=s.length,u=wi(s,l);for(r=0;r<l;++r)si(u[r],this,t)}return!0},ui.prototype.on=ui.prototype.addListener=function(e,t){return _i(this,e,t,!1)},ui.prototype.prependListener=function(e,t){return _i(this,e,t,!0)},ui.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,bi(this,e,t)),this},ui.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,bi(this,e,t)),this},ui.prototype.off=ui.prototype.removeListener=function(e,t){var r,n,i,a,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;0<=a;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},ui.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;0<=n;n--)this.removeListener(e,t[n]);return this},ui.prototype.listeners=function(e){return Si(this,e,!0)},ui.prototype.rawListeners=function(e){return Si(this,e,!1)},ui.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Ei.call(e,t)},ui.prototype.listenerCount=Ei,ui.prototype.eventNames=function(){return 0<this._eventsCount?ai(this._events):[]},(ci=fi||(fi={})).NEED_BUFFER="needbuffer",ci.BUFFER_IS_ENOUGH="bufferisenough",(pi=hi||(hi={})).NETWORK="network",pi.MEDIA="media",pi.KEY="key",pi.OTHER="other",(gi=mi||(mi={})).ON_CHUNK="fetchio:on_chunk",gi.ENDED="fetchio:end",gi.INTERNAL_BUFFER_IO_STATE_CHANGE="@bufferio_state_change";var Ii=function(r){function e(e){var t=r.call(this)||this;return t.url="",t.currentRange={start:0,end:-1},t.currentReaderIsFinish=!1,t.downloadedRanges=[],t.currentDownloadRange={start:0,end:0},t.currentReqId=Date.now(),t.bufferIoState=fi.NEED_BUFFER,t.seek=function(e){t.currentReader=void 0,t.start(t.url,{start:e,end:-1})},t.onBufferIoStateChange=function(e){e!==t.bufferIoState&&(t.bufferIoState=e,t.emit(mi.INTERNAL_BUFFER_IO_STATE_CHANGE))},t.drmMp4=e,t.maxIoRetry=t.drmMp4.config.maxIoRetry,t}return ii(e,r),e.prototype.start=function(e,t,r){var n=this;void 0===r&&(r=!1),this.url=e,r||(this.maxIoRetry=this.drmMp4.config.maxIoRetry);var i=Date.now();this.currentReqId=i,0===this.currentDownloadRange.start&&0===this.currentDownloadRange.end||(this.downloadedRanges.push(this.currentDownloadRange),this.currentDownloadRange={start:0,end:0});var a,o={mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade",headers:{Range:(a=t,"bytes="+a.start.toString()+"-"+(-1===a.end?"":a.end.toString()))}};this.currentDownloadRange.start=this.currentDownloadRange.end=t.start,this.currentRange=t,fetch(e,o).then(function(e){if(e.body)return e.ok?void(i===n.currentReqId?(n.currentReader=e.body.getReader(),n.currentReaderIsFinish=!1,n.pump(n.currentReader)):e.body.getReader().cancel()):400<=e.status&&e.status<500?void Ri(n.drmMp4,hi.NETWORK,"can not request"):(console.warn("response status:",e.status,"retry"),void n.retry(n.url,{start:n.currentDownloadRange.end,end:-1}));Ri(n.drmMp4,hi.NETWORK,"can not find media body")}).catch(function(e){console.warn("can not fetch, retry"),n.retry(n.url,{start:n.currentDownloadRange.end,end:-1})})},e.prototype.retry=function(e,t){var r=this;return 0<this.maxIoRetry?(this.maxIoRetry-=1,void setTimeout(function(){return r.start(e,t,!0)},1e3)):void Ri(this.drmMp4,hi.NETWORK,"can not get response after retry")},e.prototype.release=function(){this.currentReader&&(this.currentReader=void 0)},e.prototype.pump=function(n){var i=this;new Promise(function(e){i.bufferIoState!==fi.NEED_BUFFER?i.on(mi.INTERNAL_BUFFER_IO_STATE_CHANGE,function(){if(i.bufferIoState===fi.NEED_BUFFER)return i.removeAllListeners(mi.INTERNAL_BUFFER_IO_STATE_CHANGE),void e()}):e()}).then(function(){var e,r,t;(e=n.read(),r=5e3,t=new Promise(function(e,t){setTimeout(function(){return t("timeout")},r)}),Promise.race([e,t])).then(function(e){n===i.currentReader&&i.currentReader?e.done?-1===i.currentRange.end&&(i.currentReaderIsFinish=!0,i.emit(mi.ENDED)):(i.emit(mi.ON_CHUNK,i.currentDownloadRange.end,e.value,e.done),i.currentDownloadRange.end+=e.value.length,i.pump(n)):n.cancel()}).catch(function(e){"timeout"===e&&console.warn("request timeout"),console.warn("loading response error, retry"),i.retry(i.url,{start:i.currentDownloadRange.end,end:-1})})})},e}(di);var Ci,Di,Ui,Pi=(function(e,t){var r,n,c=(r=new Date,n=4,{setLogLevel:function(e){n=e==this.debug?1:e==this.info?2:e==this.warn?3:(this.error,4)},debug:function(e,t){void 0===console.debug&&(console.debug=console.log),n<=1&&console.debug("["+c.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},info:function(e,t){n<=2&&console.info("["+c.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},warn:function(e,t){n<=3&&console.warn("["+c.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},error:function(e,t){n<=4&&console.error("["+c.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)}});c.getDurationString=function(e,t){var r;function n(e,t){for(var r=(""+e).split(".");r[0].length<t;)r[0]="0"+r[0];return r.join(".")}e<0?(r=!0,e=-e):r=!1;var i=e/(t||1),a=Math.floor(i/3600);i-=3600*a;var o=Math.floor(i/60),s=1e3*(i-=60*o);return s-=1e3*(i=Math.floor(i)),s=Math.floor(s),(r?"-":"")+a+":"+n(o,2)+":"+n(i,2)+"."+n(s,3)},c.printRanges=function(e){var t=e.length;if(0<t){for(var r="",n=0;n<t;n++)0<n&&(r+=","),r+="["+c.getDurationString(e.start(n))+","+c.getDurationString(e.end(n))+"]";return r}return"(empty)"},t.Log=c;var i=function(e){if(!(e instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=e,this.dataview=new DataView(e),this.position=0};i.prototype.getPosition=function(){return this.position},i.prototype.getEndPosition=function(){return this.buffer.byteLength},i.prototype.getLength=function(){return this.buffer.byteLength},i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.buffer.byteLength,e));return this.position=isNaN(t)||!isFinite(t)?0:t,!0},i.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},i.prototype.readAnyInt=function(e,t){var r=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:r=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:r=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw"No method for reading signed 24 bits values";r=this.dataview.getUint8(this.position)<<16,r|=this.dataview.getUint8(this.position)<<8,r|=this.dataview.getUint8(this.position);break;case 4:r=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw"No method for reading signed 64 bits values";r=this.dataview.getUint32(this.position)<<32,r|=this.dataview.getUint32(this.position);break;default:throw"readInt method not implemented for size: "+e}return this.position+=e,r}throw"Not enough bytes in buffer"},i.prototype.readUint8=function(){return this.readAnyInt(1,!1)},i.prototype.readUint16=function(){return this.readAnyInt(2,!1)},i.prototype.readUint24=function(){return this.readAnyInt(3,!1)},i.prototype.readUint32=function(){return this.readAnyInt(4,!1)},i.prototype.readUint64=function(){return this.readAnyInt(8,!1)},i.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t="",r=0;r<e;r++)t+=String.fromCharCode(this.readUint8());return t}throw"Not enough bytes in buffer"},i.prototype.readCString=function(){for(var e=[];;){var t=this.readUint8();if(0===t)break;e.push(t)}return String.fromCharCode.apply(null,e)},i.prototype.readInt8=function(){return this.readAnyInt(1,!0)},i.prototype.readInt16=function(){return this.readAnyInt(2,!0)},i.prototype.readInt32=function(){return this.readAnyInt(4,!0)},i.prototype.readInt64=function(){return this.readAnyInt(8,!1)},i.prototype.readUint8Array=function(e){for(var t=new Uint8Array(e),r=0;r<e;r++)t[r]=this.readUint8();return t},i.prototype.readInt16Array=function(e){for(var t=new Int16Array(e),r=0;r<e;r++)t[r]=this.readInt16();return t},i.prototype.readUint16Array=function(e){for(var t=new Int16Array(e),r=0;r<e;r++)t[r]=this.readUint16();return t},i.prototype.readUint32Array=function(e){for(var t=new Uint32Array(e),r=0;r<e;r++)t[r]=this.readUint32();return t},i.prototype.readInt32Array=function(e){for(var t=new Int32Array(e),r=0;r<e;r++)t[r]=this.readInt32();return t},t.MP4BoxStream=i;var u=function(e,t,r){this._byteOffset=t||0,e instanceof ArrayBuffer?this.buffer=e:"object"==typeof e?(this.dataView=e,t&&(this._byteOffset+=t)):this.buffer=new ArrayBuffer(e||0),this.position=0,this.endianness=null==r?u.LITTLE_ENDIAN:r};u.prototype={},u.prototype.getPosition=function(){return this.position},u.prototype._realloc=function(e){if(this._dynamicSize){var t=this._byteOffset+this.position+e,r=this._buffer.byteLength;if(t<=r)t>this._byteLength&&(this._byteLength=t);else{for(r<1&&(r=1);r<t;)r*=2;var n=new ArrayBuffer(r),i=new Uint8Array(this._buffer);new Uint8Array(n,0,i.length).set(i),this.buffer=n,this._byteLength=t}}},u.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var e=new ArrayBuffer(this._byteLength),t=new Uint8Array(e),r=new Uint8Array(this._buffer,0,t.length);t.set(r),this.buffer=e}},u.BIG_ENDIAN=!1,u.LITTLE_ENDIAN=!0,u.prototype._byteLength=0,Object.defineProperty(u.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(u.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(e){this._buffer=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(u.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(u.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset,this._buffer=e.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+e.byteLength}}),u.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t},u.prototype.isEof=function(){return this.position>=this._byteLength},u.prototype.mapUint8Array=function(e){this._realloc(1*e);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},u.prototype.readInt32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Int32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var r=new Int16Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Int8Array(e);return u.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},u.prototype.readUint32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Uint32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readUint16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var r=new Uint16Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readUint8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Uint8Array(e);return u.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},u.prototype.readFloat64Array=function(e,t){e=null==e?this.byteLength-this.position/8:e;var r=new Float64Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readFloat32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var r=new Float32Array(e);return u.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),u.arrayToNative(r,null==t?this.endianness:t),this.position+=r.byteLength,r},u.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,null==e?this.endianness:e);return this.position+=2,t},u.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},u.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,null==e?this.endianness:e);return this.position+=2,t},u.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},u.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,null==e?this.endianness:e);return this.position+=4,t},u.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,null==e?this.endianness:e);return this.position+=8,t},u.endianness=0<new Int8Array(new Int16Array([1]).buffer)[0],u.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i),o=new Uint8Array(r,n,i);a.set(o)},u.arrayToNative=function(e,t){return t==this.endianness?e:this.flipArrayEndianness(e)},u.nativeToEndian=function(e,t){return this.endianness==t?e:this.flipArrayEndianness(e)},u.flipArrayEndianness=function(e){for(var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=0;r<e.byteLength;r+=e.BYTES_PER_ELEMENT)for(var n=r+e.BYTES_PER_ELEMENT-1,i=r;i<n;n--,i++){var a=t[i];t[i]=t[n],t[n]=a}return e},u.prototype.failurePosition=0,String.fromCharCodeUint8=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e[r];return String.fromCharCode.apply(null,t)},u.prototype.readString=function(e,t){return null==t||"ASCII"==t?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(null==e?this.byteLength-this.position:e)]):new TextDecoder(t).decode(this.mapUint8Array(e))},u.prototype.readCString=function(e){var t=this.byteLength-this.position,r=new Uint8Array(this._buffer,this._byteOffset+this.position),n=t;null!=e&&(n=Math.min(e,t));for(var i=0;i<n&&0!==r[i];i++);var a=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(i)]);return null!=e?this.position+=n-i:i!=t&&(this.position+=1),a};var a=Math.pow(2,32);u.prototype.readInt64=function(){return this.readInt32()*a+this.readUint32()},u.prototype.readUint64=function(){return this.readUint32()*a+this.readUint32()},u.prototype.readInt64=function(){return this.readUint32()*a+this.readUint32()},u.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},(t.DataStream=u).prototype.save=function(e){var t=new Blob([this.buffer]);if(!window.URL||!URL.createObjectURL)throw"DataStream.save: Can't create object URL.";var r=window.URL.createObjectURL(t),n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download",e),n.click(),window.URL.revokeObjectURL(r)},u.prototype._dynamicSize=!0,Object.defineProperty(u.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){e||this._trimAlloc(),this._dynamicSize=e}}),u.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e),r=new Uint8Array(t),n=new Uint8Array(this._buffer,e,r.length);r.set(n),this.buffer=t,this.position-=e},u.prototype.writeInt32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt32Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeInt32(e[r],t)},u.prototype.writeInt16Array=function(e,t){if(this._realloc(2*e.length),e instanceof Int16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt16Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeInt16(e[r],t)},u.prototype.writeInt8Array=function(e){if(this._realloc(1*e.length),e instanceof Int8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt8Array(e.length);else for(var t=0;t<e.length;t++)this.writeInt8(e[t])},u.prototype.writeUint32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Uint32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint32Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeUint32(e[r],t)},u.prototype.writeUint16Array=function(e,t){if(this._realloc(2*e.length),e instanceof Uint16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint16Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeUint16(e[r],t)},u.prototype.writeUint8Array=function(e){if(this._realloc(1*e.length),e instanceof Uint8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint8Array(e.length);else for(var t=0;t<e.length;t++)this.writeUint8(e[t])},u.prototype.writeFloat64Array=function(e,t){if(this._realloc(8*e.length),e instanceof Float64Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat64Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeFloat64(e[r],t)},u.prototype.writeFloat32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Float32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)u.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat32Array(e.length,t);else for(var r=0;r<e.length;r++)this.writeFloat32(e[r],t)},u.prototype.writeInt32=function(e,t){this._realloc(4),this._dataView.setInt32(this.position,e,null==t?this.endianness:t),this.position+=4},u.prototype.writeInt16=function(e,t){this._realloc(2),this._dataView.setInt16(this.position,e,null==t?this.endianness:t),this.position+=2},u.prototype.writeInt8=function(e){this._realloc(1),this._dataView.setInt8(this.position,e),this.position+=1},u.prototype.writeUint32=function(e,t){this._realloc(4),this._dataView.setUint32(this.position,e,null==t?this.endianness:t),this.position+=4},u.prototype.writeUint16=function(e,t){this._realloc(2),this._dataView.setUint16(this.position,e,null==t?this.endianness:t),this.position+=2},u.prototype.writeUint8=function(e){this._realloc(1),this._dataView.setUint8(this.position,e),this.position+=1},u.prototype.writeFloat32=function(e,t){this._realloc(4),this._dataView.setFloat32(this.position,e,null==t?this.endianness:t),this.position+=4},u.prototype.writeFloat64=function(e,t){this._realloc(8),this._dataView.setFloat64(this.position
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
