!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
this.state=e.IDLE)}this.tick()}},{key:"_checkBuffer",value:function(){vare=this.media;if(e){varo=e.readyState;if(o){vara=this.seekAfterBuffered;if(a)e.duration>=a&&(e.currentTime=a,this.seekAfterBuffered=void0);else{varr=e.currentTime,n=this.bufferInfo(r,0),u=!(e.paused||e.ended||e.seeking||3>o),s=.2;if(n.len<=s&&(r>e.playbackRate*this.lastCurrentTime||!u?s=0:t.logger.trace("playback seems stuck"),n.len<=s)){vari=n.nextStart,l=i-r;i&&.3>l&&l>.005&&!e.seeking&&(t.logger.log("adjust currentTime from "+r+" to "+i),e.currentTime=i)}}}}}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"onSBUpdateError",value:function(a){t.logger.error("sourceBuffer error:"+a),this.state=e.ERROR,this.hls.trigger(r.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1,frag:this.fragCurrent})}},{key:"timeRangesToString",value:function(t){for(varr="",i=t.length,e=0;i>e;e++)r+="["+t.start(e)+","+t.end(e)+"]";returnr}},{key:"onMediaSourceOpen",value:function(){t.logger.log("media source opened"),this.hls.trigger(r.default.MEDIA_ATTACHED),this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvmetadata=this.onMediaMetadata.bind(this),this.onvended=this.onMediaEnded.bind(this);vare=this.media;e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("loadedmetadata",this.onvmetadata),e.addEventListener("ended",this.onvended),this.levels&&this.config.autoStartLoad&&this.startLoad(),this.mediaSource.removeEventListener("sourceopen",this.onmso)}},{key:"onMediaSourceClose",value:function(){t.logger.log("media source closed")}},{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":13,"../errors":17,"../events":18,"../helper/level-helper":19,"../utils/binary-search":27,"../utils/logger":28}],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(L,p,_,b,E,m){varf,v,g,n,e=this._key[1],t=L^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&25
FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_METADATA:"hlsFraParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFPSDrop",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded"},t.exports=e.default},{}],19:[function(r,i,e){"use strict";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}}(),t=r("../utils/logger"),s=function(){functione(){a(this,e)}returnn(e,null,[{key:"mergeDetails",value:function(n,i){vars,c=Math.max(n.startSN,i.startSN)-i.startSN,d=Math.min(n.endSN,i.endSN)-i.startSN,h=i.startSN-n.startSN,f=n.fragments,o=i.fragments,u=0;if(c>d)returnvoid(i.PTSKnown=!1);for(varr=c;d>=r;r++){varl=f[h+r],a=o[r];u=l.cc-a.cc,isNaN(l.startPTS)||(a.start=a.startPTS=l.startPTS,a.endPTS=l.endPTS,a.duration=l.duration,s=a)}if(u)for(t.logger.log("discontinuity sliding from playlist, take drift into account"),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.min(a,r.startPTS),s=Math.max(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 frag "+e.sn+",level "+e.level+", 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 frag "+r.sn+",level "+r.level+", there should be some duration drift between playlist and fragment!"))}}]),e}();e.default=s,i.exports=e.default},{"../utils/logger":28}],20:[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),S=t("./controller/abr-controller"),g=r(S),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),L=t("events"),R=r(L),A=t("./loader/key-loader"),T=r(A),l=function(){functiont(){vari=arguments.length<=0||void0===arguments[0]?{}:arguments[0];o(this,t);varn=t.DefaultConfig;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.
}},{key:"hexadecimalIntegerAsNumber",value:function(t){vare=parseInt(this[t],16);returne>Number.MAX_SAFE_INTEGER?1/0:e}},{key:"decimalFloatingPoint",value:function(e){returnparseFloat(this[e])}},{key:"enumeratedString",value:function(e){returnthis[e]}},{key:"decimalResolution",value:function(t){vare=/^(\d+)x(\d+)$/.exec(this[t]);returnnull===e?void0:{width:parseInt(e[1],10),height:parseInt(e[2],10)}}}],[{key:"parseAttrList",value:function(a){for(vart,n=/(.+?)=((?:\".*?\")|.*?)(?:,|$)/g,r={};null!==(t=n.exec(a));){vare=t[2],i='"';0===e.indexOf(i)&&e.lastIndexOf(i)===e.length-1&&(e=e.slice(1,-1)),r[t[1]]=e}returnr}}]),e}();e.default=a,t.exports=e.default},{}],27:[function(r,e,i){"use strict";vart={search:function(a,s){for(vart=0,r=a.length-1,e=null,i=null;r>=t;){e=(t+r)/2|0,i=a[e];varn=s(i);if(n>0)t=e+1;else{if(!(0>n))returni;r=e-1}}returnnull}};e.exports=t},{}],28:[function(d,u,r){"use strict";functione(){}functionl(t,e){returne="["+t+"] > "+e}functiona(t){varr=window.console[t];returnr?function(){for(vara=arguments.length,e=Array(a),i=0;a>i;i++)e[i]=arguments[i];e[0]&&(e[0]=l(t,e[0])),r.apply(window.console,e)}:e}functions(r){for(vari=arguments.length,n=Array(i>1?i-1:0),e=1;i>e;e++)n[e-1]=arguments[e];n.forEach(function(e){t[e]=r[e]?r[e].bind(r):a(e)})}Object.defineProperty(r,"__esModule",{value:!0});vari={trace:e,debug:e,log:e,warn:e,info:e,error:e},t=i,n=function(e){if(e===!0||"object"==typeofe){s(e,"debug","log","info","warn","error");try{t.log()}catch(e){t=i}}elset=i};r.enableLogs=n;varo=t;r.logger=o},{}],29:[function(r,t,i){"use strict";vare={buildAbsoluteURL:function(i,t){if(t=t.trim(),/^[a-z]+:/i.test(t))returnt;vara=null,n=null,s=/^([^#]*)(.*)$/.exec(t);s&&(n=s[2],t=s[1]);varo=/^([^\?]*)(.*)$/.exec(t);o&&(a=o[2],t=o[1]);varu=/^([^#]*)(.*)$/.exec(i);u&&(i=u[1]);vard=/^([^\?]*)(.*)$/.exec(i);d&&(i=d[1]);varl=/^((([a-z]+):)?\/\/[a-z0-9\.-]+(:[0-9]+)?\/)(.*)$/i.exec(i),c=l[3],h=l[1],f=l[5],r=null;if(/^\/\//.test(t))r=c+"://"+e.buildAbsolutePath("",t.substring(2));elseif(/^\//.test(t))r=h+e.buildAbsolutePath("",t.substring(1));else{varg=e.buildAbsolutePath(f,t);r=h+g}returna&&(r+=a),n&&(r+=n),r},buildAbsolutePath:function(n,s){for(vari,e,o=s,a="",t=n.replace(/[^\/]*$/,o.replace(/(\/|^)(?:\.?\/+)+/g,"$1")),r=0;e=t.indexOf("/../",r),e>-1;r=e+i)i=/^\/(?:\.\.\/)*/.exec(t.slice(e))[0].length,a=(a+t.substring(r,e)).replace(newRegExp("(?:\\/+[^\\/]*){0,"+(i-1)/3+"}$"),"/");returna+t.substr(r)}};t.exports=e},{}],30:[function(r,i,e){"use strict";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}}(),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(){vare=this.loader,t=this.timeoutHandle;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),t&&window.clearTimeout(t)}},{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-1)),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.onreadystatechange=this.statechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.open("GET",this.url,!0),this.byteRange&&e.setRequestHeader("Range","bytes="+this.byteRang