!function(e){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=e();elseif("function"==typeofdefine&&define.amd)define([],e);else{vart;t="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,t.Hls=e()}}(function(){vare;returnfunctione(t,r,i){functiona(s,o){if(!r[s]){if(!t[s]){varl="function"==typeofrequire&&require;if(!o&&l)returnl(s,!0);if(n)returnn(s,!0);varu=newError("Cannot find module '"+s+"'");throwu.code="MODULE_NOT_FOUND",u}vard=r[s]={exports:{}};t[s][0].call(d.exports,function(e){varr=t[s][1][e];returna(r?r:e)},d,d.exports,e,t,r,i)}returnr[s].exports}for(varn="function"==typeofrequire&&require,s=0;s<i.length;s++)a(i[s]);returna}({1:[function(e,t,r){functioni(){this._events=this._events||{},this._maxListeners=this._maxListeners||void0}functiona(e){return"function"==typeofe}functionn(e){return"number"==typeofe}functions(e){return"object"==typeofe&&null!==e}functiono(e){returnvoid0===e}t.exports=i,i.EventEmitter=i,i.prototype._events=void0,i.prototype._maxListeners=void0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if(!n(e)||e<0||isNaN(e))throwTypeError("n must be a positive number");returnthis._maxListeners=e,this},i.prototype.emit=function(e){vart,r,i,n,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceofError)throwt;vard=newError('Uncaught, unspecified "error" event. ('+t+")");throwd.context=t,d}if(r=this._events[e],o(r))return!1;if(a(r))switch(arguments.length){case1:r.call(this);break;case2:r.call(this,arguments[1]);break;case3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}elseif(s(r))for(n=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,l=0;l<i;l++)u[l].apply(this,n);return!0},i.prototype.addListener=function(e,t){varr;if(!a(t))throwTypeError("listener must be a function");returnthis._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,a(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(r=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.trace),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){functionr(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!a(t))throwTypeError("listener must be a function");vari=!1;returnr.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){varr,i,n,o;if(!a(t))throwTypeError("listener must be a function");if(!this._events||!this._events[e])returnthis;if(r=this._events[e],n=r.length,i=-1,r===t||a(r.listener)&&r.listener===t)deletethis._events[e],this._events.removeListener&&this.emit("removeListener",e,t);elseif(s(r)){for(o=n;o-->0;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)returnthis;1===r.length?(r.length=0,deletethis._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}returnthis},i.prototype.removeAllListeners=function(e){vart,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(tinthis._events)"removeListener"!==t&&this.removeAllListeners(t);returnthis.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);elseif(r)for(;r.length;)this.removeListener(e,r[r.length-1]);returndeletethis._events[e],this},i.prototype.listeners=function(e){returnthis._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){vart=this._events[e];if(a(t))return1;if(t)returnt.length}return0},i.listenerCount=function(e,t){returne.listenerCount(t)}}
i&&e(t,i),t}}(),l=e(35),u=i(l),d=e(34),f=i(d),c=e(53),h=function(e){functiont(e){a(this,t);varr=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.default.MANIFEST_LOADING,u.default.MANIFEST_LOADED,u.default.AUDIO_TRACK_LOADED));returnr.ticks=0,r.ontick=r.tick.bind(r),r}returns(t,e),o(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){this.updateTrack(this.trackId)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(e){vart=this,r=e.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});vara=0;r.forEach(function(e){if(e.default)returnt.audioTrack=a,void(i=!0);a++}),i===!1&&r.length&&(c.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id<this.tracks.length&&(c.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*e.details.targetduration)),!e.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setAudioTrackInternal",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,c.logger.log("switching to audioTrack "+e);vart=this.tracks[e],r=this.hls,i=t.type,a=t.url,n={id:e,type:i,url:a};r.trigger(u.default.AUDIO_TRACK_SWITCH,n),r.trigger(u.default.AUDIO_TRACK_SWITCHING,n);vars=t.details;!a||void0!==s&&s.live!==!0||(c.logger.log("(re)loading playlist for audioTrack "+e),r.trigger(u.default.AUDIO_TRACK_LOADING,{url:a,id:e}))}}},{key:"updateTrack",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,c.logger.log("updating audioTrack "+e);vart=this.tracks[e],r=t.url,i=t.details;!r||void0!==i&&i.live!==!0||(c.logger.log("(re)loading playlist for audioTrack "+e),this.hls.trigger(u.default.AUDIO_TRACK_LOADING,{url:r,id:e}))}}},{key:"audioTracks",get:function(){returnthis.tracks}},{key:"audioTrack",get:function(){returnthis.trackId},set:function(e){this.trackId===e&&void0!==this.tracks[e].details||this.setAudioTrackInternal(e)}}]),t}(f.default);r.default=h},{34:34,35:35,53:53}],8:[function(e,t,r){"use strict";functioni(e){returne&&e.__esModule?e:{default:e}}functiona(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionn(e,t){if(!e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeoft&&"function"!=typeoft?e:t}functions(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function, not "+typeoft);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});varo=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),l=e(35),u=i(l),d=e(34),f=i(d),c=e(53),h=e(33),g=function(e){functiont(e){a(this,t);varr=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.default.MEDIA_ATTACHING,u.default.MEDIA_DETACHING,u.default.MANIFEST_PARSED,u.default.BUFFER_RESET,u.default.BUFFER_APPENDING,u.default.BUFFER_CODECS,u.default.BUFFER_EOS,u.default.BUFFER_FLUSHING,u.default.LEVEL_PTS_UPDATED,u.default.LEVEL_UPDATED));returnr._msDuration=null,r._levelDuration=null,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}returns(t,e),o(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(e){vart=e.t
value:function(){vare=this.hls,t=e.config,r=this.media;if(void0===this.levelLastLoaded||r||!this.startFragRequested&&t.startFragPrefetch){vari=void0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;vara=e.nextLoadLevel,n=this.levels[a];if(n){vars=n.bitrate,o=void0;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);varl=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),u=l.len;if(!(u>=o)){_.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;vard=n.details;if(void0===d||d.live&&this.levelLastLoaded!==a)returnvoid(this.state=R.WAITING_LEVEL);varc=this.fragPrevious;if(!d.live&&c&&c.sn===d.endSN){if(Math.min(r.duration,c.start+c.duration)-Math.max(l.end,c.start)<=Math.max(.2,c.duration)){varh={};returnthis.altAudio&&(h.type="video"),this.hls.trigger(v.default.BUFFER_EOS,h),void(this.state=R.ENDED)}}this._fetchPayloadOrEos(i,l,d)}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,r){vari=this.fragPrevious,a=this.level,n=r.fragments,s=n.length;if(0!==s){varo=n[0].start,l=n[s-1].start+n[s-1].duration,u=t.end,d=void0;if(r.initSegment&&!r.initSegment.data)d=r.initSegment;elseif(r.live){varf=this.config.initialLiveManifestSize;if(s<f)returnvoid_.logger.warn("Can not start playback of a level, reason: not enough fragments "+s+" < "+f);if(null===(d=this._ensureFragmentAtLivePoint(r,u,o,l,i,n,s)))return}elseu<o&&(d=n[0]);d||(d=this._findFragment(o,i,s,n,u,l,r)),d&&this._loadFragmentOrKey(d,a,r,e,u)}}},{key:"_ensureFragmentAtLivePoint",value:function(e,t,r,i,a,n,s){varo=this.hls.config,l=this.media,u=void0,d=void0!==o.liveMaxLatencyDuration?o.liveMaxLatencyDuration:o.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-o.maxFragLookUpTolerance,i-d)){varf=this.liveSyncPosition=this.computeLivePosition(r,e);_.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,l&&l.readyState&&l.duration>f&&(l.currentTime=f)}if(e.PTSKnown&&t>i&&l&&l.readyState)returnnull;if(this.startFragRequested&&!e.PTSKnown){if(a){varc=a.sn+1;c>=e.startSN&&c<=e.endSN&&(u=n[c-e.startSN],_.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=n[Math.min(s-1,Math.round(s/2))],_.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}returnu}},{key:"_findFragment",value:function(e,t,r,i,a,n,s){varo=this.hls.config,l=void0,d=void0,f=o.maxFragLookUpTolerance,c=t?i[t.sn-i[0].sn+1]:void0,h=function(e){vart=Math.min(f,e.duration);returne.start+e.duration-t<=a?1:e.start-t>a&&e.start?-1:0};if(a<n?(a>n-f&&(f=0),d=c&&!h(c)?c:u.default.search(i,h)):d=i[r-1],d){l=d;varg=l.sn-s.startSN,v=t&&l.level===t.level,p=i[g-1],y=i[g+1];if(t&&l.sn===t.sn)if(v&&!l.backtracked)if(l.sn<s.endSN){varm=t.deltaPTS;m&&m>o.maxBufferHole&&t.dropped&&g?(l=p,_.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"),t.loadCounter--):(l=y,_.logger.log("SN just loaded, load next one: "+l.sn))}elsel=null;elsel.backtracked&&(y&&y.backtracked?(_.logger.warn("Already backtracked from fragment "+y.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+y.sn),l=y):(_.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,p?(p.loadCounter&&p.loadCounter--,l=p,l.backtracked=!0):l=null))}returnl}},{key:"_loadFragmentOrKey",value:function(e,t,r,i,a){varn=this.hls,s=n.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(_.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;varo=s.fragLoadingLoopThreshold;if(e.loadCounter>o&&Math.abs(this.fragLoadIdx-e.loadIdx)<o)returnvoidn.trigger(v.de
varn=i.createTextTrack("captions",i.config.captionsTextTrack2Label,i.config.captionsTextTrack1LanguageCode);n&&(n.textTrack2=!0,i.textTrack2=n)}}i.addCues("textTrack2",e,t,r)}};r.cea608Parser=newp.default(0,l,u)}returnr}returns(t,e),d(t,[{key:"addCues",value:function(e,t,r,i){for(vara=this.cueRanges,n=!1,s=a.length;s--;){varo=a[s],l=u(o[0],o[1],t,r);if(l>=0&&(o[0]=Math.min(o[0],t),o[1]=Math.max(o[1],r),n=!0,l/(r-t)>.5))return}n||a.push([t,r]),this.Cues.newCue(this[e],t,r,i)}},{key:"onInitPtsFound",value:function(e){vart=this;void0===this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(e){vart=this.media;if(t)for(varr=0;r<t.textTracks.length;r++){vari=t.textTracks[r],a="textTrack"+e;if(i[a]===!0)returni}returnnull}},{key:"createTextTrack",value:function(e,t,r){vari=this.media;if(i)returni.addTextTrack(e,t,r)}},{key:"destroy",value:function(){g.default.prototype.destroy.call(this)}},{key:"onMediaAttaching",value:function(e){this.media=e.media}},{key:"onMediaDetaching",value:function(){o(this.textTrack1),o(this.textTrack2)}},{key:"onManifestLoading",value:function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0};vare=this.media;if(e){vart=e.textTracks;if(t)for(varr=0;r<t.length;r++)o(t[r])}}},{key:"onManifestLoaded",value:function(e){vart=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=e.subtitles||[];varr=this.media?this.media.textTracks:[];this.tracks.forEach(function(e,i){vara=void0;if(i<r.length){varn=r[i];l(n,e)&&(a=n)}a||(a=t.createTextTrack("subtitles",e.name,e.lang)),a.mode=e.default?"showing":"hidden",t.textTracks.push(a)})}}},{key:"onLevelSwitching",value:function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions}},{key:"onFragLoaded",value:function(e){vart=e.frag,r=e.payload;if("main"===t.type){vari=t.sn;if(i!==this.lastSn+1){vara=this.cea608Parser;a&&a.reset()}this.lastSn=i}elseif("subtitle"===t.type)if(r.byteLength){if(void0===this.initPTS)returnvoidthis.unparsedVttFrags.push(e);varn=this.vttCCs;n[t.cc]||(n[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);vars=this.textTracks,o=this.hls;m.default.parse(r,this.initPTS,n,t.cc,function(e){varr=s[t.trackId];e.forEach(function(e){r.cues.getCueById(e.id)||r.addCue(e)}),o.trigger(c.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){E.logger.log("Failed to parse VTT cue: "+e),o.trigger(c.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})}elsethis.hls.trigger(c.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})}},{key:"onFragParsingUserdata",value:function(e){if(this.enabled&&this.config.enableCEA708Captions)for(vart=0;t<e.samples.length;t++){varr=this.extractCea608Data(e.samples[t].bytes);this.cea608Parser.addData(e.samples[t].pts,r)}}},{key:"extractCea608Data",value:function(e){for(vart,r,i,a,n,s=31&e[0],o=2,l=[],u=0;u<s;u++)t=e[o++],r=127&e[o++],i=127&e[o++],a=0!=(4&t),n=3&t,0===r&&0===i||a&&0===n&&(l.push(r),l.push(i));returnl}}]),t}(g.default);r.default=b},{34:34,35:35,49:49,53:53,57:57}],17:[function(e,t,r){"use strict";functioni(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});vara=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),n=function(){functione(t,r){i(this,e),this.subtle=t,this.aesIV=r}returna(e,[{key:"decrypt",value:function(e,t){returnthis.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}();r.default=n},{}],18:[function(e,t,r){"use strict";functioni(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});vara=function(){functione(e,
vara=e[t].unit,n=a.subarray(16,a.length-a.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),o=this;this.decryptBuffer(s,function(n){n=newUint8Array(n),a.set(n,16),i||o.decryptAacSamples(e,t+1,r)})}},{key:"decryptAacSamples",value:function(e,t,r){for(;;t++){if(t>=e.length)returnvoidr();if(!(e[t].unit.length<32)){vari=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,i),!i)return}}}},{key:"getAvcEncryptedData",value:function(e){for(vart=16*Math.floor((e.length-48)/160)+16,r=newInt8Array(t),i=0,a=32;a<=e.length-16;a+=160,i+=16)r.set(e.subarray(a,a+16),i);returnr}},{key:"getAvcDecryptedUnit",value:function(e,t){t=newUint8Array(t);for(varr=0,i=32;i<=e.length-16;i+=160,r+=16)e.set(t.subarray(r,r+16),i);returne}},{key:"decryptAvcSample",value:function(e,t,r,i,a,n){vars=this.discardEPB(a.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,function(o){a.data=l.getAvcDecryptedUnit(s,o),n||l.decryptAvcSamples(e,t,r+1,i)})}},{key:"decryptAvcSamples",value:function(e,t,r,i){for(;;t++,r=0){if(t>=e.length)returnvoidi();for(vara=e[t].units;!(r>=a.length);r++){varn=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){vars=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,i,n,s),!s)return}}}}}]),e}();r.default=o},{19:19}],32:[function(e,t,r){"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(r,"__esModule",{value:!0});varn=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),s=e(22),o=i(s),l=e(30),u=i(l),d=e(35),f=i(d),c=e(26),h=i(c),g=e(31),v=i(g),p=e(53),y=e(33),m=function(){functione(t,r,i,n){a(this,e),this.observer=t,this.config=i,this.typeSupported=n,this.remuxer=r,this.sampleAes=null}returnn(e,[{key:"setDecryptData",value:function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=newv.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(e,t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack={container:"video/mp2t",type:"video",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:0},this._audioTrack={container:"video/mp2t",type:"audio",id:-1,inputTimeScale:9e4,duration:i,sequenceNumber:0,samples:[],len:0,isAAC:!0},this._id3Track={type:"id3",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this._txtTrack={type:"text",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=r,this._duration=i}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,i){vara,n,s,o,l,u=e.length,d=!1;this.contiguous=r;varc=this.pmtParsed,h=this._avcTrack,g=this._audioTrack,v=this._id3Track,m=h.id,E=g.id,b=v.id,T=this._pmtId,k=h.pesData,_=g.pesData,R=v.pesData,A=this._parsePAT,S=this._parsePMT,L=this._parsePES,w=this._parseAVCPES.bind(this),D=this._parseAACPES.bind(this),O=this._parseMPEGPES.bind(this),I=this._parseID3PES.bind(this);for(u-=u%188,a=0;a<u;a+=188)if(71===e[a]){if(n=!!(64&e[a+1]),s=((31&e[a+1])<<8)+e[a+2],(48&e[a+3])>>4>1){if((o=a+5+e[a+4])===a+188)continue}elseo=a+4;switch(s){casem:n&&(k&&(l=L(k))&&w(l,!1),k={data:[],size:0}),k&&(k.data.push(e.subarray(o,a+188)),k.size+=a+188-o);break;caseE:n&&(_&&(l=L(_))&&(g.isAAC?D(l):O(l)),_={data:[],size:0}),_&&(_.data.push(e.subarray(o,a+188)),_.size+=a+188-o);break;caseb:n&&(R&&(l=L(R))&&I(l),R={data:[],size:0}),R&&(R.data.push(e.subarray(o,a+188)),R.size+=a+188-o);break;case0:n&&(o+=e[o]+1),T=this._pmtId=A(e,o);break;caseT:n&&(o+=e[o]+1);varP=S(e,o,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,null!=this.sampleAes);m=P.avc,m>0&&(h.id=m),E=P.audio,E>0&&(g.id=E,g.isAAC=P.isAAC),b=P.id3,b>0&&(v.id=b),d&&!c&&(p.logger.log("reparse from beginning"),d=!1,a=-188),c=this.pmtParsed=!0;break;case17
}(f.default);r.default=g},{33:33,34:34,35:35,53:53}],42:[function(e,t,r){"use strict";functioni(e){returne&&e.__esModule?e:{default:e}}functiona(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionn(e,t){if(!e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeoft&&"function"!=typeoft?e:t}functions(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function, not "+typeoft);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});varo=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),l=e(35),u=i(l),d=e(34),f=i(d),c=e(33),h=e(53),g=function(e){functiont(e){a(this,t);varr=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.default.KEY_LOADING));returnr.loaders={},r.decryptkey=null,r.decrypturl=null,r}returns(t,e),o(t,[{key:"destroy",value:function(){for(vareinthis.loaders){vart=this.loaders[e];t&&t.destroy()}this.loaders={},f.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(e){vart=e.frag,r=t.type,i=this.loaders[r],a=t.decryptdata,n=a.uri;if(n!==this.decrypturl||null===this.decryptkey){vars=this.hls.config;i&&(h.logger.warn("abort previous key loader for type:"+r),i.abort()),t.loader=this.loaders[r]=news.loader(s),this.decrypturl=n,this.decryptkey=null;varo=void0,l=void0,d=void0;o={url:n,frag:t,responseType:"arraybuffer"},l={timeout:s.fragLoadingTimeOut,maxRetry:s.fragLoadingMaxRetry,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(o,l,d)}elsethis.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(u.default.KEY_LOADED,{frag:t}))}},{key:"loadsuccess",value:function(e,t,r){vari=r.frag;this.decryptkey=i.decryptdata.key=newUint8Array(e.data),i.loader=void0,this.loaders[i.type]=void0,this.hls.trigger(u.default.KEY_LOADED,{frag:i})}},{key:"loaderror",value:function(e,t){varr=t.frag,i=r.loader;i&&i.abort(),this.loaders[t.type]=void0,this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})}},{key:"loadtimeout",value:function(e,t){varr=t.frag,i=r.loader;i&&i.abort(),this.loaders[t.type]=void0,this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})}}]),t}(f.default);r.default=g},{33:33,34:34,35:35,53:53}],43:[function(e,t,r){"use strict";functioni(e){returne&&e.__esModule?e:{default:e}}functiona(e,t){if(!e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeoft&&"function"!=typeoft?e:t}functionn(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function, not "+typeoft);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}functions(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});varo=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),l=e(2),u=i(l),d=e(35),f=i(d),c=e(34),h=i(c),g=e(33),v=e(47),p=i(v),y=e(53),m=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,E=/#EXT-X-MEDIA:(.*)/g,b=/#EXTINF:(\d*(?:\.\d+)?)(?:,(.*))?|(?!#)(\S.+)|#EXT-X-BYTERANGE:*(.+)|#EXT-X-PROG
dropped:0}),u.trigger(s.default.FRAG_PARSED)}}]),e}();r.default=o},{35:35}],47:[function(e,t,r){"use strict";functioni(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});vara=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),n=/^(\d+)x(\d+)$/,s=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){functione(t){i(this,e),"string"==typeoft&&(t=e.parseAttrList(t));for(varrint)t.hasOwnProperty(r)&&(this[r]=t[r])}returna(e,[{key:"decimalInteger",value:function(e){vart=parseInt(this[e],10);returnt>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){vart=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(varr=newUint8Array(t.length/2),i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(2*i,2*i+2),16);returnr}returnnull}},{key:"hexadecimalIntegerAsNumber",value:function(e){vart=parseInt(this[e],16);returnt>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){returnparseFloat(this[e])}},{key:"enumeratedString",value:function(e){returnthis[e]}},{key:"decimalResolution",value:function(e){vart=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){vart,r={};for(s.lastIndex=0;null!==(t=s.exec(e));){vari=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}returnr}}]),e}();r.default=o},{}],48:[function(e,t,r){"use strict";vari={search:function(e,t){for(varr=0,i=e.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=e[a];vars=t(n);if(s>0)r=a+1;else{if(!(s<0))returnn;i=a-1}}returnnull}};t.exports=i},{}],49:[function(e,t,r){"use strict";functioni(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});vara=function(){functione(e,t){for(varr=0;r<t.length;r++){vari=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}returnfunction(t,r,i){returnr&&e(t.prototype,r),i&&e(t,i),t}}(),n={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},s=function(e){vart=e;returnn.hasOwnProperty(e)&&(t=n[e]),String.fromCharCode(t)},o=15,l=100,u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},d={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],g={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){this.verboseFilter[e];this.verboseLevel}},v=function(e){for(vart=[],r=0;r<e.length;r++)t.push(e[r].toString(16));returnt},p=function(){functione(t,r,a,n,s){i(this,e),this.foreground=t||"white",this.underline=r||!1,this.italics=a||!1,this.background=n||"black",this.flash=s||!1}returna(e,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(e){for(vart=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){vari=t[r];e.hasOwnProperty(i)&&(this[i
this.retryDelay=t.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){vare,t=this.context;e="undefined"!=typeofXDomainRequest?this.loader=newXDomainRequest:this.loader=newXMLHttpRequest;varr=this.stats;r.tfirst=0,r.loaded=0;vari=this.xhrSetup;try{if(i)try{i(e,t.url)}catch(r){e.open("GET",t.url,!0),i(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){returnvoidthis.callbacks.onError({code:e.status,text:r.message},t)}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()}},{key:"readystatechange",value:function(e){vart=e.currentTarget,r=t.readyState,i=this.stats,a=this.context,s=this.config;if(!i.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){varo=t.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());varl=void0,u=void0;"arraybuffer"===a.responseType?(l=t.response,u=l.byteLength):(l=t.responseText,u=l.length),i.loaded=i.total=u;vard={url:t.responseURL,data:l};this.callbacks.onSuccess(d,i,a)}elsei.retry>=s.maxRetry||o>=400&&o<499?(n.logger.error(o+" while loading "+a.url),this.callbacks.onError({code:o,text:t.statusText},a)):(n.logger.warn(o+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),i.retry++)}elsethis.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)}},{key:"loadtimeout",value:function(){n.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(e){vart=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);varr=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),e}();r.default=s},{53:53}]},{},[40])(40)});