!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;"undefined"!=typeofwindow?e=window:"undefined"!=typeofglobal?e=global:"undefined"!=typeofself&&(e=self),e.Hls=t()}}(function(){returnfunctions(e,t,r){functioni(a,d){if(!t[a]){if(!e[a]){varl="function"==typeofrequire&&require;if(!d&&l)returnl(a,!0);if(n)returnn(a,!0);varu=newError("Cannot find module '"+a+"'");throwu.code="MODULE_NOT_FOUND",u}varo=t[a]={exports:{}};e[a][0].call(o.exports,function(t){varr=e[a][1][t];returni(r?r:t)},o,o.exports,s,e,t,r)}returnt[a].exports}for(varn="function"==typeofrequire&&require,a=0;a<r.length;a++)i(r[a]);returni}({1:[function(s,a,o){functione(){this._events=this._events||{},this._maxListeners=this._maxListeners||void0}functiont(e){return"function"==typeofe}functionn(e){return"number"==typeofe}functionr(e){return"object"==typeofe&&null!==e}functioni(e){returnvoid0===e}a.exports=e,e.EventEmitter=e,e.prototype._events=void0,e.prototype._maxListeners=void0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(e){if(!n(e)||0>e||isNaN(e))throwTypeError("n must be a positive number");returnthis._maxListeners=e,this},e.prototype.emit=function(u){varo,a,n,s,e,l;if(this._events||(this._events={}),"error"===u&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if(o=arguments[1],oinstanceofError)throwo;throwTypeError('Uncaught, unspecified "error" event.')}if(a=this._events[u],i(a))return!1;if(t(a))switch(arguments.length){case1:a.call(this);break;case2:a.call(this,arguments[1]);break;case3:a.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=newArray(n-1),e=1;n>e;e++)s[e-1]=arguments[e];a.apply(this,s)}elseif(r(a)){for(n=arguments.length,s=newArray(n-1),e=1;n>e;e++)s[e-1]=arguments[e];for(l=a.slice(),n=l.length,e=0;n>e;e++)l[e].apply(this,s)}return!0},e.prototype.addListener=function(a,n){vars;if(!t(n))throwTypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,t(n.listener)?n.listener:n),this._events[a]?r(this._events[a])?this._events[a].push(n):this._events[a]=[this._events[a],n]:this._events[a]=n,r(this._events[a])&&!this._events[a].warned){vars;s=i(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[a].length>s&&(this._events[a].warned=!0,"function"==typeofconsole.trace)}returnthis},e.prototype.on=e.prototype.addListener,e.prototype.once=function(i,e){functionr(){this.removeListener(i,r),a||(a=!0,e.apply(this,arguments))}if(!t(e))throwTypeError("listener must be a function");vara=!1;returnr.listener=e,this.on(i,r),this},e.prototype.removeListener=function(a,i){vare,s,o,n;if(!t(i))throwTypeError("listener must be a function");if(!this._events||!this._events[a])returnthis;if(e=this._events[a],o=e.length,s=-1,e===i||t(e.listener)&&e.listener===i)deletethis._events[a],this._events.removeListener&&this.emit("removeListener",a,i);elseif(r(e)){for(n=o;n-->0;)if(e[n]===i||e[n].listener&&e[n].listener===i){s=n;break}if(0>s)returnthis;1===e.length?(e.length=0,deletethis._events[a]):e.splice(s,1),this._events.removeListener&&this.emit("removeListener",a,i)}returnthis},e.prototype.removeAllListeners=function(e){vari,r;if(!this._events)returnthis;if(!this._events.removeListener)return0===arguments.length?this._events={}:this._events[e]&&deletethis._events[e],this;if(0===arguments.length){for(iinthis._events)"removeListener"!==i&&this.removeAllListeners(i);returnthis.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],t(r))this.removeListener(e,r);elsefor(;r.length;)this.removeListener(e,r[r.length-1]);returndeletethis._events[e],this},e.prototype.listeners=function(e){varr;returnr=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e.listenerCount=function(e,r){vari;returni=e._events&&e._events[r]?t(e._events[r])?1:e._events[r].length:0}},{}],2:[func
}},{key:"onMediaSourceEnded",value:function(){t.logger.log("media source ended")}},{key:"currentLevel",get:function(){if(this.media){vare=this.getBufferRange(this.media.currentTime);if(e)returne.frag.level}return-1}},{key:"nextBufferRange",get:function(){returnthis.media?this.followingBufferRange(this.getBufferRange(this.media.currentTime)):null}},{key:"nextLevel",get:function(){vare=this.nextBufferRange;returne?e.frag.level:-1}}]),a}();s.default=y,u.exports=s.default},{"../demux/demuxer":12,"../errors":16,"../events":17,"../helper/level-helper":18,"../utils/binary-search":25,"../utils/logger":26}],6:[function(n,t,e){"use strict";functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});vari=function(){functione(i,r){for(vart=0;t<r.length;t++){vare=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"ine&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),a=function(){functione(h){r(this,e),this._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],this._precompute();vari,s,t,o,l,n=this._tables[0][4],u=this._tables[1],a=h.length,d=1;if(4!==a&&6!==a&&8!==a)thrownewError("Invalid aes key size="+a);for(o=h.slice(0),l=[],this._key=[o,l],i=a;4*a+28>i;i++)t=o[i-1],(i%a===0||8===a&&i%a===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%a===0&&(t=t<<8^t>>>24^d<<24,d=d<<1^283*(d>>7))),o[i]=o[i-a]^t;for(s=0;i;s++,i--)t=o[3&s?i:i-4],4>=i||4>s?l[s]=t:l[s]=u[0][n[t>>>24]]^u[1][n[t>>16&255]]^u[2][n[t>>8&255]]^u[3][n[255&t]]}returni(e,[{key:"_precompute",value:function(){vare,i,r,u,h,d,t,s,l,n=this._tables[0],o=this._tables[1],f=n[4],g=o[4],a=[],c=[];for(e=0;256>e;e++)c[(a[e]=e<<1^283*(e>>7))^e]=e;for(i=r=0;!f[i];i^=u||1,r=c[r]||1)for(t=r^r<<1^r<<2^r<<3^r<<4,t=t>>8^255&t^99,f[i]=t,g[t]=i,d=a[h=a[u=a[i]]],l=16843009*d^65537*h^257*u^16843008*i,s=257*a[t]^16843008*t,e=0;4>e;e++)n[e][i]=s=s<<24^s>>>8,o[e][t]=l=l<<24^l>>>8;for(e=0;5>e;e++)n[e]=n[e].slice(0),o[e]=o[e].slice(0)}},{key:"decrypt",value:function(A,p,_,b,E,m){varf,v,g,n,e=this._key[1],t=A^e[0],i=b^e[1],a=_^e[2],r=p^e[3],y=e.length/4-2,s=4,o=this._tables[1],h=o[0],d=o[1],u=o[2],l=o[3],c=o[4];for(n=0;y>n;n++)f=h[t>>>24]^d[i>>16&255]^u[a>>8&255]^l[255&r]^e[s],v=h[i>>>24]^d[a>>16&255]^u[r>>8&255]^l[255&t]^e[s+1],g=h[a>>>24]^d[r>>16&255]^u[t>>8&255]^l[255&i]^e[s+2],r=h[r>>>24]^d[t>>16&255]^u[i>>8&255]^l[255&a]^e[s+3],s+=4,t=f,i=v,a=g;for(n=0;4>n;n++)E[(3&-n)+m]=c[t>>>24]<<24^c[i>>16&255]<<16^c[a>>8&255]<<8^c[255&r]^e[s++],f=t,t=i,i=a,a=r,r=f}}]),e}();e.default=a,t.exports=e.default},{}],7:[function(t,r,e){"use strict";functioni(e){returne&&e.__esModule?e:{default:e}}functiona(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});varn=function(){functione(i,r){for(vart=0;t<r.length;t++){vare=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"ine&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),s=t("./aes"),o=i(s),l=function(){functione(t,r){a(this,e),this.key=t,this.iv=r}returnn(e,[{key:"ntoh",value:function(e){returne<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"doDecrypt",value:function(i,v,a){varu,f,s,h,l,c,d,n,e,r=newInt32Array(i.buffer,i.byteOffset,i.byteLength>>2),p=newo.default(Array.prototype.slice.call(v)),g=newUint8Array(i.byteLength),t=newInt32Array(g.buffer);for(u=~~a[0],f=~~a[1],s=~~a[2],h=~~a[3],e=0;e<r.length;e+=4)l=~~this.ntoh(r[e]),c=~~this.ntoh(r[e+1]),d=~~this.ntoh(r[e+2]),n=~~this.ntoh(r[e+3]),p.decrypt(l,c,d,n,t,e),t[e]=this.ntoh(t[e]^u),t[e+1]=this.ntoh(t[e+1]^f),t[e+2]=this.ntoh(t[e+2]^s),t[e+3]=this.ntoh(t[e+3]^h),u=l,f=c,s=d,h=n;returng}},{key:"localDecript",value:function(e,t,r,i){vara=this.doDecrypt(e,t,r);i.set(a,e.byteOffset)}},{key:"decrypt",value:function(n){varr=32e3,t=newInt32Array(n),i=newUint8Array(n.byteLength),e=0,s=this.key,a=this.iv;for(this.localDecript(t.subarray(e,e+r),s,a,i),e=r;e<t.length;e
r=0;r<o.length;r++)o[r].cc+=u;if(s)e.updateFragPTS(i,s.sn,s.startPTS,s.endPTS);else{varg=f[h].start;for(r=0;r<o.length;r++)o[r].start+=g}i.PTSKnown=n.PTSKnown}},{key:"updateFragPTS",value:function(i,l,a,s){varo,n,r,t;if(l<i.startSN||l>i.endSN)return0;o=l-i.startSN,n=i.fragments,r=n[o],isNaN(r.startPTS)||(a=Math.max(a,r.startPTS),s=Math.min(s,r.endPTS));varu=a-r.start;for(r.start=r.startPTS=a,r.endPTS=s,r.duration=s-a,t=o;t>0;t--)e.updatePTS(n,t,t-1);for(t=o;t<n.length-1;t++)e.updatePTS(n,t,t+1);returni.PTSKnown=!0,u}},{key:"updatePTS",value:function(s,i,a){vare=s[i],r=s[a],n=r.startPTS;isNaN(n)?a>i?r.start=e.start+e.duration:r.start=e.start-r.duration:a>i?(e.duration=n-e.start,e.duration<0&&t.logger.error("negative duration computed for "+e+", there should be some duration drift between playlist and fragment!")):(r.duration=e.start-n,r.duration<0&&t.logger.error("negative duration computed for "+r+", there should be some duration drift between playlist and fragment!"))}}]),e}();e.default=s,i.exports=e.default},{"../utils/logger":26}],19:[function(t,c,a){"use strict";functionr(e){returne&&e.__esModule?e:{default:e}}functiono(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});varn=function(){functione(i,r){for(vart=0;t<r.length;t++){vare=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"ine&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),E=t("./events"),i=r(E),s=t("./errors"),u=t("./loader/playlist-loader"),d=r(u),h=t("./loader/fragment-loader"),f=r(h),T=t("./controller/abr-controller"),g=r(T),v=t("./controller/mse-media-controller"),p=r(v),y=t("./controller/level-controller"),m=r(y),e=t("./utils/logger"),b=t("./utils/xhr-loader"),_=r(b),A=t("events"),R=r(A),L=t("./loader/key-loader"),S=r(L),l=function(){functiont(){vari=arguments.length<=0||void0===arguments[0]?{}:arguments[0];o(this,t);varn={autoStartLoad:!0,debug:!1,maxBufferLength:30,maxBufferSize:6e7,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:1,fragLoadingRetryDelay:1e3,fragLoadingLoopThreshold:3,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,appendErrorMaxRetry:200,loader:_.default,fLoader:void0,pLoader:void0,abrController:g.default,mediaController:p.default};for(varainn)aini||(i[a]=n[a]);if(void0!==i.liveMaxLatencyDurationCount&&i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount)thrownewError('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');(0,e.enableLogs)(i.debug),this.config=i;varr=this.observer=newR.default;r.trigger=function(i){for(vart=arguments.length,a=Array(t>1?t-1:0),e=1;t>e;e++)a[e-1]=arguments[e];r.emit.apply(r,[i,i].concat(a))},r.off=function(a){for(vart=arguments.length,i=Array(t>1?t-1:0),e=1;t>e;e++)i[e-1]=arguments[e];r.removeListener.apply(r,[a].concat(i))},this.on=r.on.bind(r),this.off=r.off.bind(r),this.trigger=r.trigger.bind(r),this.playlistLoader=newd.default(this),this.fragmentLoader=newf.default(this),this.levelController=newm.default(this),this.abrController=newi.abrController(this),this.mediaController=newi.mediaController(this),this.keyLoader=newS.default(this)}returnn(t,null,[{key:"isSupported",value:function(){returnwindow.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"Events",get:function(){returni.default}},{key:"ErrorTypes",get:function(){returns.ErrorTypes}},{key:"ErrorDetails",get:function(){returns.ErrorDetails}}]),n(t,[{key:"destroy",value:function(){e.logger.log("destroy"),this.trigger(i.default.DESTROYING),this.detachMedia(),this.playlistLoader.destroy(),this.fragmentLoader.destroy(),this.levelController.destroy(),this.mediaController.destroy(),this.keyLoader.destroy(),this.url=null,this.observer.removeAllListeners()}},{key:"attachMedia",value:function(t){e.logger.log("attachMedia")
});varn=function(){functione(i,r){for(vart=0;t<r.length;t++){vare=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"ine&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),t=r("../utils/logger"),s=function(){functione(t){a(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}returnn(e,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){this.loader&&4!==this.loader.readyState&&(this.stats.aborted=!0,this.loader.abort()),this.timeoutHandle&&window.clearTimeout(this.timeoutHandle)}},{key:"load",value:function(r,i,a,n,s,t,o,l){varu=arguments.length<=8||void0===arguments[8]?null:arguments[8],e=arguments.length<=9||void0===arguments[9]?null:arguments[9];this.url=r,!e||isNaN(e.byteRangeStartOffset)||isNaN(e.byteRangeEndOffset)||(this.byteRange=e.byteRangeStartOffset+"-"+e.byteRangeEndOffset),this.responseType=i,this.onSuccess=a,this.onProgress=u,this.onTimeout=s,this.onError=n,this.stats={trequest:performance.now(),retry:0},this.timeout=t,this.maxRetry=o,this.retryDelay=l,this.timeoutHandle=window.setTimeout(this.loadtimeout.bind(this),t),this.loadInternal()}},{key:"loadInternal",value:function(){vare=this.loader=newXMLHttpRequest;e.onload=this.loadsuccess.bind(this),e.onerror=this.loaderror.bind(this),e.onprogress=this.loadprogress.bind(this),e.open("GET",this.url,!0),this.byteRange&&e.setRequestHeader("Range","bytes="+this.byteRange),e.responseType=this.responseType,this.stats.tfirst=null,this.stats.loaded=0,this.xhrSetup&&this.xhrSetup(e,this.url),e.send()}},{key:"loadsuccess",value:function(e){window.clearTimeout(this.timeoutHandle),this.stats.tload=performance.now(),this.onSuccess(e,this.stats)}},{key:"loaderror",value:function(e){this.stats.retry<this.maxRetry?(t.logger.warn(e.type+" while loading "+this.url+", retrying in "+this.retryDelay+"..."),this.destroy(),window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,64e3),this.stats.retry++):(window.clearTimeout(this.timeoutHandle),t.logger.error(e.type+" while loading "+this.url),this.onError(e))}},{key:"loadtimeout",value:function(e){t.logger.warn("timeout while loading "+this.url),this.onTimeout(e,this.stats)}},{key:"loadprogress",value:function(t){vare=this.stats;null===e.tfirst&&(e.tfirst=performance.now()),e.loaded=t.loaded,this.onProgress&&this.onProgress(t,e)}}]),e}();e.default=s,i.exports=e.default},{"../utils/logger":26}]},{},[19])(19)});