From e065694034db91000e3bd09854d6178282a4014c Mon Sep 17 00:00:00 2001 From: mrbar42 Date: Thu, 4 May 2017 21:16:52 +0300 Subject: [PATCH] rebuild, bump --- dist/videojs-contrib-hlsjs.min.js | 2 +- dist/videojs-contrib-hlsjs.min.js.map | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/videojs-contrib-hlsjs.min.js b/dist/videojs-contrib-hlsjs.min.js index ad2bbed..46db7d5 100644 --- a/dist/videojs-contrib-hlsjs.min.js +++ b/dist/videojs-contrib-hlsjs.min.js @@ -1,2 +1,2 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("video.js"));else if("function"==typeof define&&define.amd)define(["video.js"],t);else{var r=t("object"==typeof exports?require("video.js"):e.videojs);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){var i,i;!function(t){e.exports=t()}(function(){var e;return function e(t,r,a){function n(o,l){if(!r[o]){if(!t[o]){var u="function"==typeof i&&i;if(!l&&u)return i(o,!0);if(s)return i(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){var r=t[o][1][e];return n(r||e)},f,f.exports,e,t,r,a)}return r[o].exports}for(var s="function"==typeof i&&i,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],n=r.length,i=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(o=n;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,r,i){!function(t){var a=/^([^#]*)(.*)$/,n=/^([^\?]*)(.*)$/,s=/^(([a-z]+:\/\/)?[^:\/]+(?::[0-9]+)?)?(\/?.*)$/i,o={buildAbsoluteURL:function(e,t){if(t=t.trim(),/^[a-z]+:/i.test(t))return t;var r=null,i=null,l=a.exec(t);l&&(i=l[2],t=l[1]);var u=n.exec(t);u&&(r=u[2],t=u[1]);var d=a.exec(e);d&&(e=d[1]);var f=n.exec(e);f&&(e=f[1]);var h=s.exec(e);if(!h)throw new Error("Error trying to parse base URL.");var c=h[2]||"",g=h[1]||"",v=h[3];0!==v.indexOf("/")&&""!==g&&(v="/"+v);var p=null;return p=/^\/\//.test(t)?c+o.buildAbsolutePath("",t.substring(2)):/^\//.test(t)?g+"/"+o.buildAbsolutePath("",t.substring(1)):o.buildAbsolutePath(g+v,t),r&&(p+=r),i&&(p+=i),p},buildAbsolutePath:function(e,t){for(var r,i,a=t,n="",s=e.replace(/[^\/]*$/,a.replace(/(\/|^)(?:\.?\/+)+/g,"$1")),o=0;(i=s.indexOf("/../",o))>-1;o=i+r)r=/^\/(?:\.\.\/)*/.exec(s.slice(i))[0].length,n=(n+s.substring(o,i)).replace(new RegExp("(?:\\/+[^\\/]*){0,"+(r-1)/3+"}$"),"/");return n+s.substr(o)}};"object"==typeof i&&"object"==typeof r?r.exports=o:"function"==typeof e&&e.amd?e([],function(){return o}):"object"==typeof i?i.URLToolkit=o:t.URLToolkit=o}(this)},{}],3:[function(e,t,r){var i=arguments[3],a=arguments[4],n=arguments[5],s=JSON.stringify;t.exports=function(e,t){function r(e){p[e]=!0;for(var t in a[e][1]){var i=a[e][1][t];p[i]||r(i)}}for(var o,l=Object.keys(n),u=0,d=l.length;u500*r.duration/o){var l=e.levels,d=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/s),f=l[r.level],h=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,g=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*h/8)),p=t.currentTime,y=(g-n.loaded)/d,m=(c.default.bufferInfo(t,p,e.config.maxBufferHole).end-p)/o;if(m<2*r.duration/o&&y>m){var E=void 0,b=void 0;for(b=r.level-1;b>a;b--){var R=l[b].realBitrate?Math.max(l[b].realBitrate,l[b].bitrate):l[b].bitrate;if((E=r.duration*R/(6.4*d))=i;u--){var d=l[u],f=d.details,h=f?f.totalduration/f.fragments.length:t,c=!!f&&f.live,g=void 0;g=u<=e?s*r:o*r;var p=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,y=p*h/g;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(g)+"/"+p+"/"+h+"/"+n+"/"+y),g>p&&(!y||c||yr)return a}return 0}},{key:"maxAutoLevel",get:function(){var e=this.hls.levels,t=this._autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextABRAutoLevel",get:function(){var e=this.hls,t=this.maxAutoLevel,r=e.levels,i=e.config,a=this.minAutoLevel,n=e.media,s=this.lastLoadedFragLevel,o=this.fragCurrent?this.fragCurrent.duration:0,l=n?n.currentTime:0,u=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,f=(c.default.bufferInfo(n,l,i.maxBufferHole).end-l)/u,h=this.findBestLevel(s,o,d,a,t,f,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(h>=0)return h;v.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,y=i.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){g=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=y=1}}return h=this.findBestLevel(s,o,d,a,t,f+g,p,y,r),Math.max(h,0)}}]),t}(f.default);r.default=m},{26:26,27:27,28:28,30:30,45:45,9:9}],5:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var r=0;r0&&-1===e?(k.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=A.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=A.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=A.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=A.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var e,t,r,i,a,n,s=this,l=this.hls,u=l.config,f=function(){switch(s.state){case A.ERROR:case A.PAUSED:case A.BUFFER_FLUSHING:break;case A.STARTING:s.state=A.WAITING_TRACK,s.loadedmetadata=!1;break;case A.IDLE:var o=s.tracks;if(!o)break;if(!s.media&&(s.startFragRequested||!u.startFragPrefetch))break;e=s.loadedmetadata?s.media.currentTime:s.nextLoadPosition;var f=s.mediaBuffer?s.mediaBuffer:s.media,c=h.default.bufferInfo(f,e,u.maxBufferHole),g=c.len,v=c.end,y=s.fragPrevious,m=u.maxMaxBufferLength,E=s.audioSwitch,b=s.trackId;if(gS||c.nextStart))return{v:void 0};k.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),s.media.currentTime=S+.05}if(v<=S){if(D=R[0],r.live&&D.loadIdx&&D.loadIdx===s.fragLoadIdx){var w=c.nextStart?c.nextStart:S;return k.logger.log("no alt audio available @currentTime:"+s.media.currentTime+", seeking @"+(w+.05)),s.media.currentTime=w+.05,{v:void 0}}}else!function(){var e=void 0,t=u.maxFragLookUpTolerance;vL-t&&(t=0),(e=d.default.search(R,function(e){return e.start+e.duration-t<=v?1:e.start-t>v?-1:0}))||k.logger.log("frag not found @bufferEnd/start:"+v+"/"+S)):e=R[_-1],e&&(D=e,S=e.start,y&&D.level===y.level&&D.sn===y.sn&&(D.snO&&Math.abs(s.fragLoadIdx-D.loadIdx)=a||n)&&(k.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),s.state=A.IDLE);break;case A.WAITING_INIT_PTS:case A.STOPPED:case A.FRAG_LOADING:case A.PARSING:case A.PARSED:case A.ENDED:}}();if("object"===(void 0===f?"undefined":o(f)))return f.v}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===A.ENDED&&(this.state=A.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(e){k.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.state=A.IDLE,this.fragCurrent=null,this.state=A.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=A.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,r=e.id,i=this.tracks[r],a=t.totalduration,n=0;if(k.logger.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&t.fragments.length>0?(b.default.mergeDetails(s,t),n=t.fragments[0].start,t.PTSKnown?k.logger.log("live audio playlist sliding:"+n.toFixed(3)):k.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,!this.startFragRequested){if(-1===this.startPosition){var o=t.startTimeOffset;isNaN(o)?this.startPosition=0:(k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o)}this.nextLoadPosition=this.startPosition}this.state===A.WAITING_TRACK&&(this.state=A.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===A.KEY_LOADING&&(this.state=A.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent;if(this.state===A.FRAG_LOADING&&t&&"audio"===e.frag.type&&e.frag.level===t.level&&e.frag.sn===t.sn){this.state=A.PARSING,this.stats=e.stats;var r=this.tracks[this.trackId],i=r.details,a=i.totalduration,n=t.start,s=t.level,o=t.sn,l=t.cc,u=this.config.defaultAudioCodec||r.audioCodec;this.appended=!1,this.demuxer||(this.demuxer=new g.default(this.hls,"audio"));var d=this.initPTS[l];if(void 0!==d){this.pendingBuffering=!0,k.logger.log("Demuxing "+o+" of ["+i.startSN+" ,"+i.endSN+"],track "+s);this.demuxer.push(e.payload,u,null,n,l,s,o,a,t.decryptdata,!1,d)}else k.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+o+" of ["+i.startSN+" ,"+i.endSN+"],track "+s),this.waitingFragment=e,this.state=A.WAITING_INIT_PTS}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent;if(t&&"audio"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===A.PARSING){var r=e.tracks,i=void 0;if(r.video&&delete r.video,i=r.audio){i.levelCodec="mp4a.40.2",i.id=e.id,this.hls.trigger(p.default.BUFFER_CODECS,r),k.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.initSegment;if(a){var n={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[n]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(p.default.BUFFER_APPENDING,n))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent;r&&"audio"===e.id&&"audio"===e.type&&e.sn===r.sn&&e.level===r.level&&this.state===A.PARSING&&function(){var r=t.trackId,i=t.tracks[r],a=t.fragCurrent,n=t.hls;k.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),b.default.updateFragPTSDTS(i.details,a.sn,e.startPTS,e.endPTS);var s=t.audioSwitch,o=t.media,l=!1;if(s&&o)if(o.readyState){var u=o.currentTime;k.logger.log("switching audio track : currentTime:"+u),u>=e.startPTS&&(k.logger.log("switching audio track : flushing all audio"),t.state=A.BUFFER_FLUSHING,n.trigger(p.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),l=!0,t.audioSwitch=!1,n.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:r}))}else t.audioSwitch=!1,n.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:r});var d=t.pendingData;t.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&d.push({type:e.type,data:t,parent:"audio",content:"data"})}),!l&&d.length&&(d.forEach(function(e){t.pendingBuffering=!0,t.hls.trigger(p.default.BUFFER_APPENDING,e)}),t.pendingData=[],t.appended=!0)),t.tick()}()}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent;t&&"audio"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===A.PARSING&&(this.stats.tparsed=performance.now(),this.state=A.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==A.PARSING&&t!==A.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==A.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),r.trigger(p.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("audio buffered : "+_.default.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=A.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r,t.loadCounter=0;var a=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);k.logger.warn("audioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=performance.now()+a,this.state=A.FRAG_LOADING_WAITING_RETRY}else k.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.trigger(p.default.ERROR,e),this.state=A.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==A.ERROR&&(this.state=e.fatal?A.ERROR:A.IDLE,k.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."))}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(k.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(p.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=A.PARSED):(this.state=A.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,k.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(m.default);r.default=S},{22:22,26:26,27:27,28:28,30:30,31:31,41:41,45:45,46:46}],6:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r1&&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){var t=this,r=e.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});var a=0;r.forEach(function(e){if(e.default)return t.audioTrack=a,void(i=!0);a++}),!1===i&&r.length&&(h.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id=0&&e=0&&e.1){var a=i.updating;try{i.abort()}catch(e){a=!0,h.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(h.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+e.start),i.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video,i=0;e.altAudio&&(t||r)&&(i=(t?1:0)+(r?1:0),h.logger.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;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=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){h.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){h.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&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){h.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){h.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){h.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;h.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 t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){h.logger.error("sourceBuffer error:"+e),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value: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}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var i in e)if(!t[i]){var a=e[i],n=a.levelCodec||a.codec,s=a.container+";codecs="+n;h.logger.log("creating sourceBuffer("+s+")");try{var o=t[i]=r.addSourceBuffer(s);o.addEventListener("updateend",this.onsbue),o.addEventListener("error",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=o}catch(e){h.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){h.logger.error("sourceBuffer error:",e.event),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1,frag:this.fragCurrent})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var i in t)r&&i!==r||t[i].ended||(t[i].ended=!0,h.logger.log(i+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var r in e){var i=e[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}h.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,i=this._levelDuration;if(null!==i&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var a in r)if(r[a].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var n=e.duration;(i>this._msDuration&&i>n||n===1/0||isNaN(n))&&(h.logger.log("Updating mediasource duration to "+i.toFixed(3)),this._msDuration=t.duration=i)}}},{key:"doFlush",value: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 i in r)t+=r[i].buffered.length}catch(e){h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void h.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=t[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){h.logger.error("error while trying to append buffer:"+t.message),r.unshift(i);var s={type:c.ErrorTypes.MEDIA_ERROR};if(22===t.code)return this.segments=[],s.details=c.ErrorDetails.BUFFER_FULL_ERROR,s.fatal=!1,void e.trigger(u.default.ERROR,s);if(this.appendError?this.appendError++:this.appendError=1,s.details=c.ErrorDetails.BUFFER_APPEND_ERROR,s.frag=this.fragCurrent,this.appendError>e.config.appendErrorMaxRetry)return h.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],s.fatal=!0,void e.trigger(u.default.ERROR,s);s.fatal=!1,e.trigger(u.default.ERROR,s)}}}}},{key:"flushBuffer",value:function(e,t,r){var i,a,n,s,o,l,u=this.sourceBuffer;if(Object.keys(u).length){if(h.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,h.logger.log("flush "+d+" ["+o+","+l+"], of ["+n+","+s+"], pos:"+this.media.currentTime),i.remove(o,l),!1}catch(e){h.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else h.logger.warn("abort flushing too many retries");h.logger.log("buffer flushed")}return!0}}]),t}(f.default);r.default=g},{26:26,27:27,28:28,45:45}],8:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var t=0,r=void 0,i=void 0,a=this.mediaWidth,n=this.mediaHeight,s=0,o=0;for(r=0;r<=e&&(i=this.levels[r],!this.isLevelRestricted(r))&&(t=r,s=i.width,o=i.height,!(a<=s||n<=o));r++);return t}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(e))}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(f.default);r.default=h},{27:27,28:28}],9:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=o},{44:44}],10:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0&&n>l.config.fpsDroppedMonitoringThreshold*s){var d=l.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=d)&&(d-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value: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)}}]),t}(f.default);r.default=c},{27:27,28:28,45:45}],11:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0})}else o.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:o.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels;if(e>=0&&e1&&a.loadErrore&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){-1!==e&&(e=Math.max(e,this.hls.abrController.minAutoLevel)),this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.abrController.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.abrController.nextAutoLevel=e)}}]),t}(f.default);r.default=p},{26:26,27:27,28:28,30:30,45:45}],12:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0&&-1===e&&(T.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=k.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else T.logger.warn("cannot start loading as manifest not parsed yet"),this.state=k.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case k.ERROR:break;case k.BUFFER_FLUSHING:this.fragLoadError=0;break;case k.IDLE:if(!this._doTickIdle())return;break;case k.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=k.IDLE);break;case k.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(T.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=k.IDLE);break;case k.ERROR:case k.STOPPED:case k.FRAG_LOADING:case k.PARSING:case k.PARSED:case k.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&!r&&(this.startFragRequested||!t.startFragPrefetch))return!0;var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,n=this.levels[a],s=n.bitrate,o=void 0;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);var l=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),u=l.len;if(u>=o)return!0;T.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var d=n.details;if(void 0===d||d.live&&this.levelLastLoaded!==a)return this.state=k.WAITING_LEVEL,!0;var h=this.fragPrevious;if(!d.live&&h&&h.sn===d.endSN&&r.duration-Math.max(l.end,h.start)<=Math.max(.2,h.duration/2)){var c={};return this.altAudio&&(c.type="video"),this.hls.trigger(v.default.BUFFER_EOS,c),this.state=k.ENDED,!0}return this._fetchPayloadOrEos(i,l,d)}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var i=this.fragPrevious,a=this.level,n=r.fragments,s=n.length;if(0===s)return!1;var o=n[0].start,l=n[s-1].start+n[s-1].duration,u=t.end,d=void 0;if(r.live){var f=this.config.initialLiveManifestSize;if(sf&&(l.currentTime=f)}if(e.PTSKnown&&t>i&&l&&l.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a){var h=a.sn+1;h>=e.startSN&&h<=e.endSN&&(u=n[h-e.startSN],T.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=n[Math.min(s-1,Math.round(s/2))],T.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(e,t,r,i,a,n,s){var o=this.hls.config,l=void 0,d=void 0,f=o.maxFragLookUpTolerance;if(an-f&&(f=0),d=u.default.search(i,function(e){return e.start+e.duration-f<=a?1:e.start-f>a&&e.start?-1:0})):d=i[r-1],d&&(l=d,d.start,t&&l.level===t.level&&l.sn===t.sn))if(l.sno.maxBufferHole&&t.dropped&&c?(l=i[c-1],T.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=i[c+1],T.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;return l}},{key:"_loadFragmentOrKey",value:function(e,t,r,i,a){var n=this.hls,s=n.config;if(null==e.decryptdata.uri||null!=e.decryptdata.key){if(T.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var o=s.fragLoadingLoopThreshold;if(e.loadCounter>o&&Math.abs(this.fragLoadIdx-e.loadIdx)t.end?1:0})}},{key:"followingBufferRange",value:function(e){return e?this.getBufferRange(e.end+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(t=r.currentTime,t>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(r,t)?e=this.getBufferRange(t):f.default.isBuffered(r,t+.1)&&(e=this.getBufferRange(t+.1)),e)){var i=e.frag;i!==this.fragPlaying&&(this.fragPlaying=i,this.hls.trigger(v.default.FRAG_CHANGED,{frag:i}))}}},{key:"immediateLevelSwitch",value:function(){if(T.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.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,r=void 0,i=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,r=this.getBufferRange(e.currentTime),r&&r.start>1&&this.flushMainBuffer(0,r.start-1),e.paused)t=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],s=this.fragLastKbps;t=s&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*s)+1:0}if((i=this.getBufferRange(e.currentTime+t))&&(i=this.followingBufferRange(i))){var o=this.fragCurrent;o&&o.loader&&o.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.start,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=k.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value: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)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(T.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.loadCounter=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()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;if(T.logger.log("media seeking to "+t.toFixed(3)),this.state===k.FRAG_LOADING){var i=this.mediaBuffer?this.mediaBuffer:e,a=f.default.bufferInfo(i,t,this.config.maxBufferHole),n=this.fragCurrent;if(0===a.len&&n){var s=r.maxFragLookUpTolerance,o=n.start-s,l=n.start+n.duration+s;tl?(n.loader&&(T.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=k.IDLE):T.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===k.ENDED&&(this.state=k.IDLE);e&&(this.lastCurrentTime=t),this.state!==k.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){T.logger.log("media seeked to "+this.media.currentTime.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){T.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){T.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this.bufferRange=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,i=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&T.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var a=this.config;a.autoStartLoad&&this.hls.startLoad(a.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,i=this.levels[r],a=t.totalduration,n=0;if(T.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),this.levelLastLoaded=r,t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(n,s),t.PTSKnown?T.logger.log("live playlist sliding:"+n.toFixed(3)):T.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,T.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var o=t.startTimeOffset;isNaN(o)?t.live?(this.startPosition=this.computeLivePosition(n,t),T.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(o<0&&(T.logger.log("negative start time offset "+o+", count from end of last fragment"),o=n+a+o),T.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===k.WAITING_LEVEL&&(this.state=k.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.KEY_LOADING&&(this.state=k.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===k.FRAG_LOADING&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var i=e.stats,a=this.levels[t.level],n=a.details;if(T.logger.log("Loaded "+t.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t.level),this.bitrateTest=!1,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=k.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else{this.state=k.PARSING,this.stats=i;var s=n.totalduration,o=isNaN(t.startDTS)?t.start:t.startDTS,l=t.level,u=t.sn,d=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(T.logger.log("swapping playlist audio codec"),void 0===d&&(d=this.lastAudioCodec),d&&(d=-1!==d.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,T.logger.log("Parsing "+u+" of ["+n.startSN+" ,"+n.endSN+"],level "+l+", cc "+t.cc);var f=this.demuxer;f||(f=this.demuxer=new c.default(this.hls,"main"));var h=this.media,g=h&&h.seeking,p=!g&&(n.PTSKnown||!n.live);f.push(e.payload,d,a.videoCodec,o,t.cc,l,u,s,t.decryptdata,p,null)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent;if(t&&"main"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===k.PARSING){var r,i,a=e.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var n=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();n&&this.audioCodecSwap&&(T.logger.log("swapping playlist audio codec"),n=-1!==n.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(n="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(n="mp4a.40.2",T.logger.log("Android: force audio codec to "+n)),i.levelCodec=n,i.id=e.id}if(i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),e.unique){var o={codec:"",levelCodec:""};for(r in e.tracks)i=a[r],o.container=i.container,o.codec&&(o.codec+=",",o.levelCodec+=","),i.codec&&(o.codec+=i.codec),i.levelCodec&&(o.levelCodec+=i.levelCodec);a={audiovideo:o}}this.hls.trigger(v.default.BUFFER_CODECS,a);for(r in a){i=a[r],T.logger.log("main track:"+r+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var l=i.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:r,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent;if(r&&"main"===e.id&&e.sn===r.sn&&e.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===k.PARSING){var i=this.levels[this.level],a=this.fragCurrent;T.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0));var n=E.default.updateFragPTSDTS(i.details,a.sn,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(v.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:n,type:e.type,start:e.startPTS,end:e.endPTS}),"video"===e.type&&(a.dropped=e.dropped),[e.data1,e.data2].forEach(function(r){r&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent;t&&"main"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===k.PARSING&&(this.stats.tparsed=performance.now(),this.state=k.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){T.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(T.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.IDLE}var a=this.hls;a.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(T.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,i=void 0,a=!1;for(var n in t){var s=t[n];"main"===s.id?(i=n,r=s,"video"===n&&(this.videoBuffer=t[n].buffer)):a=!0}a&&r?(T.logger.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==k.PARSING&&t!==k.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){var e=this;if(!(this.state!==k.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;t&&function(){var r=e.mediaBuffer?e.mediaBuffer:e.media;T.logger.log("main buffered : "+R.default.toString(r.buffered));var i=e.bufferRange.filter(function(e){return f.default.isBuffered(r,(e.start+e.end)/2)});i.push({type:t.type,start:t.startPTS,end:t.endPTS,frag:t}),e.bufferRange=i.sort(function(e,t){return e.start-t.start}),e.fragPrevious=t;var a=e.stats;a.tbuffered=performance.now(),e.fragLastKbps=Math.round(8*a.total/(a.tbuffered-a.tfirst)),e.hls.trigger(v.default.FRAG_BUFFERED,{stats:a,frag:t,id:"main"}),e.state=k.IDLE}(),this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,i=r&&f.default.isBuffered(r,r.currentTime)&&f.default.isBuffered(r,r.currentTime+.5);switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var a=this.fragLoadError;a?a++:a=1;var n=this.config;if(a<=n.fragLoadingMaxRetry||i||t.autoLevel&&t.level){this.fragLoadError=a,t.loadCounter=0;var s=Math.min(Math.pow(2,a-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);T.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=k.FRAG_LOADING_WAITING_RETRY}else T.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.trigger(v.default.ERROR,e),this.state=k.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(i?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.hls.trigger(v.default.ERROR,e),this.state=k.ERROR));break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.ERROR&&(e.fatal?(this.state=k.ERROR,T.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):this.state===k.WAITING_LEVEL&&(this.state=k.IDLE));break;case _.ErrorDetails.BUFFER_FULL_ERROR:this.state!==k.PARSING&&this.state!==k.PARSED||(i?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):(T.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,T.logger.warn("reduce max buffer length to "+t.maxMaxBufferLength+"s and switch to IDLE state"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var t=e.currentTime,r=this.mediaBuffer?this.mediaBuffer:e,i=r.buffered;if(this.loadedmetadata||!i.length||e.seeking)if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var a=f.default.bufferInfo(e,t,0),n=!(e.paused||e.ended||0===e.buffered.length),s=t!==this.lastCurrentTime,o=this.config;if(s)this.stallReported&&(T.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(n){var l=performance.now(),u=this.hls;if(this.stalled){var d=l-this.stalled,h=a.len,c=this.nudgeRetry||0;if(h<=.5&&d>1e3*o.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,T.logger.warn("playback stalling in low buffer @"+t),u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}));var g=a.nextStart,p=g-t;if(g&&p0){this.nudgeRetry=++c;var y=c*o.nudgeOffset;T.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+g+" + nudge "+y),e.currentTime=g+y,this.stalled=void 0,u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:g+y-t})}}else if(h>.5&&d>1e3*o.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,T.logger.warn("playback stalling in high buffer @"+t),u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h})),this.stalled=void 0,this.nudgeRetry=++c,c"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferRange(e.currentTime);if(t)return t.frag.level}return-1}},{key:"nextBufferRange",get:function(){var e=this.media;return e?this.followingBufferRange(this.getBufferRange(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferRange;return e?e.frag.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(y.default);r.default=A},{22:22,26:26,27:27,28:28,30:30,31:31,41:41,45:45,46:46}],13:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0;)e.removeCue(e.cues[0])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var r=0;r>>8^255&g^99,e[f]=g,t[g]=f;var v=d[f],p=d[v],y=d[p],m=257*d[g]^16843008*g;r[f]=m<<24|m>>>8,i[f]=m<<16|m>>>16,a[f]=m<<8|m>>>24,n[f]=m,m=16843009*y^65537*p^257*v^16843008*f,s[g]=m<<24|m>>>8,o[g]=m<<16|m>>>16,l[g]=m<<8|m>>>24,u[g]=m,f?(f=v^d[d[d[y^v]]],h^=d[d[h]]):f=h=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var i,a,n=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,l=this.invSubMix[0],u=this.invSubMix[1],d=this.invSubMix[2],f=this.invSubMix[3],h=this.uint8ArrayToUint32Array_(r),c=h[0],g=h[1],v=h[2],p=h[3],y=new Int32Array(e),m=new Int32Array(y.length),E=void 0,b=void 0,R=void 0,_=void 0,T=void 0,k=void 0,A=void 0,S=void 0,L=void 0,D=void 0,w=void 0,O=void 0;t>>24]^u[k>>16&255]^d[A>>8&255]^f[255&S]^s[i],b=l[k>>>24]^u[A>>16&255]^d[S>>8&255]^f[255&T]^s[i+1],R=l[A>>>24]^u[S>>16&255]^d[T>>8&255]^f[255&k]^s[i+2],_=l[S>>>24]^u[T>>16&255]^d[k>>8&255]^f[255&A]^s[i+3],T=E,k=b,A=R,S=_,i+=4;E=o[T>>>24]<<24^o[k>>16&255]<<16^o[A>>8&255]<<8^o[255&S]^s[i],b=o[k>>>24]<<24^o[A>>16&255]<<16^o[S>>8&255]<<8^o[255&T]^s[i+1],R=o[A>>>24]<<24^o[S>>16&255]<<16^o[T>>8&255]<<8^o[255&k]^s[i+2],_=o[S>>>24]<<24^o[T>>16&255]<<16^o[k>>8&255]<<8^o[255&A]^s[i+3],i+=3,m[t]=this.networkToHostOrderSwap(E^c),m[t+1]=this.networkToHostOrderSwap(_^g),m[t+2]=this.networkToHostOrderSwap(R^v),m[t+3]=this.networkToHostOrderSwap(b^p),c=L,g=D,v=w,p=O,t+=4}return m.buffer}},{key:"destroy",value: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}();r.default=n},{}],16:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>5,(v-=E)>0&&m+E+v<=R);)for(b=k+y*p,_={unit:e.subarray(m+E,m+E+v),pts:b,dts:b},c.samples.push(_),c.len+=v,m+=v+E,y++;m>>6),(o=(60&t[r+2])>>>2)>c.length-1?void e.trigger(Event.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o}):(u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+i+",ADTS data:type:"+a+",sampleingIndex:"+o+"["+c[o]+"Hz],channelConfig:"+u),/firefox/i.test(f)?o>=6?(a=5,d=new Array(4),l=o-3):(a=2,d=new Array(2),l=o):-1!==f.indexOf("android")?(a=2,d=new Array(2),l=o):(a=5,d=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&o>=6?l=o-3:((i&&-1!==i.indexOf("mp4a.40.2")&&o>=6&&1===u||!i&&1===u)&&(a=2,d=new Array(2)),l=o)),d[0]=a<<3,d[0]|=(14&o)>>1,d[1]|=(1&o)<<7,d[1]|=u<<3,5===a&&(d[1]|=(14&l)>>1,d[2]=(1&l)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:c[o],channelCount:u,codec:"mp4a.40."+a,manifestCodec:h})}}]),e}();r.default=o},{26:26,45:45}],20:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:null;a(this,e),this.hls=t,this.id=r,this.config=this.hls.config||n,this.typeSupported=i}return n(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,r,i,a,n,s,l,u,f,h){if(e.byteLength>0&&null!=u&&null!=u.key&&"AES-128"===u.method){null==this.decrypter&&(this.decrypter=new d.default(this.hls,this.config));var c,g=this;try{c=performance.now()}catch(e){c=Date.now()}this.decrypter.decrypt(e,u.key.buffer,u.iv.buffer,function(e){var u;try{u=performance.now()}catch(e){u=Date.now()}g.hls.trigger(o.default.FRAG_DECRYPTED,{level:n,sn:s,stats:{tstart:c,tdecrypt:u}}),g.pushDecrypted(new Uint8Array(e),t,r,i,a,n,s,l,f,h)})}else this.pushDecrypted(new Uint8Array(e),t,r,i,a,n,s,l,f,h)}},{key:"pushDecrypted",value:function(e,t,r,i,a,n,s,u,d,f){var c=this.demuxer;if(!c||a!==this.cc&&!c.probe(e)){var v=this.hls,y=this.id,E=this.config,b=this.typeSupported;if(g.default.probe(e))c=!0===this.typeSupported.mp2t?new g.default(v,y,m.default,E,b):new g.default(v,y,p.default,E,b),c.probe=g.default.probe;else{if(!h.default.probe(e))return void v.trigger(o.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,id:y,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});c=new h.default(v,y,p.default,E,b),c.probe=h.default.probe}this.demuxer=c}c.push(e,t,r,i,a,n,s,u,d,f),this.cc=a}}]),e}();r.default=E},{16:16,18:18,25:25,26:26,28:28,38:38,39:39}],21:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=e(20),n=i(a),s=e(28),o=i(s),l=e(45),u=e(1),d=i(u),f=function(e){var t=new d.default;t.trigger=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;ae?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r,i=8,a=8;for(t=0;t>4>1){if((p=f+5+e[f+4])===f+188)continue}else p=f+4;switch(v){case A:if(g){if(w&&(y=x(w))&&(M(y,!1),E&&_.codec&&(-1===S||T.codec)))return void this.remux(n,s,a,e,i);w={data:[],size:0}}w&&(w.data.push(e.subarray(p,f+188)),w.size+=f+188-p);break;case S:if(g){if(O&&(y=x(O))&&(T.isAAC?F(y):N(y),E&&T.codec&&(-1===A||_.codec)))return void this.remux(n,s,a,e,i);O={data:[],size:0}}O&&(O.data.push(e.subarray(p,f+188)),O.size+=f+188-p);break;case L:g&&(I&&(y=x(I))&&U(y),I={data:[],size:0}),I&&(I.data.push(e.subarray(p,f+188)),I.size+=f+188-p);break;case 0:g&&(p+=e[p]+1),D=this._pmtId=P(e,p);break;case D:g&&(p+=e[p]+1);var G=C(e,p,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3);A=G.avc,A>0&&(_.id=A),S=G.audio,S>0&&(T.id=S,T.isAAC=G.isAAC),L=G.id3,L>0&&(k.id=L),b&&!R&&(h.logger.log("reparse from beginning"),b=!1,f=-188),R=this.pmtParsed=!0;break;case 17:case 8191:break;default:b=!0}}else this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,id:this.id,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w&&(y=x(w))?(M(y,!0),_.pesData=null):_.pesData=w,O&&(y=x(O))?(T.isAAC?F(y):N(y),T.pesData=null):(O&&O.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),T.pesData=O),I&&(y=x(I))?(U(y),k.pesData=null):k.pesData=I,this.remux(n,s,a,null,i,d)}},{key:"remux",value:function(e,t,r,i,a,n){for(var s=this._avcTrack,o=s.samples,l=0,u=0,d=0;d1;){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(t=d[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;r=t[7],192&r&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,s>4294967295&&(s-=8589934592),64&r?(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,o>4294967295&&(o-=8589934592),s-o>54e5&&(h.logger.warn(Math.round((s-o)/9e4)+"s delta between PTS and DTS, align them"),s=o)):o=s),a=t[8],l=a+9,e.size-=l,n=new Uint8Array(e.size);for(var c=0,g=d.length;cv){l-=v;continue}t=t.subarray(l),v-=l,l=0}n.set(t,u),u+=v}return i&&(i-=a+3),{data:n,pts:s,dts:o,len:i}}return null}},{key:"pushAccesUnit",value:function(e,t){e.units.units.length&&e.frame&&(!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(t.samples.length||this.contiguous)?t.samples.push(e):t.dropped++),e.debug.length&&h.logger.log(e.pts+"/"+e.dts+":"+e.debug+","+e.units.length)}},{key:"_parseAVCPES",value:function(e,t){var r,i,a,n=this,s=this._avcTrack,o=this._parseAVCNALu(e.data),l=this.avcSample;e.data=null,o.forEach(function(t){switch(t.type){case 1:i=!0,l.frame=!0;var o=t.data;if(o.length>4){var u=new f.default(o).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=n._createAVCSample(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new f.default(n.discardEPB(t.data)),r.readUByte();for(var d=0,h=0,c=!1,g=0;!c&&r.bytesAvailable>1;){d=0;do{g=r.readUByte(),d+=g}while(255===g);h=0;do{g=r.readUByte(),h+=g}while(255===g);if(4===d&&0!==r.bytesAvailable){c=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var v=r.readUByte(),p=r.readUByte(),y=31&v,m=[v,p];for(a=0;a0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts=0)i={data:e.subarray(h,s-u-1),type:n},f.push(i);else{var c=this._getLastNalUnit();if(c&&(d&&s<=4-d&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-d)),(r=s-u-1)>0)){var g=new Uint8Array(c.data.byteLength+r);g.set(c.data,0),g.set(e.subarray(0,r),c.data.byteLength),c.data=g}}s=0&&u>=0&&(i={data:e.subarray(h,o),type:n,state:u},f.push(i)),0===f.length){var v=this._getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return l.naluState=u,f}},{key:"discardEPB",value:function(e){for(var t,r,i=e.byteLength,a=[],n=1;n1&&(h.logger.log("AAC: align PTS for overlapping frames by "+Math.round((T-p)/90)),p=T)}for(;n+5>>5,(r-=s)>0&&n+s+r<=d);)for(l=p+a*i,f={unit:v.subarray(n+s,n+s+r),pts:l,dts:l},g.samples.push(f),g.len+=r,n+=r+s,a++;n0;)s+=t}},{key:"_onMpegFrame",value:function(e,t,r,i,a,n){var s=1152/r*1e3,o=n+a*s,l=this._audioTrack;l.config=[],l.channelCount=i,l.audiosamplerate=r,l.duration=this._duration,l.samples.push({unit:e,pts:o,dts:o}),l.len+=e.length}},{key:"_onMpegNoise",value:function(e){h.logger.warn("mpeg audio has noise: "+e.length+" bytes")}},{key:"_parseMpeg",value:function(e,t,r,i,a){var n=[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],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(t+2>r)return-1;if(255===e[t]||224==(224&e[t+1])){if(t+24>r)return-1;var o=e[t+1]>>3&3,l=e[t+1]>>1&3,u=e[t+2]>>4&15,d=e[t+2]>>2&3,f=!!(2&e[t+2]);if(1!==o&&0!==u&&15!==u&&3!==d){var h=3===o?3-l:3===l?3:4,c=1e3*n[14*h+u-1],g=3===o?0:2===o?1:2,v=s[3*g+d],p=f?1:0,y=e[t+3]>>6==3?1:2,m=3===l?(3===o?12:6)*c/v+p<<2:(3===o?144:72)*c/v+p|0;return t+m>r?-1:(this._onMpegFrame&&this._onMpegFrame(e.subarray(t,t+m),c,v,y,i,a),m)}}for(var E=t+2;E=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=g},{19:19,23:23,26:26,28:28,45:45}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={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_LOOP_LOADING_ERROR:"fragLoopLoadingError",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"}},{}],27:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r1?r-1:0),n=1;n=r.start(i)&&t<=r.end(i))return!0;return!1}},{key:"bufferInfo",value:function(e,t,r){if(e){var i,a=e.buffered,n=[];for(i=0;id&&(l[u-1].end=e[o].end):l.push(e[o])}else l.push(e[o])}for(o=0,i=0,a=n=t;o=f&&t=0&&ot.endSN)return 0;if(o=r-t.startSN,l=t.fragments,u=l[o],!isNaN(u.startPTS)){var f=Math.abs(u.startPTS-i);isNaN(u.deltaPTS)?u.deltaPTS=f:u.deltaPTS=Math.max(f,u.deltaPTS),i=Math.min(i,u.startPTS),a=Math.max(a,u.endPTS),n=Math.min(n,u.startDTS),s=Math.max(s,u.endDTS)}var h=i-u.start;for(u.start=u.startPTS=i,u.endPTS=a,u.startDTS=n,u.endDTS=s,u.duration=a-i,d=o;d>0;d--)e.updatePTS(l,d,d-1);for(d=o;dt?i.start+i.duration:i.start-a.duration:r>t?(i.duration=s-i.start,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-s,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}}]),e}();r.default=s},{45:45}],32:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var r=e.DefaultConfig;if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var i in r)i in t||(t[i]=r[i]);if(void 0!==t.liveMaxLatencyDurationCount&&t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(t.liveMaxLatencyDuration<=t.liveSyncDuration||void 0===t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,I.enableLogs)(t.debug),this.config=t;var n=this.observer=new M.default;n.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:-1;I.logger.log("startLoad("+e+")"),this.levelController.startLoad(),this.streamController.startLoad(e),this.audioStreamController.startLoad(e)}},{key:"stopLoad",value:function(){I.logger.log("stopLoad"),this.levelController.stopLoad(),this.streamController.stopLoad(),this.audioStreamController.stopLoad()}},{key:"swapAudioCodec",value:function(){I.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){I.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){I.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){I.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){I.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.abrController.minAutoLevel)},set:function(e){I.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){I.logger.log("set startLevel:"+e),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this.abrController.autoLevelCapping},set:function(e){I.logger.log("set autoLevelCapping:"+e),this.abrController.autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"audioTracks",get:function(){return this.audioTrackController.audioTracks}},{key:"audioTrack",get:function(){return this.audioTrackController.audioTrack},set:function(e){this.audioTrackController.audioTrack=e}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}}]),e}();r.default=B},{1:1,10:10,11:11,12:12,13:13,26:26,28:28,34:34,35:35,36:36,4:4,43:43,45:45,47:47,5:5,6:6,7:7,8:8}],33:[function(e,t,r){"use strict";t.exports=e(32).default},{32:32}],34:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&(r=new R,r.method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl)),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[];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]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),T=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING));return r.loaders={},r}return n(t,e),o(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},c.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var i=r.context;if(i&&i.url===e)return void y.logger.trace("playlist request ongoing");y.logger.warn("abort previous loader for type:"+t.type),r.abort()}var a=this.hls.config,n=void 0,s=void 0,o=void 0,l=void 0;"manifest"===t.type?(n=a.manifestLoadingMaxRetry,s=a.manifestLoadingTimeOut,o=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):(n=a.levelLoadingMaxRetry,s=a.levelLoadingTimeOut,o=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,y.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),t.url=e,t.responseType="";var u=void 0,d=void 0;u={timeout:s,maxRetry:n,retryDelay:o,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,u,d)}},{key:"resolve",value:function(e,t){return u.default.buildAbsoluteURL(t,e)}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],i=void 0;for(m.lastIndex=0;null!=(i=m.exec(e));){var a={},n=a.attrs=new p.default(i[1]);a.url=this.resolve(i[2],t);var s=n.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=n.decimalInteger("AVERAGE-BANDWIDTH")||n.decimalInteger("BANDWIDTH"),a.name=n.NAME;var o=n.CODECS;if(o){o=o.split(/[ ,]+/);for(var l=0;l2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,i){var a,n,s=0,o=0,l={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},u=new R,d=0,f=null,h=new _;for(b.lastIndex=0;null!==(a=b.exec(e));){var c=a[1];if(c){h.duration=parseFloat(c);var g=(" "+a[2]).slice(1);h.title=g||null,h.tagList.push(g?["INF",c,g]:["INF",c])}else if(a[3]){if(!isNaN(h.duration)){var v=s++;h.type=i,h.start=o,h.levelkey=u,h.sn=v,h.level=r,h.cc=d,h.baseurl=t,h.relurl=(" "+a[3]).slice(1),l.fragments.push(h),f=h,o+=h.duration,h=new _}}else if(a[4]){if(h.rawByteRange=(" "+a[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(h.lastByteRangeEndOffset=m)}}else if(a[5])h.rawProgramDateTime=(" "+a[5]).slice(1),h.tagList.push(["PROGRAM-DATE-TIME",h.rawProgramDateTime]);else{for(a=a[0].match(/(?:(?:#(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=1;n0){var u="audioTrack"!==n,d=this.parseLevelPlaylist(i,a,(u?o:s)||0,u?"main":"audio");"manifest"===n&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:a,details:d}],audioTracks:[],url:a,stats:t}),t.tparsed=performance.now(),d.targetduration?u?l.trigger(f.default.LEVEL_LOADED,{details:d,level:o||0,id:s||0,stats:t}):l.trigger(f.default.AUDIO_TRACK_LOADED,{details:d,id:s,stats:t}):l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(i,a);if(h.length){var c=this.parseMasterPlaylistMedia(i,a,"AUDIO");if(c.length){var v=!1;c.forEach(function(e){e.url||(v=!0)}),!1===v&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(y.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),c.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:c,url:a,stats:t})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest"})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,response:e,context:t})}},{key:"loadtimeout",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_TIMEOUT,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_TIMEOUT,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,context:t})}}]),t}(c.default);r.default=T},{2:2,26:26,27:27,28:28,40:40,45:45}],37:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=255&i,t.set(e,4),a=0,i=8;a>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))}},{key:"moov",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){r*=t;var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,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 e.box(e.types.mvhd,i)}},{key:"sdtp",value:function(t){var r,i,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(i));var o=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),l=t.width,u=t.height,d=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.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,l>>8&255,255&l,u>>8&255,255&u,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,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value: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]))}},{key:"mp4a",value:function(t){var r=t.audiosamplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.audiosamplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,i=t.duration*t.timescale,a=t.width,n=t.height;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,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,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))}},{key:"traf",value:function(t,r){var i=e.sdtp(t),a=t.id;return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),e.trun(t,i.length+16+16+8+16+8+8),i)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var i,a,n,s,o,l,u=t.samples||[],d=u.length,f=12+16*d,h=new Uint8Array(f);for(r+=8+f,h.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,h)}},{key:"initSegment",value:function(t){e.types||e.init();var r,i=e.moov(t);return r=new Uint8Array(e.FTYP.byteLength+i.byteLength),r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r}}]),e}();r.default=n},{}],38:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;rMath.pow(2,32)&&function(){e.timescale=e.audiosamplerate/function e(t,r){return r?e(r,t%r):t}(e.audiosamplerate,e.isAAC?1024:1152)}(),d.logger.log("audio mp4 timescale :"+e.timescale),e.isAAC||(g.mpeg?(v="audio/mpeg",e.codec=""):g.mp3&&(e.codec="mp3")),p.audio={container:v,codec:e.codec,initSegment:!e.isAAC&&g.mpeg?new Uint8Array:h.default.initSegment([e]),metadata:{channelCount:e.channelCount}},m&&(a=n=o[0].pts-f*r)),t.sps&&t.pps&&l.length&&(t.timescale=this.MP4_TIMESCALE,p.video={container:"video/mp4",codec:t.codec,initSegment:h.default.initSegment([t]),metadata:{width:t.width,height:t.height}},m&&(a=Math.min(a,l[0].pts-f*r),n=Math.min(n,l[0].dts-f*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{id:this.id,initPTS:a,cc:i}))),Object.keys(p).length?(s.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,y),this.ISGenerated=!0,m&&(this._initPTS=a,this._initDTS=n)):s.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,id:this.id,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,i){var a,n,s,o,l,f,g,v=8,p=this.PES_TIMESCALE,y=this.PES2MP4SCALEFACTOR,m=e.samples,E=[],b=m.length,R=this._PTSNormalize,_=this._initDTS;m.sort(function(e,t){var r=e.dts-t.dts;return r||e.pts-t.pts});var T=m.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(T<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var k=0;k1?d.logger.log("AVC:"+L+" ms hole between fragments detected,filling it"):L<-1&&d.logger.log("AVC:"+-L+" ms overlapping between fragments detected"),l=A,m[0].dts=l+_,o=Math.max(o-L,A),m[0].pts=o+_,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(o/90)+"/"+Math.round(l/90)+",delta:"+L+" ms")),S=m[m.length-1],g=Math.max(R(S.dts-_,A),0),f=Math.max(R(S.pts-_,A),0),f=Math.max(f,g);var D=navigator.vendor,w=navigator.userAgent,O=D&&D.indexOf("Apple")>-1&&w&&!w.match("CriOS");O&&(a=Math.round((g-l)/(y*(m.length-1))));for(var I=0;I0?M-1:M].dts;if(V.stretchShortVideoTrack){var X=V.maxBufferHole,q=V.maxSeekHole,z=Math.floor(Math.min(X,q)*p),J=(i?o+i*p:this.nextAudioPts)-F.pts;J>z?(a=J-Y,a<0&&(a=Y),d.logger.log("It is approximately "+J/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=Y}else a=Y}a/=y,G=Math.round((F.pts-F.dts)/y)}E.push({size:U,duration:a,cts:G,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:F.key?2:1,isNonSync:F.key?0:1}})}this.nextAvcDts=g+a*y;var $=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,E.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Q=E[0].flags;Q.dependsOn=2,Q.isNonSync=0}e.samples=E,s=h.default.moof(e.sequenceNumber++,l/y,e),e.samples=[];var Z={id:this.id,level:this.level,sn:this.sn,data1:s,data2:n,startPTS:o/p,endPTS:(f+y*a)/p,startDTS:l/p,endDTS:this.nextAvcDts/p,type:"video",nb:E.length,dropped:$};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Z),Z}},{key:"remuxAudio",value:function(e,t,r,i){var a,n,s,l,f,g,v,p,y,m,E,b,R,_,T,k,A=this.PES_TIMESCALE,S=e.timescale,L=A/S,D=e.timescale*(e.isAAC?1024:1152)/e.audiosamplerate,w=D*L,O=this._PTSNormalize,I=this._initDTS,P=!e.isAAC&&this.typeSupported.mpeg,C=P?0:8,x=[],M=[];if(e.samples.sort(function(e,t){return e.pts-t.pts}),M=e.samples,k=this.nextAudioPts,r|=M.length&&k&&(Math.abs(t-k/A)<.1||Math.abs(M[0].pts-k-this._initDTS)<20*w),r||(k=t*A),i&&e.isAAC)for(var F=0,N=k;F=w&&N){var j=Math.round(B/w);d.logger.warn("Injecting "+j+" audio frame @ "+Math.round(N/90)/1e3+"s due to "+Math.round(B/90)+" ms gap.");for(var H=0;H0)Y=Math.round((b-k)/w),d.logger.log(V+" ms hole between AAC samples detected,filling it"),Y>0&&(_=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),_||(_=l.subarray()),e.len+=Y*_.length);else if(V<-12){d.logger.log(-V+" ms overlapping between AAC samples detected, drop frame"),e.len-=l.byteLength;continue}b=R=k}if(v=Math.max(0,b),p=Math.max(0,R),!(e.len>0))return;var X=P?e.len:e.len+8;try{f=new Uint8Array(X)}catch(e){return void this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,level:this.level,id:this.id,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:X,reason:"fail allocating audio mdat "+X})}P||(a=new DataView(f.buffer),a.setUint32(0,X),f.set(h.default.types.mdat,4));for(var q=0;q=2&&(J=x[$-2].duration,s.duration=J),$){this.nextAudioPts=b+L*J,e.len=0,e.samples=x,g=P?new Uint8Array:h.default.moof(e.sequenceNumber++,p/L,e),e.samples=[];var Q={id:this.id,level:this.level,sn:this.sn,data1:g,data2:f,startPTS:v/A,endPTS:this.nextAudioPts/A,startDTS:p/A,endDTS:(R+L*J)/A,type:"audio",nb:$};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Q),Q}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,i){var a=this.PES_TIMESCALE,n=e.timescale?e.timescale:e.audiosamplerate,s=a/n,l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*a)+this._initDTS,f=i.endDTS*a+this._initDTS,h=1024*s,c=Math.ceil((f-u)/h),g=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(d.logger.warn("remux empty Audio"),!g)return void d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],p=0;p4294967296;)e+=r;return e}},{key:"passthrough",get:function(){return!1}}]),e}();r.default=g},{26:26,28:28,29:29,37:37,45:45}],39:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value: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),i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(s.lastIndex=0;null!==(t=s.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r}}]),e}();r.default=o},{}],41:[function(e,t,r){"use strict";var i={search:function(e,t){for(var r=0,i=e.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=e[a];var s=t(n);if(s>0)r=a+1;else{if(!(s<0))return n;i=a-1}}return null}};t.exports=i},{}],42:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=r&&console.log(this.time+" ["+e+"] "+t)}},v=function(e){for(var t=[],r=0;rl&&(g.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=s(e);if(this.pos>=l)return void g.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),b=function(){function e(t,r){i(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new E,this.nonDisplayedMemory=new E,this.lastOutputScreen=new E,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return a(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e,this.lastOutputScreen)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,g.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset(),this.lastOutputScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}g.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=g.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),R=function(){function e(t,r,a){i(this,e),this.field=t||1,this.outputs=[r,a],this.channels=[new b(1,r),new b(2,a)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return a(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var r,i,a,n=!1;this.lastTime=e,g.setTime(e);for(var s=0;s ("+v([i,a])+")"),r=this.parseCmd(i,a),r||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(n=this.parseChars(i,a)))if(this.currChNr&&this.currChNr>=0){var o=this.channels[this.currChNr-1];o.insertChars(n)}else g.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:n?this.dataCounters.char+=2:(this.dataCounters.other+=2,g.log("WARNING","Couldn't parse cleaned data "+v([i,a])+" orig: "+v([t[s],t[s+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var r=null,i=(20===e||28===e)&&32<=t&&t<=47,a=(23===e||31===e)&&33<=t&&t<=35;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,g.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"parseMidrow",value:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return g.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(t),g.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,i=null,a=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,n=(16===e||24===e)&&64<=t&&t<=95;if(!a&&!n)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,i=64<=t&&t<=95?1===r?u[e]:f[e]:1===r?d[e]:h[e];var s=this.interpretPAC(i,t);return this.channels[r-1].setPAC(s),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(e,t){var r=t,i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}},{key:"parseChars",value:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var n=t;n=17===a?t+80:18===a?t+112:t+144,g.log("INFO","Special char '"+s(n)+"' in channel "+r),i=[n]}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t]);if(i){var o=v(i);g.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i}},{key:"parseBackgroundAttributes",value:function(e,t){var r,i,a,n,s=(16===e||24===e)&&32<=t&&t<=47,o=(23===e||31===e)&&45<=t&&t<=47;return!(!s&&!o)&&(r={},16===e||24===e?(i=Math.floor((t-32)/2),r.background=c[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,n=this.channels[a-1],n.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e=16?o--:o++,navigator.userAgent.match(/Firefox\//)?n.line=d+1:n.line=d>7?d-2:d+1,n.align="left",n.position=Math.max(0,Math.min(100,o/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(n)}}};t.exports=i},{}],44:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r "+t}function n(e){var t=self.console[e];return t?function(){for(var r=arguments.length,i=Array(r),n=0;n1?t-1:0),i=1;i=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var o=t.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===a.responseType?(l=t.response,u=l.byteLength):(l=t.responseText,u=l.length),i.loaded=i.total=u;var d={url:t.responseURL,data:l};this.callbacks.onSuccess(d,i,a)}else i.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++)}else this.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){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var r=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),e}();r.default=s},{45:45}]},{},[33])(33)})},function(t,r){t.exports=e},function(e,t,r){"use strict";function i(e,t){function r(){var e=null,t=null;return function(){var r=Date.now();!e||r-e>2e3?(e=r,o.recoverMediaError()):!t||r-t>2e3?(t=r,o.swapAudioCodec(),o.recoverMediaError()):console.error("Error loading media: File could not be played")}}var i=t.options_,n=t.el(),s=null,o=new a(i.hlsjsConfig),l=r(),u=r();n.addEventListener("error",function(e){var t=e.currentTarget.error;t.code===t.MEDIA_ERR_DECODE?u():console.error("Error loading media: File could not be played")}),this.dispose=function(){o.destroy()},this.duration=function(){return s||n.duration||0},o.on(a.Events.LEVEL_LOADED,function(e,t){s=t.details.live?1/0:t.details.totalduration}),o.on(a.Events.ERROR,function(e,t){if(t.fatal)switch(t.type){case a.ErrorTypes.NETWORK_ERROR:o.startLoad();break;case a.ErrorTypes.MEDIA_ERROR:l();break;default:console.error("Error loading media: File could not be played")}}),Object.keys(a.Events).forEach(function(e){var r=a.Events[e];o.on(r,function(e,i){t.trigger(r,i)})}),o.attachMedia(n),o.loadSource(e.src)}var a=r(0),n={canHandleSource:function(e){var t=/^application\/x-mpegURL$/i,r=/\.m3u8/i;return e.skipContribHlsJs?"":t.test(e.type)?"probably":r.test(e.src)?"maybe":""},handleSource:function(e,t){return new i(e,t)},canPlayType:function(e){return/^application\/x-mpegURL$/i.test(e)?"probably":""}};if(a.isSupported()){var s=r(1);s?s.getComponent("Html5").registerSourceHandler(n,0):console.warn("videojs-contrib-hls.js: Couldn't find find window.videojs nor require('video.js')")}}])}); +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("video.js"));else if("function"==typeof define&&define.amd)define(["video.js"],t);else{var r=t("object"==typeof exports?require("video.js"):e.videojs);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){var i,i;!function(t){e.exports=t()}(function(){var e;return function e(t,r,a){function n(o,l){if(!r[o]){if(!t[o]){var u="function"==typeof i&&i;if(!l&&u)return i(o,!0);if(s)return i(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){var r=t[o][1][e];return n(r||e)},f,f.exports,e,t,r,a)}return r[o].exports}for(var s="function"==typeof i&&i,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],n=r.length,i=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(r)){for(o=n;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,r,i){!function(t){var a=/^([^#]*)(.*)$/,n=/^([^\?]*)(.*)$/,s=/^(([a-z]+:\/\/)?[^:\/]+(?::[0-9]+)?)?(\/?.*)$/i,o={buildAbsoluteURL:function(e,t){if(t=t.trim(),/^[a-z]+:/i.test(t))return t;var r=null,i=null,l=a.exec(t);l&&(i=l[2],t=l[1]);var u=n.exec(t);u&&(r=u[2],t=u[1]);var d=a.exec(e);d&&(e=d[1]);var f=n.exec(e);f&&(e=f[1]);var h=s.exec(e);if(!h)throw new Error("Error trying to parse base URL.");var c=h[2]||"",g=h[1]||"",v=h[3];0!==v.indexOf("/")&&""!==g&&(v="/"+v);var p=null;return p=/^\/\//.test(t)?c+o.buildAbsolutePath("",t.substring(2)):/^\//.test(t)?g+"/"+o.buildAbsolutePath("",t.substring(1)):o.buildAbsolutePath(g+v,t),r&&(p+=r),i&&(p+=i),p},buildAbsolutePath:function(e,t){for(var r,i,a=t,n="",s=e.replace(/[^\/]*$/,a.replace(/(\/|^)(?:\.?\/+)+/g,"$1")),o=0;(i=s.indexOf("/../",o))>-1;o=i+r)r=/^\/(?:\.\.\/)*/.exec(s.slice(i))[0].length,n=(n+s.substring(o,i)).replace(new RegExp("(?:\\/+[^\\/]*){0,"+(r-1)/3+"}$"),"/");return n+s.substr(o)}};"object"==typeof i&&"object"==typeof r?r.exports=o:"function"==typeof e&&e.amd?e([],function(){return o}):"object"==typeof i?i.URLToolkit=o:t.URLToolkit=o}(this)},{}],3:[function(e,t,r){var i=arguments[3],a=arguments[4],n=arguments[5],s=JSON.stringify;t.exports=function(e,t){function r(e){p[e]=!0;for(var t in a[e][1]){var i=a[e][1][t];p[i]||r(i)}}for(var o,l=Object.keys(n),u=0,d=l.length;u500*r.duration/o){var l=e.levels,d=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/s),f=l[r.level],h=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,g=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*h/8)),p=t.currentTime,y=(g-n.loaded)/d,m=(c.default.bufferInfo(t,p,e.config.maxBufferHole).end-p)/o;if(m<2*r.duration/o&&y>m){var E=void 0,b=void 0;for(b=r.level-1;b>a;b--){var R=l[b].realBitrate?Math.max(l[b].realBitrate,l[b].bitrate):l[b].bitrate;if((E=r.duration*R/(6.4*d))=i;u--){var d=l[u],f=d.details,h=f?f.totalduration/f.fragments.length:t,c=!!f&&f.live,g=void 0;g=u<=e?s*r:o*r;var p=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,y=p*h/g;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(g)+"/"+p+"/"+h+"/"+n+"/"+y),g>p&&(!y||c||yr)return a}return 0}},{key:"maxAutoLevel",get:function(){var e=this.hls.levels,t=this._autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextABRAutoLevel",get:function(){var e=this.hls,t=this.maxAutoLevel,r=e.levels,i=e.config,a=this.minAutoLevel,n=e.media,s=this.lastLoadedFragLevel,o=this.fragCurrent?this.fragCurrent.duration:0,l=n?n.currentTime:0,u=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,f=(c.default.bufferInfo(n,l,i.maxBufferHole).end-l)/u,h=this.findBestLevel(s,o,d,a,t,f,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(h>=0)return h;v.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,y=i.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){g=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=y=1}}return h=this.findBestLevel(s,o,d,a,t,f+g,p,y,r),Math.max(h,0)}}]),t}(f.default);r.default=m},{26:26,27:27,28:28,30:30,45:45,9:9}],5:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var r=0;r0&&-1===e?(k.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=A.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=A.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=A.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=A.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var e,t,r,i,a,n,s=this,l=this.hls,u=l.config,f=function(){switch(s.state){case A.ERROR:case A.PAUSED:case A.BUFFER_FLUSHING:break;case A.STARTING:s.state=A.WAITING_TRACK,s.loadedmetadata=!1;break;case A.IDLE:var o=s.tracks;if(!o)break;if(!s.media&&(s.startFragRequested||!u.startFragPrefetch))break;e=s.loadedmetadata?s.media.currentTime:s.nextLoadPosition;var f=s.mediaBuffer?s.mediaBuffer:s.media,c=h.default.bufferInfo(f,e,u.maxBufferHole),g=c.len,v=c.end,y=s.fragPrevious,m=u.maxMaxBufferLength,E=s.audioSwitch,b=s.trackId;if(gS||c.nextStart))return{v:void 0};k.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),s.media.currentTime=S+.05}if(v<=S){if(D=R[0],r.live&&D.loadIdx&&D.loadIdx===s.fragLoadIdx){var w=c.nextStart?c.nextStart:S;return k.logger.log("no alt audio available @currentTime:"+s.media.currentTime+", seeking @"+(w+.05)),s.media.currentTime=w+.05,{v:void 0}}}else!function(){var e=void 0,t=u.maxFragLookUpTolerance;vL-t&&(t=0),(e=d.default.search(R,function(e){return e.start+e.duration-t<=v?1:e.start-t>v?-1:0}))||k.logger.log("frag not found @bufferEnd/start:"+v+"/"+S)):e=R[_-1],e&&(D=e,S=e.start,y&&D.level===y.level&&D.sn===y.sn&&(D.snO&&Math.abs(s.fragLoadIdx-D.loadIdx)=a||n)&&(k.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),s.state=A.IDLE);break;case A.WAITING_INIT_PTS:case A.STOPPED:case A.FRAG_LOADING:case A.PARSING:case A.PARSED:case A.ENDED:}}();if("object"===(void 0===f?"undefined":o(f)))return f.v}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(k.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===A.ENDED&&(this.state=A.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(e){k.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.state=A.IDLE,this.fragCurrent=null,this.state=A.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=A.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,r=e.id,i=this.tracks[r],a=t.totalduration,n=0;if(k.logger.log("track "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),t.live){var s=i.details;s&&t.fragments.length>0?(b.default.mergeDetails(s,t),n=t.fragments[0].start,t.PTSKnown?k.logger.log("live audio playlist sliding:"+n.toFixed(3)):k.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,k.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,!this.startFragRequested){if(-1===this.startPosition){var o=t.startTimeOffset;isNaN(o)?this.startPosition=0:(k.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o)}this.nextLoadPosition=this.startPosition}this.state===A.WAITING_TRACK&&(this.state=A.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===A.KEY_LOADING&&(this.state=A.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent;if(this.state===A.FRAG_LOADING&&t&&"audio"===e.frag.type&&e.frag.level===t.level&&e.frag.sn===t.sn){this.state=A.PARSING,this.stats=e.stats;var r=this.tracks[this.trackId],i=r.details,a=i.totalduration,n=t.start,s=t.level,o=t.sn,l=t.cc,u=this.config.defaultAudioCodec||r.audioCodec;this.appended=!1,this.demuxer||(this.demuxer=new g.default(this.hls,"audio"));var d=this.initPTS[l];if(void 0!==d){this.pendingBuffering=!0,k.logger.log("Demuxing "+o+" of ["+i.startSN+" ,"+i.endSN+"],track "+s);this.demuxer.push(e.payload,u,null,n,l,s,o,a,t.decryptdata,!1,d)}else k.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+o+" of ["+i.startSN+" ,"+i.endSN+"],track "+s),this.waitingFragment=e,this.state=A.WAITING_INIT_PTS}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent;if(t&&"audio"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===A.PARSING){var r=e.tracks,i=void 0;if(r.video&&delete r.video,i=r.audio){i.levelCodec="mp4a.40.2",i.id=e.id,this.hls.trigger(p.default.BUFFER_CODECS,r),k.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.initSegment;if(a){var n={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[n]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(p.default.BUFFER_APPENDING,n))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent;r&&"audio"===e.id&&"audio"===e.type&&e.sn===r.sn&&e.level===r.level&&this.state===A.PARSING&&function(){var r=t.trackId,i=t.tracks[r],a=t.fragCurrent,n=t.hls;k.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),b.default.updateFragPTSDTS(i.details,a.sn,e.startPTS,e.endPTS);var s=t.audioSwitch,o=t.media,l=!1;if(s&&o)if(o.readyState){var u=o.currentTime;k.logger.log("switching audio track : currentTime:"+u),u>=e.startPTS&&(k.logger.log("switching audio track : flushing all audio"),t.state=A.BUFFER_FLUSHING,n.trigger(p.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),l=!0,t.audioSwitch=!1,n.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:r}))}else t.audioSwitch=!1,n.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:r});var d=t.pendingData;t.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&d.push({type:e.type,data:t,parent:"audio",content:"data"})}),!l&&d.length&&(d.forEach(function(e){t.pendingBuffering=!0,t.hls.trigger(p.default.BUFFER_APPENDING,e)}),t.pendingData=[],t.appended=!0)),t.tick()}()}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent;t&&"audio"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===A.PARSING&&(this.stats.tparsed=performance.now(),this.state=A.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==A.PARSING&&t!==A.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==A.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),r.trigger(p.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;k.logger.log("audio buffered : "+_.default.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(p.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=A.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r,t.loadCounter=0;var a=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);k.logger.warn("audioStreamController: frag loading failed, retry in "+a+" ms"),this.retryDate=performance.now()+a,this.state=A.FRAG_LOADING_WAITING_RETRY}else k.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.trigger(p.default.ERROR,e),this.state=A.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==A.ERROR&&(this.state=e.fatal?A.ERROR:A.IDLE,k.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."))}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(k.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(p.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=A.PARSED):(this.state=A.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,k.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(m.default);r.default=S},{22:22,26:26,27:27,28:28,30:30,31:31,41:41,45:45,46:46}],6:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r1&&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){var t=this,r=e.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});var a=0;r.forEach(function(e){if(e.default)return t.audioTrack=a,void(i=!0);a++}),!1===i&&r.length&&(h.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id=0&&e=0&&e.1){var a=i.updating;try{i.abort()}catch(e){a=!0,h.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(h.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+e.start),i.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video,i=0;e.altAudio&&(t||r)&&(i=(t?1:0)+(r?1:0),h.logger.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;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=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){h.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){h.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&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){h.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){h.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){h.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;h.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 t=this.parent,r=this.segments.reduce(function(e,r){return r.parent===t?e+1:e},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){h.logger.error("sourceBuffer error:"+e),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value: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}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var i in e)if(!t[i]){var a=e[i],n=a.levelCodec||a.codec,s=a.container+";codecs="+n;h.logger.log("creating sourceBuffer("+s+")");try{var o=t[i]=r.addSourceBuffer(s);o.addEventListener("updateend",this.onsbue),o.addEventListener("error",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=o}catch(e){h.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){h.logger.error("sourceBuffer error:",e.event),this.hls.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1,frag:this.fragCurrent})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var i in t)r&&i!==r||t[i].ended||(t[i].ended=!0,h.logger.log(i+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var r in e){var i=e[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}h.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,i=this._levelDuration;if(null!==i&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var a in r)if(r[a].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var n=e.duration;(i>this._msDuration&&i>n||n===1/0||isNaN(n))&&(h.logger.log("Updating mediasource duration to "+i.toFixed(3)),this._msDuration=t.duration=i)}}},{key:"doFlush",value: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 i in r)t+=r[i].buffered.length}catch(e){h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void h.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=t[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){h.logger.error("error while trying to append buffer:"+t.message),r.unshift(i);var s={type:c.ErrorTypes.MEDIA_ERROR};if(22===t.code)return this.segments=[],s.details=c.ErrorDetails.BUFFER_FULL_ERROR,s.fatal=!1,void e.trigger(u.default.ERROR,s);if(this.appendError?this.appendError++:this.appendError=1,s.details=c.ErrorDetails.BUFFER_APPEND_ERROR,s.frag=this.fragCurrent,this.appendError>e.config.appendErrorMaxRetry)return h.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],s.fatal=!0,void e.trigger(u.default.ERROR,s);s.fatal=!1,e.trigger(u.default.ERROR,s)}}}}},{key:"flushBuffer",value:function(e,t,r){var i,a,n,s,o,l,u=this.sourceBuffer;if(Object.keys(u).length){if(h.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,h.logger.log("flush "+d+" ["+o+","+l+"], of ["+n+","+s+"], pos:"+this.media.currentTime),i.remove(o,l),!1}catch(e){h.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else h.logger.warn("abort flushing too many retries");h.logger.log("buffer flushed")}return!0}}]),t}(f.default);r.default=g},{26:26,27:27,28:28,45:45}],8:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var t=0,r=void 0,i=void 0,a=this.mediaWidth,n=this.mediaHeight,s=0,o=0;for(r=0;r<=e&&(i=this.levels[r],!this.isLevelRestricted(r))&&(t=r,s=i.width,o=i.height,!(a<=s||n<=o));r++);return t}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(e))}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(f.default);r.default=h},{27:27,28:28}],9:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=o},{44:44}],10:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0&&n>l.config.fpsDroppedMonitoringThreshold*s){var d=l.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=d)&&(d-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value: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)}}]),t}(f.default);r.default=c},{27:27,28:28,45:45}],11:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0})}else o.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:o.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels;if(e>=0&&e1&&a.loadErrore&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){-1!==e&&(e=Math.max(e,this.hls.abrController.minAutoLevel)),this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.abrController.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.abrController.nextAutoLevel=e)}}]),t}(f.default);r.default=p},{26:26,27:27,28:28,30:30,45:45}],12:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0&&-1===e&&(T.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=k.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else T.logger.warn("cannot start loading as manifest not parsed yet"),this.state=k.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case k.ERROR:break;case k.BUFFER_FLUSHING:this.fragLoadError=0;break;case k.IDLE:if(!this._doTickIdle())return;break;case k.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=k.IDLE);break;case k.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(T.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=k.IDLE);break;case k.ERROR:case k.STOPPED:case k.FRAG_LOADING:case k.PARSING:case k.PARSED:case k.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&!r&&(this.startFragRequested||!t.startFragPrefetch))return!0;var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,n=this.levels[a],s=n.bitrate,o=void 0;o=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,o=Math.min(o,t.maxMaxBufferLength);var l=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,t.maxBufferHole),u=l.len;if(u>=o)return!0;T.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+o.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var d=n.details;if(void 0===d||d.live&&this.levelLastLoaded!==a)return this.state=k.WAITING_LEVEL,!0;var h=this.fragPrevious;if(!d.live&&h&&h.sn===d.endSN&&r.duration-Math.max(l.end,h.start)<=Math.max(.2,h.duration/2)){var c={};return this.altAudio&&(c.type="video"),this.hls.trigger(v.default.BUFFER_EOS,c),this.state=k.ENDED,!0}return this._fetchPayloadOrEos(i,l,d)}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var i=this.fragPrevious,a=this.level,n=r.fragments,s=n.length;if(0===s)return!1;var o=n[0].start,l=n[s-1].start+n[s-1].duration,u=t.end,d=void 0;if(r.live){var f=this.config.initialLiveManifestSize;if(sf&&(l.currentTime=f)}if(e.PTSKnown&&t>i&&l&&l.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a){var h=a.sn+1;h>=e.startSN&&h<=e.endSN&&(u=n[h-e.startSN],T.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=n[Math.min(s-1,Math.round(s/2))],T.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(e,t,r,i,a,n,s){var o=this.hls.config,l=void 0,d=void 0,f=o.maxFragLookUpTolerance;if(an-f&&(f=0),d=u.default.search(i,function(e){return e.start+e.duration-f<=a?1:e.start-f>a&&e.start?-1:0})):d=i[r-1],d&&(l=d,d.start,t&&l.level===t.level&&l.sn===t.sn))if(l.sno.maxBufferHole&&t.dropped&&c?(l=i[c-1],T.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=i[c+1],T.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;return l}},{key:"_loadFragmentOrKey",value:function(e,t,r,i,a){var n=this.hls,s=n.config;if(null==e.decryptdata.uri||null!=e.decryptdata.key){if(T.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+i.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var o=s.fragLoadingLoopThreshold;if(e.loadCounter>o&&Math.abs(this.fragLoadIdx-e.loadIdx)t.end?1:0})}},{key:"followingBufferRange",value:function(e){return e?this.getBufferRange(e.end+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(t=r.currentTime,t>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(r,t)?e=this.getBufferRange(t):f.default.isBuffered(r,t+.1)&&(e=this.getBufferRange(t+.1)),e)){var i=e.frag;i!==this.fragPlaying&&(this.fragPlaying=i,this.hls.trigger(v.default.FRAG_CHANGED,{frag:i}))}}},{key:"immediateLevelSwitch",value:function(){if(T.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.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,r=void 0,i=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,r=this.getBufferRange(e.currentTime),r&&r.start>1&&this.flushMainBuffer(0,r.start-1),e.paused)t=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],s=this.fragLastKbps;t=s&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*s)+1:0}if((i=this.getBufferRange(e.currentTime+t))&&(i=this.followingBufferRange(i))){var o=this.fragCurrent;o&&o.loader&&o.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.start,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=k.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value: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)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(T.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.loadCounter=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()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;if(T.logger.log("media seeking to "+t.toFixed(3)),this.state===k.FRAG_LOADING){var i=this.mediaBuffer?this.mediaBuffer:e,a=f.default.bufferInfo(i,t,this.config.maxBufferHole),n=this.fragCurrent;if(0===a.len&&n){var s=r.maxFragLookUpTolerance,o=n.start-s,l=n.start+n.duration+s;tl?(n.loader&&(T.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=k.IDLE):T.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===k.ENDED&&(this.state=k.IDLE);e&&(this.lastCurrentTime=t),this.state!==k.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){T.logger.log("media seeked to "+this.media.currentTime.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){T.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){T.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this.bufferRange=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,i=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&T.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var a=this.config;a.autoStartLoad&&this.hls.startLoad(a.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,i=this.levels[r],a=t.totalduration,n=0;if(T.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),this.levelLastLoaded=r,t.live){var s=i.details;s&&t.fragments.length>0?(E.default.mergeDetails(s,t),n=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(n,s),t.PTSKnown?T.logger.log("live playlist sliding:"+n.toFixed(3)):T.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,T.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(i.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var o=t.startTimeOffset;isNaN(o)?t.live?(this.startPosition=this.computeLivePosition(n,t),T.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(o<0&&(T.logger.log("negative start time offset "+o+", count from end of last fragment"),o=n+a+o),T.logger.log("start time offset found in playlist, adjust startPosition to "+o),this.startPosition=o),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===k.WAITING_LEVEL&&(this.state=k.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.KEY_LOADING&&(this.state=k.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===k.FRAG_LOADING&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var i=e.stats,a=this.levels[t.level],n=a.details;if(T.logger.log("Loaded "+t.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t.level),this.bitrateTest=!1,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=k.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:i,frag:t,id:"main"}),this.tick();else{this.state=k.PARSING,this.stats=i;var s=n.totalduration,o=isNaN(t.startDTS)?t.start:t.startDTS,l=t.level,u=t.sn,d=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(T.logger.log("swapping playlist audio codec"),void 0===d&&(d=this.lastAudioCodec),d&&(d=-1!==d.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,T.logger.log("Parsing "+u+" of ["+n.startSN+" ,"+n.endSN+"],level "+l+", cc "+t.cc);var f=this.demuxer;f||(f=this.demuxer=new c.default(this.hls,"main"));var h=this.media,g=h&&h.seeking,p=!g&&(n.PTSKnown||!n.live);f.push(e.payload,d,a.videoCodec,o,t.cc,l,u,s,t.decryptdata,p,null)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent;if(t&&"main"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===k.PARSING){var r,i,a=e.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var n=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();n&&this.audioCodecSwap&&(T.logger.log("swapping playlist audio codec"),n=-1!==n.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(n="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(n="mp4a.40.2",T.logger.log("Android: force audio codec to "+n)),i.levelCodec=n,i.id=e.id}if(i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),e.unique){var o={codec:"",levelCodec:""};for(r in e.tracks)i=a[r],o.container=i.container,o.codec&&(o.codec+=",",o.levelCodec+=","),i.codec&&(o.codec+=i.codec),i.levelCodec&&(o.levelCodec+=i.levelCodec);a={audiovideo:o}}this.hls.trigger(v.default.BUFFER_CODECS,a);for(r in a){i=a[r],T.logger.log("main track:"+r+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var l=i.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:r,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent;if(r&&"main"===e.id&&e.sn===r.sn&&e.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===k.PARSING){var i=this.levels[this.level],a=this.fragCurrent;T.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0));var n=E.default.updateFragPTSDTS(i.details,a.sn,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(v.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:n,type:e.type,start:e.startPTS,end:e.endPTS}),"video"===e.type&&(a.dropped=e.dropped),[e.data1,e.data2].forEach(function(r){r&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent;t&&"main"===e.id&&e.sn===t.sn&&e.level===t.level&&this.state===k.PARSING&&(this.stats.tparsed=performance.now(),this.state=k.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){T.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(T.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.IDLE}var a=this.hls;a.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(T.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,i=void 0,a=!1;for(var n in t){var s=t[n];"main"===s.id?(i=n,r=s,"video"===n&&(this.videoBuffer=t[n].buffer)):a=!0}a&&r?(T.logger.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==k.PARSING&&t!==k.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){var e=this;if(!(this.state!==k.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;t&&function(){var r=e.mediaBuffer?e.mediaBuffer:e.media;T.logger.log("main buffered : "+R.default.toString(r.buffered));var i=e.bufferRange.filter(function(e){return f.default.isBuffered(r,(e.start+e.end)/2)});i.push({type:t.type,start:t.startPTS,end:t.endPTS,frag:t}),e.bufferRange=i.sort(function(e,t){return e.start-t.start}),e.fragPrevious=t;var a=e.stats;a.tbuffered=performance.now(),e.fragLastKbps=Math.round(8*a.total/(a.tbuffered-a.tfirst)),e.hls.trigger(v.default.FRAG_BUFFERED,{stats:a,frag:t,id:"main"}),e.state=k.IDLE}(),this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,i=r&&f.default.isBuffered(r,r.currentTime)&&f.default.isBuffered(r,r.currentTime+.5);switch(e.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var a=this.fragLoadError;a?a++:a=1;var n=this.config;if(a<=n.fragLoadingMaxRetry||i||t.autoLevel&&t.level){this.fragLoadError=a,t.loadCounter=0;var s=Math.min(Math.pow(2,a-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);T.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=k.FRAG_LOADING_WAITING_RETRY}else T.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.trigger(v.default.ERROR,e),this.state=k.ERROR}break;case _.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(i?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.hls.trigger(v.default.ERROR,e),this.state=k.ERROR));break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.ERROR&&(e.fatal?(this.state=k.ERROR,T.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):this.state===k.WAITING_LEVEL&&(this.state=k.IDLE));break;case _.ErrorDetails.BUFFER_FULL_ERROR:this.state!==k.PARSING&&this.state!==k.PARSED||(i?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):(T.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,T.logger.warn("reduce max buffer length to "+t.maxMaxBufferLength+"s and switch to IDLE state"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var t=e.currentTime,r=this.mediaBuffer?this.mediaBuffer:e,i=r.buffered;if(this.loadedmetadata||!i.length||e.seeking)if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var a=f.default.bufferInfo(e,t,0),n=!(e.paused||e.ended||0===e.buffered.length),s=t!==this.lastCurrentTime,o=this.config;if(s)this.stallReported&&(T.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(n){var l=performance.now(),u=this.hls;if(this.stalled){var d=l-this.stalled,h=a.len,c=this.nudgeRetry||0;if(h<=.5&&d>1e3*o.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,T.logger.warn("playback stalling in low buffer @"+t),u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}));var g=a.nextStart,p=g-t;if(g&&p0){this.nudgeRetry=++c;var y=c*o.nudgeOffset;T.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+g+" + nudge "+y),e.currentTime=g+y,this.stalled=void 0,u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:g+y-t})}}else if(h>.5&&d>1e3*o.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,T.logger.warn("playback stalling in high buffer @"+t),u.trigger(v.default.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h})),this.stalled=void 0,this.nudgeRetry=++c,c"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferRange(e.currentTime);if(t)return t.frag.level}return-1}},{key:"nextBufferRange",get:function(){var e=this.media;return e?this.followingBufferRange(this.getBufferRange(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferRange;return e?e.frag.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(y.default);r.default=A},{22:22,26:26,27:27,28:28,30:30,31:31,41:41,45:45,46:46}],13:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r0;)e.removeCue(e.cues[0])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var r=0;r>>8^255&g^99,e[f]=g,t[g]=f;var v=d[f],p=d[v],y=d[p],m=257*d[g]^16843008*g;r[f]=m<<24|m>>>8,i[f]=m<<16|m>>>16,a[f]=m<<8|m>>>24,n[f]=m,m=16843009*y^65537*p^257*v^16843008*f,s[g]=m<<24|m>>>8,o[g]=m<<16|m>>>16,l[g]=m<<8|m>>>24,u[g]=m,f?(f=v^d[d[d[y^v]]],h^=d[d[h]]):f=h=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var i,a,n=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,l=this.invSubMix[0],u=this.invSubMix[1],d=this.invSubMix[2],f=this.invSubMix[3],h=this.uint8ArrayToUint32Array_(r),c=h[0],g=h[1],v=h[2],p=h[3],y=new Int32Array(e),m=new Int32Array(y.length),E=void 0,b=void 0,R=void 0,_=void 0,T=void 0,k=void 0,A=void 0,S=void 0,L=void 0,D=void 0,w=void 0,O=void 0;t>>24]^u[k>>16&255]^d[A>>8&255]^f[255&S]^s[i],b=l[k>>>24]^u[A>>16&255]^d[S>>8&255]^f[255&T]^s[i+1],R=l[A>>>24]^u[S>>16&255]^d[T>>8&255]^f[255&k]^s[i+2],_=l[S>>>24]^u[T>>16&255]^d[k>>8&255]^f[255&A]^s[i+3],T=E,k=b,A=R,S=_,i+=4;E=o[T>>>24]<<24^o[k>>16&255]<<16^o[A>>8&255]<<8^o[255&S]^s[i],b=o[k>>>24]<<24^o[A>>16&255]<<16^o[S>>8&255]<<8^o[255&T]^s[i+1],R=o[A>>>24]<<24^o[S>>16&255]<<16^o[T>>8&255]<<8^o[255&k]^s[i+2],_=o[S>>>24]<<24^o[T>>16&255]<<16^o[k>>8&255]<<8^o[255&A]^s[i+3],i+=3,m[t]=this.networkToHostOrderSwap(E^c),m[t+1]=this.networkToHostOrderSwap(_^g),m[t+2]=this.networkToHostOrderSwap(R^v),m[t+3]=this.networkToHostOrderSwap(b^p),c=L,g=D,v=w,p=O,t+=4}return m.buffer}},{key:"destroy",value: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}();r.default=n},{}],16:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>5,(v-=E)>0&&m+E+v<=R);)for(b=k+y*p,_={unit:e.subarray(m+E,m+E+v),pts:b,dts:b},c.samples.push(_),c.len+=v,m+=v+E,y++;m>>6),(o=(60&t[r+2])>>>2)>c.length-1?void e.trigger(Event.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o}):(u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+i+",ADTS data:type:"+a+",sampleingIndex:"+o+"["+c[o]+"Hz],channelConfig:"+u),/firefox/i.test(f)?o>=6?(a=5,d=new Array(4),l=o-3):(a=2,d=new Array(2),l=o):-1!==f.indexOf("android")?(a=2,d=new Array(2),l=o):(a=5,d=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&o>=6?l=o-3:((i&&-1!==i.indexOf("mp4a.40.2")&&o>=6&&1===u||!i&&1===u)&&(a=2,d=new Array(2)),l=o)),d[0]=a<<3,d[0]|=(14&o)>>1,d[1]|=(1&o)<<7,d[1]|=u<<3,5===a&&(d[1]|=(14&l)>>1,d[2]=(1&l)<<7,d[2]|=8,d[3]=0),{config:d,samplerate:c[o],channelCount:u,codec:"mp4a.40."+a,manifestCodec:h})}}]),e}();r.default=o},{26:26,45:45}],20:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:null;a(this,e),this.hls=t,this.id=r,this.config=this.hls.config||n,this.typeSupported=i}return n(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,r,i,a,n,s,l,u,f,h){if(e.byteLength>0&&null!=u&&null!=u.key&&"AES-128"===u.method){null==this.decrypter&&(this.decrypter=new d.default(this.hls,this.config));var c,g=this;try{c=performance.now()}catch(e){c=Date.now()}this.decrypter.decrypt(e,u.key.buffer,u.iv.buffer,function(e){var u;try{u=performance.now()}catch(e){u=Date.now()}g.hls.trigger(o.default.FRAG_DECRYPTED,{level:n,sn:s,stats:{tstart:c,tdecrypt:u}}),g.pushDecrypted(new Uint8Array(e),t,r,i,a,n,s,l,f,h)})}else this.pushDecrypted(new Uint8Array(e),t,r,i,a,n,s,l,f,h)}},{key:"pushDecrypted",value:function(e,t,r,i,a,n,s,u,d,f){var c=this.demuxer;if(!c||a!==this.cc&&!c.probe(e)){var v=this.hls,y=this.id,E=this.config,b=this.typeSupported;if(g.default.probe(e))c=!0===this.typeSupported.mp2t?new g.default(v,y,m.default,E,b):new g.default(v,y,p.default,E,b),c.probe=g.default.probe;else{if(!h.default.probe(e))return void v.trigger(o.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,id:y,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});c=new h.default(v,y,p.default,E,b),c.probe=h.default.probe}this.demuxer=c}c.push(e,t,r,i,a,n,s,u,d,f),this.cc=a}}]),e}();r.default=E},{16:16,18:18,25:25,26:26,28:28,38:38,39:39}],21:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=e(20),n=i(a),s=e(28),o=i(s),l=e(45),u=e(1),d=i(u),f=function(e){var t=new d.default;t.trigger=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;ae?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r,i=8,a=8;for(t=0;t>4>1){if((p=f+5+e[f+4])===f+188)continue}else p=f+4;switch(v){case A:if(g){if(w&&(y=x(w))&&(M(y,!1),E&&_.codec&&(-1===S||T.codec)))return void this.remux(n,s,a,e,i);w={data:[],size:0}}w&&(w.data.push(e.subarray(p,f+188)),w.size+=f+188-p);break;case S:if(g){if(O&&(y=x(O))&&(T.isAAC?F(y):N(y),E&&T.codec&&(-1===A||_.codec)))return void this.remux(n,s,a,e,i);O={data:[],size:0}}O&&(O.data.push(e.subarray(p,f+188)),O.size+=f+188-p);break;case L:g&&(I&&(y=x(I))&&U(y),I={data:[],size:0}),I&&(I.data.push(e.subarray(p,f+188)),I.size+=f+188-p);break;case 0:g&&(p+=e[p]+1),D=this._pmtId=P(e,p);break;case D:g&&(p+=e[p]+1);var G=C(e,p,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3);A=G.avc,A>0&&(_.id=A),S=G.audio,S>0&&(T.id=S,T.isAAC=G.isAAC),L=G.id3,L>0&&(k.id=L),b&&!R&&(h.logger.log("reparse from beginning"),b=!1,f=-188),R=this.pmtParsed=!0;break;case 17:case 8191:break;default:b=!0}}else this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,id:this.id,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w&&(y=x(w))?(M(y,!0),_.pesData=null):_.pesData=w,O&&(y=x(O))?(T.isAAC?F(y):N(y),T.pesData=null):(O&&O.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),T.pesData=O),I&&(y=x(I))?(U(y),k.pesData=null):k.pesData=I,this.remux(n,s,a,null,i,d)}},{key:"remux",value:function(e,t,r,i,a,n){for(var s=this._avcTrack,o=s.samples,l=0,u=0,d=0;d1;){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(t=d[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;r=t[7],192&r&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,s>4294967295&&(s-=8589934592),64&r?(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,o>4294967295&&(o-=8589934592),s-o>54e5&&(h.logger.warn(Math.round((s-o)/9e4)+"s delta between PTS and DTS, align them"),s=o)):o=s),a=t[8],l=a+9,e.size-=l,n=new Uint8Array(e.size);for(var c=0,g=d.length;cv){l-=v;continue}t=t.subarray(l),v-=l,l=0}n.set(t,u),u+=v}return i&&(i-=a+3),{data:n,pts:s,dts:o,len:i}}return null}},{key:"pushAccesUnit",value:function(e,t){e.units.units.length&&e.frame&&(!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(t.samples.length||this.contiguous)?t.samples.push(e):t.dropped++),e.debug.length&&h.logger.log(e.pts+"/"+e.dts+":"+e.debug+","+e.units.length)}},{key:"_parseAVCPES",value:function(e,t){var r,i,a,n=this,s=this._avcTrack,o=this._parseAVCNALu(e.data),l=this.avcSample;e.data=null,o.forEach(function(t){switch(t.type){case 1:i=!0,l.frame=!0;var o=t.data;if(o.length>4){var u=new f.default(o).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:i=!0,l||(l=n.avcSample=n._createAVCSample(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,r=new f.default(n.discardEPB(t.data)),r.readUByte();for(var d=0,h=0,c=!1,g=0;!c&&r.bytesAvailable>1;){d=0;do{g=r.readUByte(),d+=g}while(255===g);h=0;do{g=r.readUByte(),h+=g}while(255===g);if(4===d&&0!==r.bytesAvailable){c=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var v=r.readUByte(),p=r.readUByte(),y=31&v,m=[v,p];for(a=0;a0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts=0)i={data:e.subarray(h,s-u-1),type:n},f.push(i);else{var c=this._getLastNalUnit();if(c&&(d&&s<=4-d&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-d)),(r=s-u-1)>0)){var g=new Uint8Array(c.data.byteLength+r);g.set(c.data,0),g.set(e.subarray(0,r),c.data.byteLength),c.data=g}}s=0&&u>=0&&(i={data:e.subarray(h,o),type:n,state:u},f.push(i)),0===f.length){var v=this._getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return l.naluState=u,f}},{key:"discardEPB",value:function(e){for(var t,r,i=e.byteLength,a=[],n=1;n1&&(h.logger.log("AAC: align PTS for overlapping frames by "+Math.round((T-p)/90)),p=T)}for(;n+5>>5,(r-=s)>0&&n+s+r<=d);)for(l=p+a*i,f={unit:v.subarray(n+s,n+s+r),pts:l,dts:l},g.samples.push(f),g.len+=r,n+=r+s,a++;n0;)s+=t}},{key:"_onMpegFrame",value:function(e,t,r,i,a,n){var s=1152/r*1e3,o=n+a*s,l=this._audioTrack;l.config=[],l.channelCount=i,l.audiosamplerate=r,l.duration=this._duration,l.samples.push({unit:e,pts:o,dts:o}),l.len+=e.length}},{key:"_onMpegNoise",value:function(e){h.logger.warn("mpeg audio has noise: "+e.length+" bytes")}},{key:"_parseMpeg",value:function(e,t,r,i,a){var n=[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],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(t+2>r)return-1;if(255===e[t]||224==(224&e[t+1])){if(t+24>r)return-1;var o=e[t+1]>>3&3,l=e[t+1]>>1&3,u=e[t+2]>>4&15,d=e[t+2]>>2&3,f=!!(2&e[t+2]);if(1!==o&&0!==u&&15!==u&&3!==d){var h=3===o?3-l:3===l?3:4,c=1e3*n[14*h+u-1],g=3===o?0:2===o?1:2,v=s[3*g+d],p=f?1:0,y=e[t+3]>>6==3?1:2,m=3===l?(3===o?12:6)*c/v+p<<2:(3===o?144:72)*c/v+p|0;return t+m>r?-1:(this._onMpegFrame&&this._onMpegFrame(e.subarray(t,t+m),c,v,y,i,a),m)}}for(var E=t+2;E=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=g},{19:19,23:23,26:26,28:28,45:45}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={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_LOOP_LOADING_ERROR:"fragLoopLoadingError",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"}},{}],27:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r1?r-1:0),n=1;n=r.start(i)&&t<=r.end(i))return!0;return!1}},{key:"bufferInfo",value:function(e,t,r){if(e){var i,a=e.buffered,n=[];for(i=0;id&&(l[u-1].end=e[o].end):l.push(e[o])}else l.push(e[o])}for(o=0,i=0,a=n=t;o=f&&t=0&&ot.endSN)return 0;if(o=r-t.startSN,l=t.fragments,u=l[o],!isNaN(u.startPTS)){var f=Math.abs(u.startPTS-i);isNaN(u.deltaPTS)?u.deltaPTS=f:u.deltaPTS=Math.max(f,u.deltaPTS),i=Math.min(i,u.startPTS),a=Math.max(a,u.endPTS),n=Math.min(n,u.startDTS),s=Math.max(s,u.endDTS)}var h=i-u.start;for(u.start=u.startPTS=i,u.endPTS=a,u.startDTS=n,u.endDTS=s,u.duration=a-i,d=o;d>0;d--)e.updatePTS(l,d,d-1);for(d=o;dt?i.start+i.duration:i.start-a.duration:r>t?(i.duration=s-i.start,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-s,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}}]),e}();r.default=s},{45:45}],32:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var r=e.DefaultConfig;if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var i in r)i in t||(t[i]=r[i]);if(void 0!==t.liveMaxLatencyDurationCount&&t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(t.liveMaxLatencyDuration<=t.liveSyncDuration||void 0===t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,I.enableLogs)(t.debug),this.config=t;var n=this.observer=new M.default;n.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:-1;I.logger.log("startLoad("+e+")"),this.levelController.startLoad(),this.streamController.startLoad(e),this.audioStreamController.startLoad(e)}},{key:"stopLoad",value:function(){I.logger.log("stopLoad"),this.levelController.stopLoad(),this.streamController.stopLoad(),this.audioStreamController.stopLoad()}},{key:"swapAudioCodec",value:function(){I.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){I.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){I.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){I.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){I.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.abrController.minAutoLevel)},set:function(e){I.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){I.logger.log("set startLevel:"+e),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this.abrController.autoLevelCapping},set:function(e){I.logger.log("set autoLevelCapping:"+e),this.abrController.autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"audioTracks",get:function(){return this.audioTrackController.audioTracks}},{key:"audioTrack",get:function(){return this.audioTrackController.audioTrack},set:function(e){this.audioTrackController.audioTrack=e}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}}]),e}();r.default=B},{1:1,10:10,11:11,12:12,13:13,26:26,28:28,34:34,35:35,36:36,4:4,43:43,45:45,47:47,5:5,6:6,7:7,8:8}],33:[function(e,t,r){"use strict";t.exports=e(32).default},{32:32}],34:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);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});var o=function(){function e(e,t){for(var r=0;r>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&(r=new R,r.method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl)),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[];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]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),T=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING));return r.loaders={},r}return n(t,e),o(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},c.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var i=r.context;if(i&&i.url===e)return void y.logger.trace("playlist request ongoing");y.logger.warn("abort previous loader for type:"+t.type),r.abort()}var a=this.hls.config,n=void 0,s=void 0,o=void 0,l=void 0;"manifest"===t.type?(n=a.manifestLoadingMaxRetry,s=a.manifestLoadingTimeOut,o=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):(n=a.levelLoadingMaxRetry,s=a.levelLoadingTimeOut,o=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,y.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),t.url=e,t.responseType="";var u=void 0,d=void 0;u={timeout:s,maxRetry:n,retryDelay:o,maxRetryDelay:l},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,u,d)}},{key:"resolve",value:function(e,t){return u.default.buildAbsoluteURL(t,e)}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],i=void 0;for(m.lastIndex=0;null!=(i=m.exec(e));){var a={},n=a.attrs=new p.default(i[1]);a.url=this.resolve(i[2],t);var s=n.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=n.decimalInteger("AVERAGE-BANDWIDTH")||n.decimalInteger("BANDWIDTH"),a.name=n.NAME;var o=n.CODECS;if(o){o=o.split(/[ ,]+/);for(var l=0;l2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,i){var a,n,s=0,o=0,l={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},u=new R,d=0,f=null,h=new _;for(b.lastIndex=0;null!==(a=b.exec(e));){var c=a[1];if(c){h.duration=parseFloat(c);var g=(" "+a[2]).slice(1);h.title=g||null,h.tagList.push(g?["INF",c,g]:["INF",c])}else if(a[3]){if(!isNaN(h.duration)){var v=s++;h.type=i,h.start=o,h.levelkey=u,h.sn=v,h.level=r,h.cc=d,h.baseurl=t,h.relurl=(" "+a[3]).slice(1),l.fragments.push(h),f=h,o+=h.duration,h=new _}}else if(a[4]){if(h.rawByteRange=(" "+a[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(h.lastByteRangeEndOffset=m)}}else if(a[5])h.rawProgramDateTime=(" "+a[5]).slice(1),h.tagList.push(["PROGRAM-DATE-TIME",h.rawProgramDateTime]);else{for(a=a[0].match(/(?:(?:#(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=1;n0){var u="audioTrack"!==n,d=this.parseLevelPlaylist(i,a,(u?o:s)||0,u?"main":"audio");"manifest"===n&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:a,details:d}],audioTracks:[],url:a,stats:t}),t.tparsed=performance.now(),d.targetduration?u?l.trigger(f.default.LEVEL_LOADED,{details:d,level:o||0,id:s||0,stats:t}):l.trigger(f.default.AUDIO_TRACK_LOADED,{details:d,id:s,stats:t}):l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(i,a);if(h.length){var c=this.parseMasterPlaylistMedia(i,a,"AUDIO");if(c.length){var v=!1;c.forEach(function(e){e.url||(v=!0)}),!1===v&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(y.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),c.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:c,url:a,stats:t})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest"})}else l.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,response:e,context:t})}},{key:"loadtimeout",value:function(e,t){var r,i,a=t.loader;switch(t.type){case"manifest":r=g.ErrorDetails.MANIFEST_LOAD_TIMEOUT,i=!0;break;case"level":r=g.ErrorDetails.LEVEL_LOAD_TIMEOUT,i=!1;break;case"audioTrack":r=g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,i=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:a.url,loader:a,context:t})}}]),t}(c.default);r.default=T},{2:2,26:26,27:27,28:28,40:40,45:45}],37:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=255&i,t.set(e,4),a=0,i=8;a>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))}},{key:"moov",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){r*=t;var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,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 e.box(e.types.mvhd,i)}},{key:"sdtp",value:function(t){var r,i,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(i));var o=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),l=t.width,u=t.height,d=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.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,l>>8&255,255&l,u>>8&255,255&u,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,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value: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]))}},{key:"mp4a",value:function(t){var r=t.audiosamplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.audiosamplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,i=t.duration*t.timescale,a=t.width,n=t.height;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,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,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))}},{key:"traf",value:function(t,r){var i=e.sdtp(t),a=t.id;return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),e.trun(t,i.length+16+16+8+16+8+8),i)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var i,a,n,s,o,l,u=t.samples||[],d=u.length,f=12+16*d,h=new Uint8Array(f);for(r+=8+f,h.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,h)}},{key:"initSegment",value:function(t){e.types||e.init();var r,i=e.moov(t);return r=new Uint8Array(e.FTYP.byteLength+i.byteLength),r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r}}]),e}();r.default=n},{}],38:[function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;rMath.pow(2,32)&&function(){e.timescale=e.audiosamplerate/function e(t,r){return r?e(r,t%r):t}(e.audiosamplerate,e.isAAC?1024:1152)}(),d.logger.log("audio mp4 timescale :"+e.timescale),e.isAAC||(g.mpeg?(v="audio/mpeg",e.codec=""):g.mp3&&(e.codec="mp3")),p.audio={container:v,codec:e.codec,initSegment:!e.isAAC&&g.mpeg?new Uint8Array:h.default.initSegment([e]),metadata:{channelCount:e.channelCount}},m&&(a=n=o[0].pts-f*r)),t.sps&&t.pps&&l.length&&(t.timescale=this.MP4_TIMESCALE,p.video={container:"video/mp4",codec:t.codec,initSegment:h.default.initSegment([t]),metadata:{width:t.width,height:t.height}},m&&(a=Math.min(a,l[0].pts-f*r),n=Math.min(n,l[0].dts-f*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{id:this.id,initPTS:a,cc:i}))),Object.keys(p).length?(s.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,y),this.ISGenerated=!0,m&&(this._initPTS=a,this._initDTS=n)):s.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,id:this.id,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,i){var a,n,s,o,l,f,g,v=8,p=this.PES_TIMESCALE,y=this.PES2MP4SCALEFACTOR,m=e.samples,E=[],b=m.length,R=this._PTSNormalize,_=this._initDTS;m.sort(function(e,t){var r=e.dts-t.dts;return r||e.pts-t.pts});var T=m.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(T<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var k=0;k1?d.logger.log("AVC:"+L+" ms hole between fragments detected,filling it"):L<-1&&d.logger.log("AVC:"+-L+" ms overlapping between fragments detected"),l=A,m[0].dts=l+_,o=Math.max(o-L,A),m[0].pts=o+_,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(o/90)+"/"+Math.round(l/90)+",delta:"+L+" ms")),S=m[m.length-1],g=Math.max(R(S.dts-_,A),0),f=Math.max(R(S.pts-_,A),0),f=Math.max(f,g);var D=navigator.vendor,w=navigator.userAgent,O=D&&D.indexOf("Apple")>-1&&w&&!w.match("CriOS");O&&(a=Math.round((g-l)/(y*(m.length-1))));for(var I=0;I0?M-1:M].dts;if(V.stretchShortVideoTrack){var X=V.maxBufferHole,q=V.maxSeekHole,z=Math.floor(Math.min(X,q)*p),J=(i?o+i*p:this.nextAudioPts)-F.pts;J>z?(a=J-Y,a<0&&(a=Y),d.logger.log("It is approximately "+J/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=Y}else a=Y}a/=y,G=Math.round((F.pts-F.dts)/y)}E.push({size:U,duration:a,cts:G,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:F.key?2:1,isNonSync:F.key?0:1}})}this.nextAvcDts=g+a*y;var Q=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,E.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var $=E[0].flags;$.dependsOn=2,$.isNonSync=0}e.samples=E,s=h.default.moof(e.sequenceNumber++,l/y,e),e.samples=[];var Z={id:this.id,level:this.level,sn:this.sn,data1:s,data2:n,startPTS:o/p,endPTS:(f+y*a)/p,startDTS:l/p,endDTS:this.nextAvcDts/p,type:"video",nb:E.length,dropped:Q};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Z),Z}},{key:"remuxAudio",value:function(e,t,r,i){var a,n,s,l,f,g,v,p,y,m,E,b,R,_,T,k,A=this.PES_TIMESCALE,S=e.timescale,L=A/S,D=e.timescale*(e.isAAC?1024:1152)/e.audiosamplerate,w=D*L,O=this._PTSNormalize,I=this._initDTS,P=!e.isAAC&&this.typeSupported.mpeg,C=P?0:8,x=[],M=[];if(e.samples.sort(function(e,t){return e.pts-t.pts}),M=e.samples,k=this.nextAudioPts,r|=M.length&&k&&(Math.abs(t-k/A)<.1||Math.abs(M[0].pts-k-this._initDTS)<20*w),r||(k=t*A),i&&e.isAAC)for(var F=0,N=k;F=w&&N){var j=Math.round(B/w);d.logger.warn("Injecting "+j+" audio frame @ "+Math.round(N/90)/1e3+"s due to "+Math.round(B/90)+" ms gap.");for(var H=0;H0)Y=Math.round((b-k)/w),d.logger.log(V+" ms hole between AAC samples detected,filling it"),Y>0&&(_=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),_||(_=l.subarray()),e.len+=Y*_.length);else if(V<-12){d.logger.log(-V+" ms overlapping between AAC samples detected, drop frame"),e.len-=l.byteLength;continue}b=R=k}if(v=Math.max(0,b),p=Math.max(0,R),!(e.len>0))return;var X=P?e.len:e.len+8;try{f=new Uint8Array(X)}catch(e){return void this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,level:this.level,id:this.id,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:X,reason:"fail allocating audio mdat "+X})}P||(a=new DataView(f.buffer),a.setUint32(0,X),f.set(h.default.types.mdat,4));for(var q=0;q=2&&(J=x[Q-2].duration,s.duration=J),Q){this.nextAudioPts=b+L*J,e.len=0,e.samples=x,g=P?new Uint8Array:h.default.moof(e.sequenceNumber++,p/L,e),e.samples=[];var $={id:this.id,level:this.level,sn:this.sn,data1:g,data2:f,startPTS:v/A,endPTS:this.nextAudioPts/A,startDTS:p/A,endDTS:(R+L*J)/A,type:"audio",nb:Q};return this.observer.trigger(u.default.FRAG_PARSING_DATA,$),$}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,i){var a=this.PES_TIMESCALE,n=e.timescale?e.timescale:e.audiosamplerate,s=a/n,l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*a)+this._initDTS,f=i.endDTS*a+this._initDTS,h=1024*s,c=Math.ceil((f-u)/h),g=o.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(d.logger.warn("remux empty Audio"),!g)return void d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],p=0;p4294967296;)e+=r;return e}},{key:"passthrough",get:function(){return!1}}]),e}();r.default=g},{26:26,28:28,29:29,37:37,45:45}],39:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value: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),i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(s.lastIndex=0;null!==(t=s.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r}}]),e}();r.default=o},{}],41:[function(e,t,r){"use strict";var i={search:function(e,t){for(var r=0,i=e.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=e[a];var s=t(n);if(s>0)r=a+1;else{if(!(s<0))return n;i=a-1}}return null}};t.exports=i},{}],42:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=r&&console.log(this.time+" ["+e+"] "+t)}},v=function(e){for(var t=[],r=0;rl&&(g.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=s(e);if(this.pos>=l)return void g.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),b=function(){function e(t,r){i(this,e),this.chNr=t,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new E,this.nonDisplayedMemory=new E,this.lastOutputScreen=new E,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return a(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e,this.lastOutputScreen)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,g.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset(),this.lastOutputScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}g.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=g.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),R=function(){function e(t,r,a){i(this,e),this.field=t||1,this.outputs=[r,a],this.channels=[new b(1,r),new b(2,a)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return a(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var r,i,a,n=!1;this.lastTime=e,g.setTime(e);for(var s=0;s ("+v([i,a])+")"),r=this.parseCmd(i,a),r||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(n=this.parseChars(i,a)))if(this.currChNr&&this.currChNr>=0){var o=this.channels[this.currChNr-1];o.insertChars(n)}else g.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:n?this.dataCounters.char+=2:(this.dataCounters.other+=2,g.log("WARNING","Couldn't parse cleaned data "+v([i,a])+" orig: "+v([t[s],t[s+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var r=null,i=(20===e||28===e)&&32<=t&&t<=47,a=(23===e||31===e)&&33<=t&&t<=35;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,g.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"parseMidrow",value:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return g.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(t),g.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,i=null,a=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,n=(16===e||24===e)&&64<=t&&t<=95;if(!a&&!n)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,i=64<=t&&t<=95?1===r?u[e]:f[e]:1===r?d[e]:h[e];var s=this.interpretPAC(i,t);return this.channels[r-1].setPAC(s),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(e,t){var r=t,i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}},{key:"parseChars",value:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var n=t;n=17===a?t+80:18===a?t+112:t+144,g.log("INFO","Special char '"+s(n)+"' in channel "+r),i=[n]}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t]);if(i){var o=v(i);g.log("DEBUG","Char codes = "+o.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i}},{key:"parseBackgroundAttributes",value:function(e,t){var r,i,a,n,s=(16===e||24===e)&&32<=t&&t<=47,o=(23===e||31===e)&&45<=t&&t<=47;return!(!s&&!o)&&(r={},16===e||24===e?(i=Math.floor((t-32)/2),r.background=c[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),a=e<24?1:2,n=this.channels[a-1],n.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e=16?o--:o++,navigator.userAgent.match(/Firefox\//)?n.line=d+1:n.line=d>7?d-2:d+1,n.align="left",n.position=Math.max(0,Math.min(100,o/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(n)}}};t.exports=i},{}],44:[function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r "+t}function n(e){var t=self.console[e];return t?function(){for(var r=arguments.length,i=Array(r),n=0;n1?t-1:0),i=1;i=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var o=t.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===a.responseType?(l=t.response,u=l.byteLength):(l=t.responseText,u=l.length),i.loaded=i.total=u;var d={url:t.responseURL,data:l};this.callbacks.onSuccess(d,i,a)}else i.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++)}else this.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){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var r=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),e}();r.default=s},{45:45}]},{},[33])(33)})},function(t,r){t.exports=e},function(e,t,r){"use strict";function i(e,t){function r(){var e=null,t=null;return function(){var r=Date.now();!e||r-e>2e3?(e=r,o.recoverMediaError()):!t||r-t>2e3?(t=r,o.swapAudioCodec(),o.recoverMediaError()):console.error("Error loading media: File could not be played")}}var i=t.options_,n=t.el(),s=null,o=new a(i.hlsjsConfig),l=r(),u=r();n.addEventListener("error",function(e){var t=e.currentTarget.error;t.code===t.MEDIA_ERR_DECODE?u():console.error("Error loading media: File could not be played")}),this.dispose=function(){o.destroy()},this.duration=function(){return s||n.duration||0},o.on(a.Events.LEVEL_LOADED,function(e,t){s=t.details.live?1/0:t.details.totalduration}),o.on(a.Events.ERROR,function(e,t){if(t.fatal)switch(t.type){case a.ErrorTypes.NETWORK_ERROR:o.startLoad();break;case a.ErrorTypes.MEDIA_ERROR:l();break;default:console.error("Error loading media: File could not be played")}}),Object.keys(a.Events).forEach(function(e){var r=a.Events[e];o.on(r,function(e,i){t.trigger(r,i)})}),o.attachMedia(n),o.loadSource(e.src)}var a=r(0),n=/^application\/(x-mpegURL|vnd\.apple\.mpegURL)$/i,s=/\.m3u8/i,o={canHandleSource:function(e){return e.skipContribHlsJs?"":n.test(e.type)?"probably":s.test(e.src)?"maybe":""},handleSource:function(e,t){return new i(e,t)},canPlayType:function(e){return n.test(e)?"probably":""}};if(a.isSupported()){var l=r(1);l?l.getComponent("Html5").registerSourceHandler(o,0):console.warn("videojs-contrib-hls.js: Couldn't find find window.videojs nor require('video.js')")}}])}); //# sourceMappingURL=videojs-contrib-hlsjs.min.js.map \ No newline at end of file diff --git a/dist/videojs-contrib-hlsjs.min.js.map b/dist/videojs-contrib-hlsjs.min.js.map index 925f2fa..a2f2fca 100644 --- a/dist/videojs-contrib-hlsjs.min.js.map +++ b/dist/videojs-contrib-hlsjs.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///videojs-contrib-hlsjs.min.js","webpack:///webpack/bootstrap 024939d3dc9bf0dd5877","webpack:///./~/hls.js/dist/hls.js","webpack:///external {\"commonjs\":\"video.js\",\"commonjs2\":\"video.js\",\"amd\":\"video.js\",\"root\":\"videojs\"}","webpack:///./src/videojs5.hlsjs.js"],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","f","e","t","r","u","Error","code","length","1","_dereq_","EventEmitter","_events","_maxListeners","undefined","isFunction","arg","isNumber","isObject","isUndefined","defaultMaxListeners","setMaxListeners","isNaN","TypeError","emit","type","er","handler","len","args","listeners","error","arguments","err","context","Array","slice","apply","addListener","listener","newListener","push","warned","console","trace","on","once","g","removeListener","fired","list","position","splice","removeAllListeners","key","listenerCount","evlistener","emitter","2","HASH_SPLIT","QUERY_SPLIT","DOMAIN_SPLIT","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","trim","test","relativeURLQuery","relativeURLHash","relativeURLHashSplit","exec","relativeURLQuerySplit","baseURLHashSplit","baseURLQuerySplit","baseURLDomainSplit","baseURLProtocol","baseURLProtocolDomain","baseURLPath","indexOf","builtURL","buildAbsolutePath","substring","basePath","relativePath","nUpLn","nEnd","sRelPath","sDir","sPath","replace","nStart","RegExp","substr","3","bundleFn","sources","cache","stringify","JSON","fn","options","resolveSources","workerSources","depPath","depKey","wkey","cacheKeys","keys","exp","default","Math","floor","pow","random","toString","wcache","Function","skey","scache","src","map","join","URL","window","webkitURL","mozURL","msURL","blob","Blob","bare","workerUrl","createObjectURL","worker","Worker","objectURL","4","_interopRequireDefault","obj","_classCallCheck","instance","Constructor","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","writable","setPrototypeOf","__proto__","_createClass","defineProperties","target","props","descriptor","protoProps","staticProps","_events2","_eventHandler","_eventHandler2","_bufferHelper","_bufferHelper2","_errors","_logger","_ewmaBandwidthEstimator","_ewmaBandwidthEstimator2","AbrController","_EventHandler","hls","_this","getPrototypeOf","FRAG_LOADING","FRAG_LOADED","FRAG_BUFFERED","ERROR","lastLoadedFragLevel","_autoLevelCapping","_nextAutoLevel","onCheck","abandonRulesCheck","bind","clearTimer","destroy","data","frag","timer","setInterval","bwEstimator","level","isLive","levels","details","live","config","ewmaFast","ewmaSlow","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","fragCurrent","v","media","loader","minAutoLevel","stats","aborted","logger","warn","paused","playbackRate","readyState","autoLevel","requestDelay","performance","now","trequest","abs","duration","loadRate","max","bw","loaded","levelBitrate","realBitrate","bitrate","expectedLen","total","round","pos","currentTime","fragLoadedDelay","bufferStarvationDelay","bufferInfo","maxBufferHole","end","fragLevelNextLoadedDelay","nextLoadLevel","levelNextBitrate","toFixed","sample","abort","trigger","FRAG_LOAD_EMERGENCY_ABORTED","loadedBytes","bytes","loadedDuration","bitrateTest","tparsed","tbuffered","tload","onFragBuffered","loadCounter","fragLoadingProcessingMs","log","tfirst","bitrateTestDelay","ErrorDetails","FRAG_LOAD_ERROR","FRAG_LOAD_TIMEOUT","clearInterval","currentLevel","currentFragDuration","currentBw","maxAutoLevel","maxFetchDuration","bwFactor","bwUpFactor","levelInfo","levelDetails","avgDuration","totalduration","fragments","adjustedbw","fetchDuration","set","newLevel","nextAutoLevel","minAutoBitrate","canEstimate","min","nextABRAutoLevel","nextLevel","autoLevelCapping","avgbw","getEstimate","bestLevel","findBestLevel","abrBandWidthFactor","abrBandWidthUpFactor","maxStarvationDelay","maxLoadingDelay","26","27","28","30","45","9","5","_typeof","Symbol","iterator","_binarySearch","_binarySearch2","_demuxer","_demuxer2","_levelHelper","_levelHelper2","_timeRanges","_timeRanges2","State","STOPPED","STARTING","IDLE","PAUSED","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","BUFFER_FLUSHING","ENDED","WAITING_INIT_PTS","AudioStreamController","MEDIA_ATTACHED","MEDIA_DETACHING","AUDIO_TRACKS_UPDATED","AUDIO_TRACK_SWITCHING","AUDIO_TRACK_LOADED","KEY_LOADED","FRAG_PARSING_INIT_SEGMENT","FRAG_PARSING_DATA","FRAG_PARSED","BUFFER_CREATED","BUFFER_APPENDED","BUFFER_FLUSHED","INIT_PTS_FOUND","audioCodecSwap","ticks","_state","ontick","tick","initPTS","waitingFragment","stopLoad","state","demuxerId","id","cc","onFragLoaded","startPosition","tracks","lastCurrentTime","fragLoadError","nextLoadPosition","fragPrevious","demuxer","doTick","setTimeout","track","trackDetails","retryDate","isSeeking","_this2","_ret","loadedmetadata","startFragRequested","startFragPrefetch","mediaBuffer","bufferLen","bufferEnd","maxBufLen","maxMaxBufferLength","audioSwitch","trackId","sn","endSN","seeking","BUFFER_EOS","fragLen","start","PTSKnown","nextStart","loadIdx","fragLoadIdx","nextBuffered","foundFrag","maxFragLookUpTolerance","search","candidate","startSN","decryptdata","uri","maxThreshold","fragLoadingLoopThreshold","ErrorTypes","MEDIA_ERROR","FRAG_LOOP_LOADING_ERROR","fatal","onvseeking","onMediaSeeking","onvended","onMediaEnded","addEventListener","autoStartLoad","startLoad","ended","forEach","fragment","removeEventListener","onvseeked","audioTracks","altAudio","url","newDetails","sliding","curDetails","mergeDetails","startTimeOffset","audioCodec","defaultAudioCodec","appended","pendingBuffering","payload","video","audio","levelCodec","BUFFER_CODECS","container","codec","initSegment","appendObj","parent","content","pendingData","BUFFER_APPENDING","_this3","startPTS","endPTS","startDTS","endDTS","nb","updateFragPTSDTS","appendOnBufferFlush","startOffset","endOffset","Number","POSITIVE_INFINITY","AUDIO_TRACK_SWITCHED","data1","data2","buffer","_checkAppendedParsed","audioTrack","pending","buffered","loadError","fragLoadingMaxRetry","delay","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","AUDIO_TRACK_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","_this4","nextState","previousState","22","31","41","46","6","AudioTrackController","MANIFEST_LOADING","MANIFEST_LOADED","updateTrack","defaultFound","targetduration","newId","eventObj","AUDIO_TRACK_SWITCH","AUDIO_TRACK_LOADING","audioTrackId","setAudioTrackInternal","7","BufferController","MEDIA_ATTACHING","MANIFEST_PARSED","BUFFER_RESET","LEVEL_PTS_UPDATED","LEVEL_UPDATED","_msDuration","_levelDuration","onsbue","onSBUpdateEnd","onsbe","onSBUpdateError","pendingTracks","audioBuffer","sourceBuffer","timestampOffset","updating","audioTimestampOffset","audioExpected","videoExpected","sourceBufferNb","ms","mediaSource","MediaSource","onmso","onMediaSourceOpen","onmse","onMediaSourceEnded","onmsc","onMediaSourceClose","endOfStream","message","revokeObjectURL","removeAttribute","load","flushRange","segments","MEDIA_DETACHED","checkPendingTracks","pendingTracksNb","createSourceBuffers","doAppending","_needsFlush","doFlush","_needsEos","checkEos","appending","reduce","counter","segment","updateMediaElementDuration","event","BUFFER_APPENDING_ERROR","sb","removeSourceBuffer","trackName","mimeType","addSourceBuffer","BUFFER_ADD_CODEC_ERROR","dataType","sbobj","flushBufferCounter","levelDuration","Infinity","range","flushBuffer","shift","unshift","appendBuffer","appendError","BUFFER_FULL_ERROR","BUFFER_APPEND_ERROR","appendErrorMaxRetry","typeIn","bufStart","bufEnd","flushStart","flushEnd","navigator","userAgent","toLowerCase","remove","8","CapLevelController","FPS_DROP_LEVEL_CAPPING","capLevelToPlayerSize","restrictedLevels","isLevelRestricted","droppedLevel","HTMLVideoElement","firstLevel","getMaxLevel","detectPlayerSize","levelsLength","streamController","nextLevelSwitch","capLevelIndex","result","mWidth","mediaWidth","mHeight","mediaHeight","lWidth","lHeight","width","height","pixelRatio","devicePixelRatio","clientWidth","offsetWidth","contentScaleFactor","clientHeight","offsetHeight","_ewma","_ewma2","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","durationMs","numBytes","bandwidth","weight","getTotalWeight","44","10","FPSController","isVideoPlaybackQualityAvailable","capLevelOnFPSDrop","getVideoPlaybackQuality","checkFPSInterval","fpsDroppedMonitoringPeriod","decodedFrames","droppedFrames","lastTime","currentPeriod","currentDropped","lastDroppedFrames","currentDecoded","lastDecodedFrames","droppedFPS","FPS_DROP","totalDroppedFrames","fpsDroppedMonitoringThreshold","videoPlaybackQuality","checkFPS","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","11","LevelController","LEVEL_LOADED","_manualLevel","clearTimeout","canload","_levels","bitrateStart","levels0","bitrateSet","videoCodecFound","audioCodecFound","brokenmp4inmp3","checkSupported","isTypeSupported","videoCodec","attrs","AUDIO","redundantLevelId","urlId","filter","sort","b","_firstLevel","MANIFEST_INCOMPATIBLE_CODECS_ERROR","reason","_level","LEVEL_SWITCH","LEVEL_LOADING","OTHER_ERROR","LEVEL_SWITCH_ERROR","levelId","levelError","abrController","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","REMUX_ALLOC_ERROR","nbRedundantLevel","mediaBuffered","isBuffered","retryDelay","levelLoadingRetryDelay","fragLoaded","curLevel","reloadInterval","averagetargetduration","setLevelInternal","_startLevel","configStartLevel","startLevel","12","WAITING_LEVEL","StreamController","_doTickIdle","_checkBuffer","_checkFragmentChanged","levelLastLoaded","maxBufferSize","maxBufferLength","_fetchPayloadOrEos","initialLiveManifestSize","_ensureFragmentAtLivePoint","_findFragment","_loadFragmentOrKey","maxLatency","liveMaxLatencyDuration","liveMaxLatencyDurationCount","liveSyncPosition","computeLivePosition","targetSN","deltaPTS","curSNIdx","dropped","autoLevelEnabled","bufferRange","getBufferRange","rangeCurrent","fragPlaying","FRAG_CHANGED","immediateSwitch","previouslyPaused","pause","flushMainBuffer","play","fetchdelay","currentRange","nextRange","nextLevelId","fragLastKbps","followingBufferRange","flushScope","onMediaSeeked","tolerance","fragStartOffset","fragEndOffset","stalled","aac","heaac","audioCodecSwitch","startLevelLoaded","newLevelId","lastAudioCodec","mediaSeeking","accurateTimeOffset","ua","metadata","channelCount","unique","mergedTrack","audiovideo","drift","videoBuffer","mediaTrack","alternate","_reduceMaxBufferLength","minLength","immediateLevelSwitchEnd","expectedPlaying","playheadMoving","stallReported","nudgeRetry","tnow","stalledDuration","lowBufferWatchdogPeriod","BUFFER_STALLED_ERROR","nextBufferStart","delta","maxSeekHole","nudgeOffset","BUFFER_SEEK_OVER_HOLE","hole","highBufferWatchdogPeriod","nudgeMaxRetry","_currentTime","targetTime","BUFFER_NUDGE_ON_STALL","startPositionBuffered","targetLatency","liveSyncDuration","liveSyncDurationCount","STREAM_STATE_TRANSITION","nextBufferRange","_liveSyncPosition","13","_cea608Parser","_cea608Parser2","TimelineController","FRAG_PARSING_USERDATA","enabled","Cues","cueHandler","enableCEA708Captions","sendAddTrackEvent","Event","document","createEvent","initEvent","dispatchEvent","channel1","newCue","startTime","endTime","screen","textTrack1","existingTrack1","getExistingTrack","clearCurrentCues","createTextTrack","channel2","textTrack2","existingTrack2","cea608Parser","cues","removeCue","channelNumber","textTracks","textTrack","propName","kind","label","lang","addTextTrack","lastPts","NEGATIVE_INFINITY","closedCaptions","pts","samples","ccdatas","extractCea608Data","addData","byteArray","tmpByte","ccbyte1","ccbyte2","ccValid","ccType","count","actualCCBytes","j","42","14","AESCrypto","subtle","iv","aesIV","decrypt","15","AESDecryptor","rcon","subMix","Uint32Array","invSubMix","sBox","invSBox","initTable","arrayBuffer","view","DataView","newArray","getUint32","subMix0","subMix1","subMix2","subMix3","invSubMix0","invSubMix1","invSubMix2","invSubMix3","x","xi","sx","x2","x4","x8","keyBuffer","uint8ArrayToUint32Array_","sameKey","offset","keySize","ksRows","ksRow","invKsRow","keySchedule","invKeySchedule","sbox","prev","word","inputArrayBuffer","nRounds","invSBOX","initVector","initVector0","initVector1","initVector2","initVector3","inputInt32","Int32Array","outputInt32","t0","t1","t2","t3","s0","s1","s2","s3","inputWords0","inputWords1","inputWords2","inputWords3","networkToHostOrderSwap","16","_aesCrypto","_aesCrypto2","_fastAesKey","_fastAesKey2","_aesDecryptor","_aesDecryptor2","Decrypter","observer","browserCrypto","crypto","webkitSubtle","disableWebCrypto","callback","enableSoftwareAES","decryptor","expandKey","fastAesKey","then","aesKey","catch","onWebCryptoError","FRAG_DECRYPT_ERROR","17","FastAESKey","importKey","18","_adts","_adts2","_id","_id2","AACDemuxer","remuxerClass","typeSupported","remuxer","insertDiscontinuity","_aacTrack","sequenceNumber","isAAC","timeOffset","defaultInitPTS","frameLength","frameDuration","frameIndex","headerLength","stamp","aacSample","id3","timeStamp","contiguous","lastCC","switchLevel","lastLevel","lastSN","audiosamplerate","getAudioConfig","samplerate","manifestCodec","unit","subarray","dts","remux","hasTimeStamp","19","24","ADTS","adtsObjectType","adtsSampleingIndex","adtsExtensionSampleingIndex","adtsChanelConfig","adtsSampleingRates","FRAG_PARSING_ERROR","20","_decrypter","_decrypter2","_aacdemuxer","_aacdemuxer2","_tsdemuxer","_tsdemuxer2","_mp4Remuxer","_mp4Remuxer2","_passthroughRemuxer","_passthroughRemuxer2","DemuxerInline","byteLength","method","decrypter","localthis","Date","decryptedData","FRAG_DECRYPTED","tstart","tdecrypt","pushDecrypted","Uint8Array","probe","mp2t","25","38","39","21","_demuxerInline","_demuxerInline2","_events3","_events4","DemuxerWorker","_len","_key","concat","off","_len2","_key2","forwardMessage","ev","postMessage","cmd","parse","enableLogs","debug","FRAG_PARSING_METADATA","_demuxerWorker","_demuxerWorker2","Demuxer","mp4","enableMP2TPassThrough","mpeg","mp3","enableWorker","w","work","onwmsg","onWorkerMessage","onerror","INTERNAL_EXCEPTION","filename","lineno","demuxInitialized","terminate","23","ExpGolomb","bytesAvailable","bitsAvailable","workingBytes","availableBytes","skipBytes","loadWord","size","bits","valu","readBits","leadingZeroCount","skipLZ","skipBits","clz","readUEG","deltaScale","lastScale","nextScale","readEG","profileIdc","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","readUByte","readBoolean","skipEG","skipUEG","skipScalingList","chromaFormatIdc","picOrderCntType","ceil","ID3","_hasTimeStamp","byte1","byte2","byte3","byte4","tagSize","endPos","header","readUTF","_parseID3Frames","_length","_payload","String","fromCharCode","tagId","timestamp","pts33Bit","_timeStamp","_expGolomb","_expGolomb2","TSDemuxer","pmtParsed","_pmtId","_avcTrack","_audioTrack","_id3Track","_txtTrack","aacOverFlow","aacLastPTS","avcSample","stt","pid","pes","codecsOnly","passthrough","unknownPIDs","_duration","avcTrack","id3Track","avcId","audioId","id3Id","pmtId","avcData","pesData","audioData","id3Data","parsePAT","_parsePAT","parsePMT","_parsePMT","parsePES","_parsePES","parseAVCPES","_parseAVCPES","parseAACPES","_parseAACPES","parseMPEGPES","_parseMPEGPES","parseID3PES","_parseID3PES","parsedPIDs","avc","nbNalu","naluLen","units","nbUnits","sampleLen","_initPTS","_initDTS","mpegSupported","sectionLength","tableEnd","programInfoLength","stream","pesFlags","pesLen","pesHdrLen","pesPts","pesDts","payloadStartOffset","newData","dataLen","frame","forceKeyFrameOnDiscontinuity","sps","last","expGolombDecoder","_parseAVCNALu","sliceType","readSliceType","_createAVCSample","discardEPB","payloadType","payloadSize","endOfCaptions","readUShort","readUInt","firstByte","secondByte","totalCCs","_insertSampleInOrder","readSPS","codecarray","codecstring","h","pps","pushAccesUnit","arr","lastUnit","array","overflow","unitType","lastUnitType","naluState","lastState","lastUnitStart","_getLastNalUnit","tmp","_lastUnit","_tmp","newLength","EPBPositions","sourceIndex","newPTS","parsed","_parseMpeg","bitRate","sampleRate","BitratesMap","SamplingRateMap","headerB","headerC","headerE","headerF","headerG","columnInBitrates","columnInSampleRates","padding","_onMpegFrame","_onMpegNoise","NETWORK_ERROR","MUX_ERROR","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","EventHandler","onEvent","events","handledEvents","useGenericHandler","registerListeners","unregisterListeners","isEventHandler","onEventGeneric","eventToFunction","funcName","FRAG_LOAD_PROGRESS","DESTROYING","29","AAC","BufferHelper","maxHoleDuration","vbuffered","bufferedInfo","bufferStart","bufferStartNext","buffered2","diff","buf2len","buf2end","LevelHelper","oldDetails","PTSFrag","oldfragments","newfragments","ccOffset","oldFrag","newFrag","fragIdx","updatePTS","fromIdx","toIdx","fragFrom","fragTo","fragToPTS","32","_playlistLoader","_playlistLoader2","_fragmentLoader","_fragmentLoader2","_abrController","_abrController2","_bufferController","_bufferController2","_capLevelController","_capLevelController2","_audioStreamController","_audioStreamController2","_streamController","_streamController2","_levelController","_levelController2","_timelineController","_timelineController2","_fpsController","_fpsController2","_audioTrackController","_audioTrackController2","_xhrLoader","_xhrLoader2","_keyLoader","_keyLoader2","_cues","_cues2","Hls","defaultConfig","DefaultConfig","prop","playlistLoader","fragmentLoader","levelController","bufferController","capLevelController","fpsController","audioStreamController","timelineController","audioTrackController","keyLoader","WebKitMediaSource","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fLoader","pLoader","xhrSetup","fetchSetup","stretchShortVideoTrack","detachMedia","swapAudioCodec","attachMedia","loadLevel","immediateLevelSwitch","manualLevel","34","35","36","43","47","33","FragmentLoader","loaders","loaderName","loaderContext","loaderConfig","loaderCallbacks","responseType","progressData","byteRangeStartOffset","byteRangeEndOffset","rangeStart","rangeEnd","timeout","maxRetry","maxRetryDelay","onSuccess","loadsuccess","onError","loaderror","onTimeout","loadtimeout","onProgress","loadprogress","response","KeyLoader","decryptkey","decrypturl","_urlToolkit","_urlToolkit2","_attrList","_attrList2","MASTER_PLAYLIST_REGEX","MASTER_PLAYLIST_MEDIA_REGEX","LEVEL_PLAYLIST_REGEX_FAST","LevelKey","_uri","reluri","baseuri","Fragment","_url","_byteRange","_decryptdata","tagList","segmentNumber","uint8View","levelkey","createInitializationVector","relurl","baseurl","_programDateTime","rawProgramDateTime","byteRange","rawByteRange","params","split","lastByteRangeEndOffset","parseInt","fragmentDecryptdataFromLevelkey","PlaylistLoader","retry","baseUrl","string","lastIndex","resolve","resolution","decimalResolution","decimalInteger","NAME","codecs","CODECS","avc1toavcoti","medias","TYPE","groupId","DEFAULT","autoselect","AUTOSELECT","forced","FORCED","URI","LANGUAGE","avcdata","currentSN","version","prevFrag","parseFloat","title","match","value1","value2","toUpperCase","decryptparams","keyAttrs","decryptmethod","enumeratedString","decrypturi","decryptiv","hexadecimalInteger","startParams","startAttrs","decimalFloatingPoint","mapAttrs","BYTERANGE","pop","isLevel","parseLevelPlaylist","parseMasterPlaylist","audiotracks","parseMasterPlaylistMedia","embeddedAudioFound","40","37","MP4","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","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","box","DINF","timescale","baseMediaDecodeTime","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","hSpacing","vSpacing","configlen","sampleDependencyTable","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","init","movie","_aac","_aac2","_mp4Generator","_mp4Generator2","MP4Remuxer","ISGenerated","PES2MP4SCALEFACTOR","PES_TIMESCALE","MP4_TIMESCALE","videoTrack","generateIS","remuxAudio","audioTrackLength","remuxVideo","videoData","remuxEmptyAudio","remuxID3","remuxText","initDTS","audioSamples","videoSamples","pesTimeScale","computePTSDTS","greatestCommonDivisor","mp4SampleDuration","firstPTS","firstDTS","lastPTS","lastDTS","pes2mp4ScaleFactor","inputSamples","outputSamples","nbSamples","ptsNormalize","_PTSNormalize","deltadts","PTSDTSshift","curr","nextAvcDts","vendor","isSafari","_i","_sample","mdatSize","setUint32","_i2","avcSampleUnits","mp4SampleLength","compositionTimeOffset","unitData","unitDataLen","lastFrameDuration","gapTolerance","deltaToFrameEnd","nextAudioPts","audioSample","mp4Sample","ptsnorm","dtsnorm","fillFrame","newStamp","mp4timeScale","expectedSampleDuration","pesFrameDuration","rawMPEG","nextPtsNorm","ptsNorm","missing","getSilentFrame","_j","_nbSamples","_delta","numMissingFrames","_i3","unitLen","lastSampleDuration","silentFrame","index","reference","PassThroughRemuxer","rawData","DECIMAL_RESOLUTION_REGEX","ATTR_LIST_REGEX","AttrList","parseAttrList","attr","attrName","intValue","MAX_SAFE_INTEGER","stringValue","res","input","lastIndexOf","BinarySearch","comparisonFunction","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","specialCea608CharsCodes","92","94","95","96","123","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200","201","202","203","204","205","206","207","getCharForByte","byte","charCode","NR_ROWS","NR_COLS","rowsLowCh1","rowsHighCh1","rowsLowCh2","rowsHighCh2","backgroundColors","verboseFilter","DATA","DEBUG","INFO","WARNING","TEXT","time","verboseLevel","setTime","newTime","severity","msg","minLevel","numArrayToHexArray","numArray","hexArray","PenState","foreground","underline","italics","background","flash","styles","attribs","style","other","newPenState","StyledUnicodeChar","uchar","penState","reset","copy","equals","newChar","isDefault","Row","chars","currPenState","equal","empty","isEmpty","absPos","relPos","newPos","setPenState","setCursor","moveCursor","setChar","backSpace","char","startPos","clearFromPos","setStyles","CaptionScreen","rows","currRow","nrRollUpRows","clear","clearToEndOfRow","insertChar","setPenStyles","pacData","lastOutputScreen","newRow","row","topRowIndex","prevLineTime","cueStartTime","indent","prevPos","color","setPen","bkgData","nrRows","getDisplayText","topRow","asOneRow","displayText","text","rowNr","rowText","getTextString","Cea608Channel","outputFilter","chNr","mode","verbose","displayedMemory","nonDisplayedMemory","currRollUpRow","writeScreen","lastCueEndTime","newHandler","setPAC","setBkgData","newMode","outputDataUpdate","setMode","setRollUpRows","rollUp","nrCols","colorIndex","colors","updateData","Cea608Parser","field","out1","out2","outputs","channels","currChNr","lastCmdA","lastCmdB","bufferedData","dataCounters","getHandler","setHandler","byteList","cmdFound","charsFound","parseCmd","parseMidrow","parsePAC","parseBackgroundAttributes","parseChars","channel","insertChars","cond1","cond2","ccRCL","ccBS","ccAOF","ccAON","ccDER","ccRU","ccFON","ccRDC","ccTR","ccRTD","ccEDM","ccCR","ccENM","ccEOC","ccTO","ccMIDROW","case1","case2","interpretPAC","pacIndex","channelNr","charCodes","charCode1","oneCode","hexCodes","cueSplitAtTime","captionScreen","cue","indenting","VTTCue","TextTrackCue","line","align","addCue","EWMA","halfLife","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","noop","formatMsg","consolePrintFn","func","exportLoggerFunctions","debugConfig","functions","exportedLogger","fakeLogger","info","TimeRanges","XhrLoader","requestTimeout","retryTimeout","callbacks","loadInternal","xhr","XDomainRequest","XMLHttpRequest","onreadystatechange","readystatechange","onprogress","open","setRequestHeader","send","currentTarget","status","responseText","responseURL","statusText","lengthComputable","Html5HlsJS","source","tech","errorHandlerFactory","_recoverDecodingErrorDate","_recoverAudioCodecErrorDate","recoverMediaError","options_","el","hlsjsConfig","hlsjsErrorHandler","videoTagErrorHandler","mediaError","MEDIA_ERR_DECODE","dispose","Events","eventName","loadSource","HlsSourceHandler","canHandleSource","hlsTypeRE","hlsExtRE","skipContribHlsJs","handleSource","canPlayType","isSupported","videojs","getComponent","registerSourceHandler"],"mappings":"CAAA,SAAAA,EAAAC,GACA,mBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,iBACA,sBAAAC,gBAAAC,IACAD,QAAA,YAAAJ,OACA,CACA,GAAAM,GAAAN,EAAA,gBAAAC,SAAAE,QAAA,YAAAJ,EAAA,QACA,QAAAQ,KAAAD,IAAA,gBAAAL,iBAAAF,GAAAQ,GAAAD,EAAAC,KAECC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GA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moB,OAAA/uD,MAAA,SAAA4W,EAAAnW,GACA,GAAAA,EAAAwN,MACA,OAAAxN,EAAAjK,MACA,IAAAowC,GAAA94B,WAAAo0B,cACAxiC,EAAA8O,WACA,MACA,KAAAo4B,GAAA94B,WAAAC,YACA2gD,GACA,MACA,SACAh3D,QAAAZ,MAAA,oDAMA3C,OAAAwH,KAAAirC,EAAAmoB,QAAArgD,QAAA,SAAArW,GACA,GAAA22D,GAAApoB,EAAAmoB,OAAA12D,EACAqH,GAAA9H,GAAAo3D,EAAA,SAAAp4C,EAAAnW,GACAytD,EAAA7pD,QAAA2qD,EAAAvuD,OAKAf,EAAAgpC,YAAA8lB,GACA9uD,EAAAuvD,WAAAhB,EAAA1xD,KAtGA,GAAAqqC,GAAArzC,EAAA,GAyGA27D,GACAC,gBAAA,SAAAlB,GACA,GAAAmB,GAAA,4BACAC,EAAA,SAEA,OAAApB,GAAAqB,iBACA,GAEAF,EAAAl2D,KAAA+0D,EAAAz3D,MACA,WAEA64D,EAAAn2D,KAAA+0D,EAAA1xD,KACA,QAGA,IAGAgzD,aAAA,SAAAtB,EAAAC,GACA,UAAAF,GAAAC,EAAAC,IAEAsB,YAAA,SAAAh5D,GAEA,MADA,4BACA0C,KAAA1C,GACA,WAGA,IAIA,IAAAowC,EAAA6oB,cAAA,CACA,GAAAC,GAAAn8D,EAAA,EAEAm8D,GACAA,EAAAC,aAAA,SAAAC,sBAAAV,EAAA,GAGAx3D,QAAAyK,KAAA","file":"videojs-contrib-hlsjs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"video.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"video.js\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"video.js\")) : factory(root[\"videojs\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"video.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"video.js\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"video.js\")) : factory(root[\"videojs\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar require;var require;(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return require(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],2:[function(_dereq_,module,exports){\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var HASH_SPLIT = /^([^#]*)(.*)$/;\r\n var QUERY_SPLIT = /^([^\\?]*)(.*)$/;\r\n var DOMAIN_SPLIT = /^(([a-z]+:\\/\\/)?[^:\\/]+(?::[0-9]+)?)?(\\/?.*)$/i;\r\n\r\n var URLToolkit = {\r\n // build an absolute URL from a relative one using the provided baseURL\r\n // if relativeURL is an absolute URL it will be returned as is.\r\n buildAbsoluteURL: function(baseURL, relativeURL) {\r\n // remove any remaining space and CRLF\r\n relativeURL = relativeURL.trim();\r\n if (/^[a-z]+:/i.test(relativeURL)) {\r\n // complete url, not relative\r\n return relativeURL;\r\n }\r\n\r\n var relativeURLQuery = null;\r\n var relativeURLHash = null;\r\n\r\n var relativeURLHashSplit = HASH_SPLIT.exec(relativeURL);\r\n if (relativeURLHashSplit) {\r\n relativeURLHash = relativeURLHashSplit[2];\r\n relativeURL = relativeURLHashSplit[1];\r\n }\r\n var relativeURLQuerySplit = QUERY_SPLIT.exec(relativeURL);\r\n if (relativeURLQuerySplit) {\r\n relativeURLQuery = relativeURLQuerySplit[2];\r\n relativeURL = relativeURLQuerySplit[1];\r\n }\r\n\r\n var baseURLHashSplit = HASH_SPLIT.exec(baseURL);\r\n if (baseURLHashSplit) {\r\n baseURL = baseURLHashSplit[1];\r\n }\r\n var baseURLQuerySplit = QUERY_SPLIT.exec(baseURL);\r\n if (baseURLQuerySplit) {\r\n baseURL = baseURLQuerySplit[1];\r\n }\r\n\r\n var baseURLDomainSplit = DOMAIN_SPLIT.exec(baseURL);\r\n if (!baseURLDomainSplit) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n \r\n // e.g. 'http://', 'https://', ''\r\n var baseURLProtocol = baseURLDomainSplit[2] || '';\r\n // e.g. 'http://example.com', '//example.com', 'example.com', ''\r\n var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\r\n // e.g. '/a/b/c/playlist.m3u8', 'a/b/c/playlist.m3u8'\r\n var baseURLPath = baseURLDomainSplit[3];\r\n if (baseURLPath.indexOf('/') !== 0 && baseURLProtocolDomain !== '') {\r\n // this handles a base url of http://example.com (missing last slash)\r\n baseURLPath = '/'+baseURLPath;\r\n }\r\n\r\n var builtURL = null;\r\n if (/^\\/\\//.test(relativeURL)) {\r\n // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\r\n builtURL = baseURLProtocol+URLToolkit.buildAbsolutePath('', relativeURL.substring(2));\r\n }\r\n else if (/^\\//.test(relativeURL)) {\r\n // relative url starts with '/' so start from root of domain\r\n builtURL = baseURLProtocolDomain+'/'+URLToolkit.buildAbsolutePath('', relativeURL.substring(1));\r\n }\r\n else {\r\n builtURL = URLToolkit.buildAbsolutePath(baseURLProtocolDomain+baseURLPath, relativeURL);\r\n }\r\n\r\n // put the query and hash parts back\r\n if (relativeURLQuery) {\r\n builtURL += relativeURLQuery;\r\n }\r\n if (relativeURLHash) {\r\n builtURL += relativeURLHash;\r\n }\r\n return builtURL;\r\n },\r\n\r\n // build an absolute path using the provided basePath\r\n // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\r\n // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\r\n buildAbsolutePath: function(basePath, relativePath) {\r\n var sRelPath = relativePath;\r\n var nUpLn, sDir = '', sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\r\n for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\r\n nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\r\n sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + ((nUpLn - 1) / 3) + '}$'), '/');\r\n }\r\n return sDir + sPath.substr(nStart);\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[function(_dereq_,module,exports){\nvar bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn, options) {\n var wkey;\n var cacheKeys = Object.keys(cache);\n\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n var exp = cache[key].exports;\n // Using babel as a transpiler to use esmodule, the export will always\n // be an object with the default export as a property of it. To ensure\n // the existing api and babel esmodule exports are both supported we\n // check for both\n if (exp === fn || exp && exp.default === fn) {\n wkey = key;\n break;\n }\n }\n\n if (!wkey) {\n wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n var wcache = {};\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n wcache[key] = key;\n }\n sources[wkey] = [\n Function(['require','module','exports'], '(' + fn + ')(self)'),\n wcache\n ];\n }\n var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\n var scache = {}; scache[wkey] = wkey;\n sources[skey] = [\n Function(['require'], (\n // try to call default if defined to also support babel esmodule\n // exports\n 'var f = require(' + stringify(wkey) + ');' +\n '(f.default ? f.default : f)(self);'\n )),\n scache\n ];\n\n var workerSources = {};\n resolveSources(skey);\n\n function resolveSources(key) {\n workerSources[key] = true;\n\n for (var depPath in sources[key][1]) {\n var depKey = sources[key][1][depPath];\n if (!workerSources[depKey]) {\n resolveSources(depKey);\n }\n }\n }\n\n var src = '(' + bundleFn + ')({'\n + Object.keys(workerSources).map(function (key) {\n return stringify(key) + ':['\n + sources[key][0]\n + ',' + stringify(sources[key][1]) + ']'\n ;\n }).join(',')\n + '},{},[' + stringify(skey) + '])'\n ;\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n var blob = new Blob([src], { type: 'text/javascript' });\n if (options && options.bare) { return blob; }\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n};\n\n},{}],4:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nvar _ewmaBandwidthEstimator = _dereq_(9);\n\nvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * simple ABR Controller\n * - compute next level based on last fragment bw heuristics\n * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n */\n\nvar AbrController = function (_EventHandler) {\n _inherits(AbrController, _EventHandler);\n\n function AbrController(hls) {\n _classCallCheck(this, AbrController);\n\n var _this = _possibleConstructorReturn(this, (AbrController.__proto__ || Object.getPrototypeOf(AbrController)).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\n _this.lastLoadedFragLevel = 0;\n _this._autoLevelCapping = -1;\n _this._nextAutoLevel = -1;\n _this.hls = hls;\n _this.onCheck = _this.abandonRulesCheck.bind(_this);\n return _this;\n }\n\n _createClass(AbrController, [{\n key: 'destroy',\n value: function destroy() {\n this.clearTimer();\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n if (!this.timer) {\n this.timer = setInterval(this.onCheck, 100);\n }\n // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n // so we need to wait for stream manifest / playlist type to instantiate it.\n if (!this.bwEstimator) {\n var hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast = void 0,\n ewmaSlow = void 0;\n\n if (isLive) {\n ewmaFast = config.abrEwmaFastLive;\n ewmaSlow = config.abrEwmaSlowLive;\n } else {\n ewmaFast = config.abrEwmaFastVoD;\n ewmaSlow = config.abrEwmaSlowVoD;\n }\n this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n }, {\n key: 'abandonRulesCheck',\n value: function abandonRulesCheck() {\n /*\n monitor fragment retrieval time...\n we compute expected time of arrival of the complete fragment.\n we compare it to expected time of buffer starvation\n */\n var hls = this.hls,\n v = hls.media,\n frag = this.fragCurrent,\n loader = frag.loader,\n minAutoLevel = this.minAutoLevel;\n\n // if loader has been destroyed or loading has been aborted, stop timer and return\n if (!loader || loader.stats && loader.stats.aborted) {\n _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n var stats = loader.stats;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n var requestDelay = performance.now() - stats.trequest,\n playbackRate = Math.abs(v.playbackRate);\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > 500 * frag.duration / playbackRate) {\n var levels = hls.levels,\n loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n // byte/s; at least 1 byte/s to avoid division by zero\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n // consider emergency switch down only if we have less than 2 frag buffered AND\n // time to finish loading current fragment is bigger than buffer starvation delay\n // ie if we risk buffer starvation if bw does not increase quickly\n if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n var fragLevelNextLoadedDelay = void 0,\n nextLoadLevel = void 0;\n // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n // we start from current level - 1 and we step down , until we find a matching level\n for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n // we found a lower level that be rebuffering free with current estimated bw !\n break;\n }\n }\n // only emergency switch down if it takes less time to load new fragment at lowest level instead\n // of finishing loading current one ...\n if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']= minAutoLevel; i--) {\n var levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...\n !fetchDuration || live || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var nextAutoLevel = this._nextAutoLevel,\n bwEstimator = this.bwEstimator,\n hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n // in case next auto level has been forced, and bw not available or not reliable\n if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n // cap next auto level by max auto level\n return Math.min(nextAutoLevel, this.maxAutoLevel);\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this.nextABRAutoLevel;\n if (nextAutoLevel !== -1) {\n // nextAutoLevel is defined, use it to cap ABR computed quality level\n nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n }\n if (minAutoBitrate !== undefined) {\n var levelNextBitrate = levels[nextABRAutoLevel].realBitrate ? Math.max(levels[nextABRAutoLevel].realBitrate, levels[nextABRAutoLevel].bitrate) : levels[nextABRAutoLevel].bitrate;\n while (levelNextBitrate < minAutoBitrate) {\n nextABRAutoLevel++;\n }\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var levels = this.hls.levels,\n autoLevelCapping = this._autoLevelCapping,\n maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n }, {\n key: 'nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = this.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = this.minAutoLevel;\n var v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = v ? v.currentTime : 0,\n\n // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n if (bestLevel >= 0) {\n return bestLevel;\n } else {\n _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,\n bwFactor = config.abrBandWidthFactor,\n bwUpFactor = config.abrBandWidthUpFactor;\n if (bufferStarvationDelay === 0) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n return Math.max(bestLevel, 0);\n }\n }\n }]);\n\n return AbrController;\n}(_eventHandler2.default);\n\nexports.default = AbrController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45,\"9\":9}],5:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Audio Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n STARTING: 'STARTING',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\n};\n\nvar AudioStreamController = function (_EventHandler) {\n _inherits(AudioStreamController, _EventHandler);\n\n function AudioStreamController(hls) {\n _classCallCheck(this, AudioStreamController);\n\n var _this = _possibleConstructorReturn(this, (AudioStreamController.__proto__ || Object.getPrototypeOf(AudioStreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED, _events2.default.INIT_PTS_FOUND));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\n return _this;\n }\n\n _createClass(AudioStreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n _logger.logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n this.startPosition = startPosition;\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n var _this2 = this;\n\n var pos,\n track,\n trackDetails,\n hls = this.hls,\n config = hls.config;\n //logger.log('audioStream:' + this.state);\n var now;\n var retryDate;\n var isSeeking;\n\n var _ret = function () {\n switch (_this2.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n _this2.state = State.WAITING_TRACK;\n _this2.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = _this2.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\n }\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!_this2.media && (_this2.startFragRequested || !config.startFragPrefetch)) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // if we have not yet loaded any fragment, start loading from start position\n if (_this2.loadedmetadata) {\n pos = _this2.media.currentTime;\n } else {\n pos = _this2.nextLoadPosition;\n }\n var media = _this2.mediaBuffer ? _this2.mediaBuffer : _this2.media,\n bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = _this2.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = _this2.audioSwitch,\n trackId = _this2.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen && trackId < tracks.length) {\n trackDetails = tracks[trackId].details;\n // if track info not retrieved yet, switch state and wait for track retrieval\n if (typeof trackDetails === 'undefined') {\n _this2.state = State.WAITING_TRACK;\n break;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!_this2.media.seeking || _this2.media.duration - bufferEnd < fragPrevious.duration / 2) {\n // Finalize the media stream\n _this2.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n _this2.state = State.ENDED;\n break;\n }\n }\n\n // find fragment index, contiguous with end of buffer position\n var fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n frag = void 0;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n _this2.media.currentTime = start + 0.05;\n } else {\n return {\n v: void 0\n };\n }\n }\n }\n }\n\n // if bufferEnd before start of playlist, load first fragment\n if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === _this2.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + _this2.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n _this2.media.currentTime = nextBuffered + 0.05;\n return {\n v: void 0\n };\n }\n } else {\n (function () {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n return -1;\n }\n return 0;\n });\n if (!foundFrag) {\n _logger.logger.log('frag not found @bufferEnd/start:' + bufferEnd + '/' + start);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < trackDetails.endSN) {\n frag = fragments[frag.sn + 1 - trackDetails.startSN];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n } else {\n frag = null;\n }\n }\n }\n })();\n }\n if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);\n _this2.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (_this2.fragLoadIdx !== undefined) {\n _this2.fragLoadIdx++;\n } else {\n _this2.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(_this2.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return {\n v: void 0\n };\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = _this2.fragLoadIdx;\n _this2.fragCurrent = frag;\n _this2.startFragRequested = true;\n _this2.nextLoadPosition = frag.start + frag.duration;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n _this2.state = State.FRAG_LOADING;\n }\n }\n }\n break;\n case State.WAITING_TRACK:\n track = _this2.tracks[_this2.trackId];\n // check if playlist is already loaded\n if (track && track.details) {\n _this2.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n now = performance.now();\n retryDate = _this2.retryDate;\n\n media = _this2.media;\n isSeeking = media && media.seeking;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\n if (!retryDate || now >= retryDate || isSeeking) {\n _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n _this2.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var tracks = this.tracks;\n if (tracks) {\n // reset fragment load counter\n tracks.forEach(function (track) {\n if (track.details) {\n track.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (this.media) {\n this.lastCurrentTime = this.media.currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onAudioTracksUpdated',\n value: function onAudioTracksUpdated(data) {\n _logger.logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n this.trackId = data.id;\n this.state = State.IDLE;\n\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment = null;\n // destroy useless demuxer when switching audio to main\n if (!altAudio) {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n } else {\n // switching to audio track, start timer if not already started\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n }\n\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\n\n // compute start position\n if (!this.startFragRequested) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n this.startPosition = 0;\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n if (this.state === State.WAITING_TRACK) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n if (initPTS !== undefined) {\n this.pendingBuffering = true;\n _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, audioCodec, null, start, cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, initPTS);\n } else {\n _logger.logger.log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = 'mp4a.40.2';\n track.id = data.id;\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this3 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n (function () {\n var trackId = _this3.trackId,\n track = _this3.tracks[trackId],\n frag = _this3.fragCurrent,\n hls = _this3.hls;\n\n _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\n var audioSwitch = _this3.audioSwitch,\n media = _this3.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n _this3.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = _this3.pendingData;\n if (!_this3.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // arm pending Buffering flag before appending a segment\n _this3.pendingBuffering = true;\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n _this3.pendingData = [];\n _this3.appended = true;\n }\n }\n //trigger handler right now\n _this3.tick();\n })();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'audio') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to audio fragment\n if (frag && frag.type !== 'audio') {\n return;\n }\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n if (loadError <= config.fragLoadingMaxRetry) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this4 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this4.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n this.tick();\n }\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],6:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * audio track controller\n */\n\nvar AudioTrackController = function (_EventHandler) {\n _inherits(AudioTrackController, _EventHandler);\n\n function AudioTrackController(hls) {\n _classCallCheck(this, AudioTrackController);\n\n var _this = _possibleConstructorReturn(this, (AudioTrackController.__proto__ || Object.getPrototypeOf(AudioTrackController)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n this.updateTrack(this.trackId);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.audioTracks || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n // loop through available audio tracks and autoselect default if needed\n var id = 0;\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n _logger.logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n _logger.logger.log('audioTrack ' + data.id + ' loaded');\n this.tracks[data.id].details = data.details;\n // check if current playlist is a live playlist\n if (data.details.live && !this.timer) {\n // if live playlist we will have to reload it periodically\n // set reload period to playlist target duration\n this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n }\n if (!data.details.live && this.timer) {\n // playlist is not live and timer is armed : stopping it\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'setAudioTrackInternal',\n value: function setAudioTrackInternal(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('switching to audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n }]);\n\n return AudioTrackController;\n}(_eventHandler2.default);\n\nexports.default = AudioTrackController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],7:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Buffer Controller\n */\n\nvar BufferController = function (_EventHandler) {\n _inherits(BufferController, _EventHandler);\n\n function BufferController(hls) {\n _classCallCheck(this, BufferController);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\n var _this = _possibleConstructorReturn(this, (BufferController.__proto__ || Object.getPrototypeOf(BufferController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_PTS_UPDATED, _events2.default.LEVEL_UPDATED));\n\n _this._msDuration = null;\n // the value that we want to set mediaSource.duration to\n _this._levelDuration = null;\n\n // Source Buffer listeners\n _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n _this.onsbe = _this.onSBUpdateError.bind(_this);\n _this.pendingTracks = {};\n _this.tracks = {};\n return _this;\n }\n\n _createClass(BufferController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/dailymotion/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var audioExpected = data.audio,\n videoExpected = data.video,\n sourceBufferNb = 0;\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n if (data.altAudio && (audioExpected || videoExpected)) {\n sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var media = this.media = data.media;\n if (media) {\n // setup the media source\n var ms = this.mediaSource = new MediaSource();\n //Media Source listeners\n this.onmso = this.onMediaSourceOpen.bind(this);\n this.onmse = this.onMediaSourceEnded.bind(this);\n this.onmsc = this.onMediaSourceClose.bind(this);\n ms.addEventListener('sourceopen', this.onmso);\n ms.addEventListener('sourceended', this.onmse);\n ms.addEventListener('sourceclose', this.onmsc);\n // link video and media Source\n media.src = URL.createObjectURL(ms);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n _logger.logger.log('media source detaching');\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n ms.endOfStream();\n } catch (err) {\n _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n }\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (this.media) {\n URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n this.onmso = this.onmse = this.onmsc = null;\n this.hls.trigger(_events2.default.MEDIA_DETACHED);\n }\n }, {\n key: 'onMediaSourceOpen',\n value: function onMediaSourceOpen() {\n _logger.logger.log('media source opened');\n this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n var mediaSource = this.mediaSource;\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n this.checkPendingTracks();\n }\n }, {\n key: 'checkPendingTracks',\n value: function checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n var pendingTracks = this.pendingTracks,\n pendingTracksNb = Object.keys(pendingTracks).length;\n // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n this.doAppending();\n }\n }\n }, {\n key: 'onMediaSourceClose',\n value: function onMediaSourceClose() {\n _logger.logger.log('media source closed');\n }\n }, {\n key: 'onMediaSourceEnded',\n value: function onMediaSourceEnded() {\n _logger.logger.log('media source ended');\n }\n }, {\n key: 'onSBUpdateEnd',\n value: function onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n }, {\n key: 'onSBUpdateError',\n value: function onSBUpdateError(event) {\n _logger.logger.error('sourceBuffer error:' + event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n }\n }, {\n key: 'onBufferReset',\n value: function onBufferReset() {\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n var sb = sourceBuffer[type];\n try {\n this.mediaSource.removeSourceBuffer(sb);\n sb.removeEventListener('updateend', this.onsbue);\n sb.removeEventListener('error', this.onsbe);\n } catch (err) {}\n }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n }, {\n key: 'onBufferCodecs',\n value: function onBufferCodecs(tracks) {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n // if sourcebuffers already created, do nothing ...\n if (Object.keys(this.sourceBuffer).length === 0) {\n for (var trackName in tracks) {\n this.pendingTracks[trackName] = tracks[trackName];\n }\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n // try to create sourcebuffers if mediasource opened\n this.checkPendingTracks();\n }\n }\n }\n }, {\n key: 'createSourceBuffers',\n value: function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + ';codecs=' + codec;\n _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = { codec: codec, container: track.container };\n track.buffer = sb;\n } catch (err) {\n _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n }\n }\n }\n this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n }\n }, {\n key: 'onBufferAppending',\n value: function onBufferAppending(data) {\n if (!this._needsFlush) {\n if (!this.segments) {\n this.segments = [data];\n } else {\n this.segments.push(data);\n }\n this.doAppending();\n }\n }\n }, {\n key: 'onBufferAppendFail',\n value: function onBufferAppendFail(data) {\n _logger.logger.error('sourceBuffer error:', data.event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\n }, {\n key: 'onBufferEos',\n value: function onBufferEos(data) {\n var sb = this.sourceBuffer;\n var dataType = data.type;\n for (var type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n _logger.logger.log(type + ' sourceBuffer now EOS');\n }\n }\n }\n this.checkEos();\n }\n\n // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\n }, {\n key: 'checkEos',\n value: function checkEos() {\n var sb = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for (var type in sb) {\n var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n //Notify the media element that it now has all of the media data\n try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n }, {\n key: 'onBufferFlushing',\n value: function onBufferFlushing(data) {\n this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n // attempt flush immediatly\n this.flushBufferCounter = 0;\n this.doFlush();\n }\n }, {\n key: 'onLevelUpdated',\n value: function onLevelUpdated(event) {\n var details = event.details;\n if (details.fragments.length === 0) {\n return;\n }\n this._levelDuration = details.totalduration + details.fragments[0].start;\n this.updateMediaElementDuration();\n }\n\n // https://github.com/dailymotion/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (var type in sourceBuffer) {\n if (sourceBuffer[type].updating) {\n // can't set duration whilst a buffer is updating\n return;\n }\n }\n if (this._msDuration === null) {\n // initialise to the value that the media source is reporting\n this._msDuration = mediaSource.duration;\n }\n var duration = media.duration;\n // levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update mediasource duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n }, {\n key: 'doFlush',\n value: function doFlush() {\n // loop through all buffer ranges to flush\n while (this.flushRange.length) {\n var range = this.flushRange[0];\n // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n if (this.flushBuffer(range.start, range.end, range.type)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n this.flushBufferCounter = 0;\n } else {\n this._needsFlush = true;\n // avoid looping, wait for SB update end to retrigger a flush\n return;\n }\n }\n if (this.flushRange.length === 0) {\n // everything flushed\n this._needsFlush = false;\n\n // let's recompute this.appended, which is used to avoid flush looping\n var appended = 0;\n var sourceBuffer = this.sourceBuffer;\n try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n }\n }\n }, {\n key: 'doAppending',\n value: function doAppending() {\n var hls = this.hls,\n sourceBuffer = this.sourceBuffer,\n segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n return;\n }\n if (this.appending) {\n //logger.log(`sb appending in progress`);\n return;\n }\n if (segments && segments.length) {\n var segment = segments.shift();\n try {\n var type = segment.type,\n sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\n } else {\n // in case we don't have any source buffer matching with this segment type,\n // it means that Mediasource fails to create sourcebuffer\n // discard this segment, and trigger update end\n this.onSBUpdateEnd();\n }\n } catch (err) {\n // in case any error occured while appending, put back segment in segments table\n _logger.logger.error('error while trying to append buffer:' + err.message);\n segments.unshift(segment);\n var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n if (err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n event.frag = this.fragCurrent;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. retrying help recovering this\n */\n if (this.appendError > hls.config.appendErrorMaxRetry) {\n _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n segments = [];\n event.fatal = true;\n hls.trigger(_events2.default.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n }\n } else {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n this.segments = [];\n event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n return;\n }\n }\n }\n }\n }\n\n /*\n flush specified buffered range,\n return true once range has been flushed.\n as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n */\n\n }, {\n key: 'flushBuffer',\n value: function flushBuffer(startOffset, endOffset, typeIn) {\n var sb,\n i,\n bufStart,\n bufEnd,\n flushStart,\n flushEnd,\n sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n if (this.flushBufferCounter < this.appended) {\n for (var type in sourceBuffer) {\n // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n // if no, let's flush all sourcebuffers\n if (typeIn && type !== typeIn) {\n continue;\n }\n sb = sourceBuffer[type];\n // we are going to flush buffer, mark source buffer as 'not ended'\n sb.ended = false;\n if (!sb.updating) {\n try {\n for (i = 0; i < sb.buffered.length; i++) {\n bufStart = sb.buffered.start(i);\n bufEnd = sb.buffered.end(i);\n // workaround firefox not able to properly flush multiple buffered range.\n if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n flushStart = startOffset;\n flushEnd = endOffset;\n } else {\n flushStart = Math.max(bufStart, startOffset);\n flushEnd = Math.min(bufEnd, endOffset);\n }\n /* sometimes sourcebuffer.remove() does not flush\n the exact expected time range.\n to avoid rounding issues/infinite loop,\n only flush buffer range of length greater than 500ms.\n */\n if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n this.flushBufferCounter++;\n _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n _logger.logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n _logger.logger.warn('abort flushing too many retries');\n }\n _logger.logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n }]);\n\n return BufferController;\n}(_eventHandler2.default);\n\nexports.default = BufferController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],8:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * cap stream level to media size dimension controller\n */\n\nvar CapLevelController = function (_EventHandler) {\n _inherits(CapLevelController, _EventHandler);\n\n function CapLevelController(hls) {\n _classCallCheck(this, CapLevelController);\n\n return _possibleConstructorReturn(this, (CapLevelController.__proto__ || Object.getPrototypeOf(CapLevelController)).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n }\n\n _createClass(CapLevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.hls.config.capLevelToPlayerSize) {\n this.media = this.restrictedLevels = null;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n this.timer = clearInterval(this.timer);\n }\n }\n }\n }, {\n key: 'onFpsDropLevelCapping',\n value: function onFpsDropLevelCapping(data) {\n if (!this.restrictedLevels) {\n this.restrictedLevels = [];\n }\n if (!this.isLevelRestricted(data.droppedLevel)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n hls.firstLevel = this.getMaxLevel(data.firstLevel);\n clearInterval(this.timer);\n this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n }\n }\n }, {\n key: 'detectPlayerSize',\n value: function detectPlayerSize() {\n if (this.media) {\n var levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (hls.autoLevelCapping > this.autoLevelCapping) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */\n\n }, {\n key: 'getMaxLevel',\n value: function getMaxLevel(capLevelIndex) {\n var result = 0,\n i = void 0,\n level = void 0,\n mWidth = this.mediaWidth,\n mHeight = this.mediaHeight,\n lWidth = 0,\n lHeight = 0;\n\n for (i = 0; i <= capLevelIndex; i++) {\n level = this.levels[i];\n if (this.isLevelRestricted(i)) {\n break;\n }\n result = i;\n lWidth = level.width;\n lHeight = level.height;\n if (mWidth <= lWidth || mHeight <= lHeight) {\n break;\n }\n }\n return result;\n }\n }, {\n key: 'isLevelRestricted',\n value: function isLevelRestricted(level) {\n return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n }\n }, {\n key: 'contentScaleFactor',\n get: function get() {\n var pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch (e) {}\n return pixelRatio;\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n }]);\n\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"27\":27,\"28\":28}],9:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\nvar _ewma = _dereq_(44);\n\nvar _ewma2 = _interopRequireDefault(_ewma);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EwmaBandWidthEstimator = function () {\n function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n _classCallCheck(this, EwmaBandWidthEstimator);\n\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _ewma2.default(slow);\n this.fast_ = new _ewma2.default(fast);\n }\n\n _createClass(EwmaBandWidthEstimator, [{\n key: 'sample',\n value: function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000 * numBytes / durationMs,\n\n //console.log('instant bw:'+ Math.round(bandwidth));\n // we weight sample using loading duration....\n weight = durationMs / 1000;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n }\n }, {\n key: 'canEstimate',\n value: function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n }\n }, {\n key: 'getEstimate',\n value: function getEstimate() {\n if (this.canEstimate()) {\n //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }]);\n\n return EwmaBandWidthEstimator;\n}();\n\nexports.default = EwmaBandWidthEstimator;\n\n},{\"44\":44}],10:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * FPS Controller\n */\n\nvar FPSController = function (_EventHandler) {\n _inherits(FPSController, _EventHandler);\n\n function FPSController(hls) {\n _classCallCheck(this, FPSController);\n\n return _possibleConstructorReturn(this, (FPSController.__proto__ || Object.getPrototypeOf(FPSController)).call(this, hls, _events2.default.MEDIA_ATTACHING));\n }\n\n _createClass(FPSController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n }, {\n key: 'checkFPS',\n value: function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n if (droppedFPS > 0) {\n //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n }, {\n key: 'checkFPSInterval',\n value: function checkFPSInterval() {\n var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],11:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Level Controller\n */\n\nvar LevelController = function (_EventHandler) {\n _inherits(LevelController, _EventHandler);\n\n function LevelController(hls) {\n _classCallCheck(this, LevelController);\n\n var _this = _possibleConstructorReturn(this, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = _this._autoLevelCapping = -1;\n return _this;\n }\n\n _createClass(LevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n this.canload = true;\n var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n this.canload = false;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels0.length;\n level.url = [level.url];\n level.urlId = 0;\n levels0.push(level);\n } else {\n levels0[redundantLevelId].url.push(level.url);\n }\n });\n\n // remove audio-only level if we also have levels with audio+video codecs signalled\n if (videoCodecFound && audioCodecFound) {\n levels0.forEach(function (level) {\n if (level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', videoCodec));\n });\n\n if (levels.length) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort level on bitrate\n levels.sort(function (a, b) {\n return a.bitrate - b.bitrate;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n break;\n }\n }\n hls.trigger(_events2.default.MANIFEST_PARSED, { levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n }\n return;\n }\n }, {\n key: 'setLevelInternal',\n value: function setLevelInternal(newLevel) {\n var levels = this._levels;\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (this._level !== newLevel) {\n _logger.logger.log('switching to level ' + newLevel);\n this._level = newLevel;\n this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n }\n var level = levels[newLevel],\n levelDetails = level.details;\n // check if we need to load playlist for this level\n if (!levelDetails || levelDetails.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n if (data.fatal) {\n return;\n }\n\n var details = data.details,\n hls = this.hls,\n levelId = void 0,\n level = void 0,\n levelError = false,\n abrController = hls.abrController,\n minAutoLevel = abrController.minAutoLevel;\n // try to recover not fatal errors\n switch (details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\n break;\n default:\n break;\n }\n /* try to switch to a redundant stream if any available.\n * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n * otherwise, we cannot recover this network error ...\n */\n if (levelId !== undefined) {\n level = this._levels[levelId];\n if (!level.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n } else {\n // we could try to recover if in auto mode and current level not lowest level (0)\n var recoverable = this._manualLevel === -1 && levelId;\n if (recoverable) {\n _logger.logger.warn('level controller,' + details + ': switch-down for next fragment');\n abrController.nextAutoLevel = Math.max(minAutoLevel, levelId - 1);\n } else if (level && level.details && level.details.live) {\n _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n if (levelError) {\n // reset this._level so that another call to set level() will retrigger a frag load\n this._level = undefined;\n }\n // other errors are handled by stream controller\n } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n var media = hls.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n if (mediaBuffered) {\n var retryDelay = hls.config.levelLoadingRetryDelay;\n _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n this.timer = setTimeout(this.ontick, retryDelay);\n } else {\n _logger.logger.error('cannot recover ' + details + ' error');\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n hls.trigger(_events2.default.ERROR, data);\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n var newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n curDetails = curLevel.details;\n if (curDetails && newDetails.endSN === curDetails.endSN) {\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n _logger.logger.log('same live playlist, reload twice faster');\n }\n // decrement reloadInterval with level loading delay\n reloadInterval -= performance.now() - data.stats.trequest;\n // in any case, don't reload more than every second\n reloadInterval = Math.max(1000, Math.round(reloadInterval));\n _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n this.timer = setTimeout(this.ontick, reloadInterval);\n } else {\n this.timer = null;\n }\n }\n }\n }, {\n key: 'tick',\n value: function tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId],\n urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\n }\n }, {\n key: 'levels',\n get: function get() {\n return this._levels;\n }\n }, {\n key: 'level',\n get: function get() {\n return this._level;\n },\n set: function set(newLevel) {\n var levels = this._levels;\n if (levels && levels.length > newLevel) {\n if (this._level !== newLevel || levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n }\n }, {\n key: 'manualLevel',\n get: function get() {\n return this._manualLevel;\n },\n set: function set(newLevel) {\n this._manualLevel = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: 'firstLevel',\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: 'startLevel',\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n // if not in autostart level, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, this.hls.abrController.minAutoLevel);\n }\n this._startLevel = newLevel;\n }\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.abrController.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45}],12:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_LEVEL: 'WAITING_LEVEL',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar StreamController = function (_EventHandler) {\n _inherits(StreamController, _EventHandler);\n\n function StreamController(hls) {\n _classCallCheck(this, StreamController);\n\n var _this = _possibleConstructorReturn(this, (StreamController.__proto__ || Object.getPrototypeOf(StreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_SWITCHED, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(StreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.levels) {\n var lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.level = -1;\n this.fragLoadError = 0;\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n _logger.logger.warn('cannot start loading as manifest not parsed yet');\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n // when this returns false there was an error and we shall return immediatly\n // from current tick\n if (!this._doTickIdle()) {\n return;\n }\n break;\n case State.WAITING_LEVEL:\n var level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n // check buffer\n this._checkBuffer();\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\n }, {\n key: '_doTickIdle',\n value: function _doTickIdle() {\n var hls = this.hls,\n config = hls.config,\n media = this.media;\n\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return true;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n var pos = void 0;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n var level = hls.nextLoadLevel,\n levelInfo = this.levels[level],\n levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\n // determine next candidate fragment to be loaded, based on current position and end of buffer position\n // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\n var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len;\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return true;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\n // set next load level : this will trigger a playlist load if needed\n this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n this.state = State.WAITING_LEVEL;\n return true;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // if everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference\n // using half frag duration should help cope with these cases.\n // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/dailymotion/hls.js/pull/657\n if (media.duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration / 2)) {\n // Finalize the media stream\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_EOS, data);\n this.state = State.ENDED;\n return true;\n }\n }\n\n // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n return this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n var fragPrevious = this.fragPrevious,\n level = this.level,\n fragments = levelDetails.fragments,\n fragLen = fragments.length;\n\n // empty playlist\n if (fragLen === 0) {\n return false;\n }\n\n // find fragment index, contiguous with end of buffer position\n var start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n bufferEnd = bufferInfo.end,\n frag = void 0;\n\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return false;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return false;\n }\n } else {\n // VoD playlist: if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n }\n }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n return this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return true;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n var config = this.hls.config,\n media = this.media;\n\n var frag = void 0;\n\n // check if requested position is within seekable boundaries :\n //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {\n var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n bufferEnd = liveSyncPosition;\n if (media && media.readyState && media.duration > liveSyncPosition) {\n media.currentTime = liveSyncPosition;\n }\n }\n\n // if end of buffer greater than live edge, don't load any fragment\n // this could happen if live playlist intermittently slides in the past.\n // level 1 loaded [182580161,182580167]\n // level 1 loaded [182580162,182580169]\n // Loading 182580168 of [182580162 ,182580169],level 1 ..\n // Loading 182580169 of [182580162 ,182580169],level 1 ..\n // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n // level 1 loaded [182580164,182580171]\n //\n // don't return null in case media not loaded yet (readystate === 0)\n if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n return null;\n }\n\n if (this.startFragRequested && !levelDetails.PTSKnown) {\n /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n try to load frag matching with next SN.\n even if SN are not synchronized between playlists, loading this frag will help us\n compute playlist sliding and find the right one after in case it was not the right consecutive one */\n if (fragPrevious) {\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n }\n }\n if (!frag) {\n /* we have no idea about which fragment should be loaded.\n so let's load mid fragment. it will help computing playlist sliding and find the right one\n */\n frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n }\n }\n return frag;\n }\n }, {\n key: '_findFragment',\n value: function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n\n var frag = void 0,\n foundFrag = void 0,\n maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS,\n curSNIdx = frag.sn - levelDetails.startSN;\n // if there is a significant delta between audio and video, larger than max allowed hole,\n // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n // let's try to load previous fragment again to get last keyframe\n // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n frag = fragments[curSNIdx - 1];\n _logger.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');\n // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n fragPrevious.loadCounter--;\n } else {\n frag = fragments[curSNIdx + 1];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n var hls = this.hls,\n config = hls.config;\n\n //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return false;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n this.nextLoadPosition = frag.start + frag.duration;\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return true;\n }\n }\n }, {\n key: 'getBufferRange',\n value: function getBufferRange(position) {\n return _binarySearch2.default.search(this.bufferRange, function (range) {\n if (position < range.start) {\n return -1;\n } else if (position > range.end) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferRange',\n value: function followingBufferRange(range) {\n if (range) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferRange(range.end + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var rangeCurrent,\n currentTime,\n video = this.media;\n if (video && video.readyState && video.seeking === false) {\n currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n if (currentTime > video.playbackRate * this.lastCurrentTime) {\n this.lastCurrentTime = currentTime;\n }\n if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n rangeCurrent = this.getBufferRange(currentTime + 0.1);\n }\n if (rangeCurrent) {\n var fragPlaying = rangeCurrent.frag;\n if (fragPlaying !== this.fragPlaying) {\n this.fragPlaying = fragPlaying;\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n }\n }\n }\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */\n\n }, {\n key: 'immediateLevelSwitch',\n value: function immediateLevelSwitch() {\n _logger.logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n var media = this.media,\n previouslyPaused = void 0;\n if (media) {\n previouslyPaused = media.paused;\n media.pause();\n } else {\n // don't restart playback after instant level switch in case media not attached\n previouslyPaused = true;\n }\n this.previouslyPaused = previouslyPaused;\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n - resume the playback if needed\n */\n\n }, {\n key: 'immediateLevelSwitchEnd',\n value: function immediateLevelSwitchEnd() {\n var media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n // only nudge if currentTime is buffered\n media.currentTime -= 0.0001;\n }\n if (!this.previouslyPaused) {\n media.play();\n }\n }\n }\n }, {\n key: 'nextLevelSwitch',\n value: function nextLevelSwitch() {\n /* try to switch ASAP without breaking video playback :\n in order to ensure smooth but quick level switching,\n we need to find the next flushable buffer range\n we should take into account new segment fetch time\n */\n var media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n var fetchdelay = void 0,\n currentRange = void 0,\n nextRange = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n currentRange = this.getBufferRange(media.currentTime);\n if (currentRange && currentRange.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.flushMainBuffer(0, currentRange.start - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,\n nextLevel = this.levels[nextLevelId],\n fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n //logger.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n if (nextRange) {\n // we can flush buffer range following this one without stalling playback\n nextRange = this.followingBufferRange(nextRange);\n if (nextRange) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush position is the start position of this new buffer\n this.flushMainBuffer(nextRange.start, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('seeked', this.onvseeked);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var levels = this.levels;\n if (levels) {\n // reset fragment load counter\n levels.forEach(function (level) {\n if (level.details) {\n level.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('seeked', this.onvseeked);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined,\n config = this.config;\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n if (this.state === State.FRAG_LOADING) {\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole),\n fragCurrent = this.fragCurrent;\n // check if we are seeking to a unbuffered area AND if frag loading is in progress\n if (bufferInfo.len === 0 && fragCurrent) {\n var tolerance = config.maxFragLookUpTolerance,\n fragStartOffset = fragCurrent.start - tolerance,\n fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n if (fragCurrent.loader) {\n _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n } else {\n _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n _logger.logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset buffer on manifest loading\n _logger.logger.log('trigger BUFFER_RESET');\n this.hls.trigger(_events2.default.BUFFER_RESET);\n this.bufferRange = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var aac = false,\n heaac = false,\n codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac;\n if (this.audioCodecSwitch) {\n _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragRequested = false;\n var config = this.config;\n if (config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n this.levelLastLoaded = newLevelId;\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n // override level info\n curLevel.details = newDetails;\n this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n if (this.startFragRequested === false) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = this.computeLivePosition(sliding, newDetails);\n _logger.logger.log('configure startPosition to ' + this.startPosition);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n // reset frag bitrate test in any case after frag loaded event\n this.bitrateTest = false;\n // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n // then this means that we should be able to load a fragment at a higher quality level\n if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = State.IDLE;\n this.startFragRequested = false;\n stats.tparsed = stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = stats;\n var duration = details.totalduration,\n start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec === undefined) {\n audioCodec = this.lastAudioCodec;\n }\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n }\n this.pendingBuffering = true;\n this.appended = false;\n _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n var demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n }\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, null);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n trackName,\n track;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (tracks.audio && this.altAudio) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n var audioCodec = this.levels[this.level].audioCodec,\n ua = navigator.userAgent.toLowerCase();\n if (audioCodec && this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // in case AAC and HE-AAC audio codecs are signalled in manifest\n // force HE-AAC , as it seems that most browsers prefers that way,\n // except for mono streams OR on FF\n // these conditions might need to be reviewed ...\n if (this.audioCodecSwitch) {\n // don't force HE-AAC if mono stream\n if (track.metadata.channelCount !== 1 &&\n // don't force HE-AAC if firefox\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n _logger.logger.log('Android: force audio codec to ' + audioCodec);\n }\n track.levelCodec = audioCodec;\n track.id = data.id;\n }\n track = tracks.video;\n if (track) {\n track.levelCodec = this.levels[this.level].videoCodec;\n track.id = data.id;\n }\n\n // if remuxer specify that a unique track needs to generated,\n // let's merge all tracks together\n if (data.unique) {\n var mergedTrack = {\n codec: '',\n levelCodec: ''\n };\n for (trackName in data.tracks) {\n track = tracks[trackName];\n mergedTrack.container = track.container;\n if (mergedTrack.codec) {\n mergedTrack.codec += ',';\n mergedTrack.levelCodec += ',';\n }\n if (track.codec) {\n mergedTrack.codec += track.codec;\n }\n if (track.levelCodec) {\n mergedTrack.levelCodec += track.levelCodec;\n }\n }\n tracks = { audiovideo: mergedTrack };\n }\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n for (trackName in tracks) {\n track = tracks[trackName];\n _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n\n _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n hls = this.hls;\n hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n }\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent.loader) {\n _logger.logger.log('switching to main audio track, cancel main fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // destroy demuxer to force init segment generation (following audio switch)\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var tracks = data.tracks,\n mediaTrack = void 0,\n name = void 0,\n alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n this.videoBuffer = tracks[type].buffer;\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'main') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n var _this3 = this;\n\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n (function () {\n var media = _this3.mediaBuffer ? _this3.mediaBuffer : _this3.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter potentially evicted bufferRange. this is to avoid memleak on live streams\n var bufferRange = _this3.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n // push new range\n bufferRange.push({ type: frag.type, start: frag.startPTS, end: frag.endPTS, frag: frag });\n // sort, as we use BinarySearch for lookup in getBufferRange ...\n _this3.bufferRange = bufferRange.sort(function (a, b) {\n return a.start - b.start;\n });\n _this3.fragPrevious = frag;\n var stats = _this3.stats;\n stats.tbuffered = performance.now();\n // we should get rid of this.fragLastKbps\n _this3.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n _this3.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n _this3.state = State.IDLE;\n })();\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag || this.fragCurrent;\n // don't handle frag error not related to main fragment\n if (frag && frag.type !== 'main') {\n return;\n }\n var media = this.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n if (!data.fatal) {\n // if buffer is not empty\n if (mediaBuffered) {\n // try to reduce max buffer length : rationale is that we could get\n // frag loop loading error because of buffer eviction\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // buffer empty. report as fatal if in manual mode or if lowest level.\n // level controller takes care of emergency switch down logic\n if (!frag.autoLevel || frag.level === 0) {\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n }\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in cas of non fatal error while waiting level load to be completed, switch back to IDLE\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (this.state === State.PARSING || this.state === State.PARSED) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n // in that case flush the whole buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: '_reduceMaxBufferLength',\n value: function _reduceMaxBufferLength(minLength) {\n var config = this.config;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n }, {\n key: '_checkBuffer',\n value: function _checkBuffer() {\n var media = this.media;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if (media && media.readyState) {\n var currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.buffered;\n // adjust currentTime to start position on loaded metadata\n if (!this.loadedmetadata && buffered.length && !media.seeking) {\n this.loadedmetadata = true;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n var startPosition = this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n _logger.logger.log('target start position:' + startPosition);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if (!startPositionBuffered) {\n startPosition = buffered.start(0);\n _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n }\n _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n expectedPlaying = !(media.paused || // not playing when media is paused\n media.ended || // not playing when media is ended\n media.buffered.length === 0),\n // not playing if nothing buffered\n jumpThreshold = 0.5,\n // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart,\n delta = nextBufferStart - currentTime;\n if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\n }\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoadEmergencyAborted',\n value: function onFragLoadEmergencyAborted() {\n this.state = State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferRange\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this.bufferRange = this.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n }, {\n key: 'computeLivePosition',\n value: function computeLivePosition(sliding, levelDetails) {\n var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('main stream:' + previousState + '->' + nextState);\n this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n }\n },\n get: function get() {\n return this._state;\n }\n }, {\n key: 'currentLevel',\n get: function get() {\n var media = this.media;\n if (media) {\n var range = this.getBufferRange(media.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferRange',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this._liveSyncPosition;\n },\n set: function set(value) {\n this._liveSyncPosition = value;\n }\n }]);\n\n return StreamController;\n}(_eventHandler2.default);\n\nexports.default = StreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],13:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(42);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Timeline Controller\n */\n\nvar TimelineController = function (_EventHandler) {\n _inherits(TimelineController, _EventHandler);\n\n function TimelineController(hls) {\n _classCallCheck(this, TimelineController);\n\n var _this = _possibleConstructorReturn(this, (TimelineController.__proto__ || Object.getPrototypeOf(TimelineController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack1) {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1) {\n self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n self.textTrack1.textTrack1 = true;\n } else {\n self.textTrack1 = existingTrack1;\n self.clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n }\n };\n\n var channel2 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack2) {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2) {\n self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n self.textTrack2.textTrack2 = true;\n } else {\n self.textTrack2 = existingTrack2;\n self.clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n }\n };\n\n _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n }\n return _this;\n }\n\n _createClass(TimelineController, [{\n key: 'clearCurrentCues',\n value: function clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n }\n }, {\n key: 'getExistingTrack',\n value: function getExistingTrack(channelNumber) {\n var media = this.media;\n if (media) {\n for (var i = 0; i < media.textTracks.length; i++) {\n var textTrack = media.textTracks[i];\n var propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n }, {\n key: 'createTextTrack',\n value: function createTextTrack(kind, label, lang) {\n if (this.media) {\n return this.media.addTextTrack(kind, label, lang);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media;\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastPts = Number.NEGATIVE_INFINITY;\n }\n }, {\n key: 'onLevelSwitch',\n value: function onLevelSwitch() {\n if (this.hls.currentLevel.closedCaptions === 'NONE') {\n this.enabled = false;\n } else {\n this.enabled = true;\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n if (data.frag.type === 'main') {\n var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n // if this is a frag for a previously loaded timerange, remove all captions\n // TODO: consider just removing captions for the timerange\n if (pts <= this.lastPts) {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n this.lastPts = pts;\n }\n }\n }, {\n key: 'onFragParsingUserdata',\n value: function onFragParsingUserdata(data) {\n // push all of the CEA-708 messages into the interpreter\n // immediately. It will create the proper timestamps based on our PTS value\n if (this.enabled && this.config.enableCEA708Captions) {\n for (var i = 0; i < data.samples.length; i++) {\n var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n }\n }\n }\n }, {\n key: 'extractCea608Data',\n value: function extractCea608Data(byteArray) {\n var count = byteArray[0] & 31;\n var position = 2;\n var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n var actualCCBytes = [];\n\n for (var j = 0; j < count; j++) {\n tmpByte = byteArray[position++];\n ccbyte1 = 0x7F & byteArray[position++];\n ccbyte2 = 0x7F & byteArray[position++];\n ccValid = (4 & tmpByte) === 0 ? false : true;\n ccType = 3 & tmpByte;\n\n if (ccbyte1 === 0 && ccbyte2 === 0) {\n continue;\n }\n\n if (ccValid) {\n if (ccType === 0) // || ccType === 1\n {\n actualCCBytes.push(ccbyte1);\n actualCCBytes.push(ccbyte2);\n }\n }\n }\n return actualCCBytes;\n }\n }]);\n\n return TimelineController;\n}(_eventHandler2.default);\n\nexports.default = TimelineController;\n\n},{\"27\":27,\"28\":28,\"42\":42}],14:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],15:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n this.subMix = [];\n this.subMix[0] = new Uint32Array(256);\n this.subMix[1] = new Uint32Array(256);\n this.subMix[2] = new Uint32Array(256);\n this.subMix[3] = new Uint32Array(256);\n\n this.invSubMix = [];\n this.invSubMix[0] = new Uint32Array(256);\n this.invSubMix[1] = new Uint32Array(256);\n this.invSubMix[2] = new Uint32Array(256);\n this.invSubMix[3] = new Uint32Array(256);\n\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix0 = this.subMix[0];\n var subMix1 = this.subMix[1];\n var subMix2 = this.subMix[2];\n var subMix3 = this.subMix[3];\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(this.ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(this.ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n\n while (offset < inputInt32.length) {\n inputWords0 = this.networkToHostOrderSwap(inputInt32[offset]);\n inputWords1 = this.networkToHostOrderSwap(inputInt32[offset + 1]);\n inputWords2 = this.networkToHostOrderSwap(inputInt32[offset + 2]);\n inputWords3 = this.networkToHostOrderSwap(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = this.networkToHostOrderSwap(t0 ^ initVector0);\n outputInt32[offset + 1] = this.networkToHostOrderSwap(t3 ^ initVector1);\n outputInt32[offset + 2] = this.networkToHostOrderSwap(t2 ^ initVector2);\n outputInt32[offset + 3] = this.networkToHostOrderSwap(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],16:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _aesCrypto = _dereq_(14);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(17);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(15);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n _logger.logger.log('JS AES decrypt');\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n (function () {\n _logger.logger.log('WebCrypto AES decrypt');\n var subtle = _this.subtle;\n if (_this.key !== key) {\n _this.key = key;\n _this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n _this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n })();\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"14\":14,\"15\":15,\"17\":17,\"26\":26,\"45\":45}],17:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],18:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * AAC demuxer\n */\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(45);\n\nvar _id = _dereq_(24);\n\nvar _id2 = _interopRequireDefault(_id);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AACDemuxer = function () {\n function AACDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n this.insertDiscontinuity();\n }\n\n _createClass(AACDemuxer, [{\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0 };\n }\n }, {\n key: 'push',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var track,\n id3 = new _id2.default(data),\n pts = 90 * id3.timeStamp,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n\n var contiguous = false;\n if (cc !== this.lastCC) {\n _logger.logger.log(this.id + ' discontinuity detected');\n this.lastCC = cc;\n this.insertDiscontinuity();\n this.remuxer.switchLevel();\n this.remuxer.insertDiscontinuity();\n } else if (level !== this.lastLevel) {\n _logger.logger.log('audio track switch detected');\n this.lastLevel = level;\n this.remuxer.switchLevel();\n this.insertDiscontinuity();\n } else if (sn === this.lastSN + 1) {\n contiguous = true;\n }\n track = this._aacTrack;\n this.lastSN = sn;\n this.lastLevel = level;\n\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(level, sn, cc, track, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n // check if data contains ID3 timestamp and ADTS sync worc\n var id3 = new _id2.default(data),\n offset,\n len;\n if (id3.hasTimeStamp) {\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return AACDemuxer;\n}();\n\nexports.default = AACDemuxer;\n\n},{\"19\":19,\"24\":24,\"45\":45}],19:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ADTS parser helper\n */\n\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ADTS = function () {\n function ADTS() {\n _classCallCheck(this, ADTS);\n }\n\n _createClass(ADTS, null, [{\n key: 'getAudioConfig',\n value: function getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType,\n // :int\n adtsSampleingIndex,\n // :int\n adtsExtensionSampleingIndex,\n // :int\n adtsChanelConfig,\n // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n return;\n }\n adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/i.test(userAgent)) {\n if (adtsSampleingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi/Opera ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n config[1] |= (adtsSampleingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChanelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSampleingIndex\n config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };\n }\n }]);\n\n return ADTS;\n}();\n\nexports.default = ADTS;\n\n},{\"26\":26,\"45\":45}],20:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _decrypter = _dereq_(16);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(18);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _tsdemuxer = _dereq_(25);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp4Remuxer = _dereq_(38);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(39);\n\nvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DemuxerInline = function () {\n function DemuxerInline(hls, id, typeSupported) {\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, DemuxerInline);\n\n this.hls = hls;\n this.id = id;\n this.config = this.hls.config || config;\n this.typeSupported = typeSupported;\n }\n\n _createClass(DemuxerInline, [{\n key: 'destroy',\n value: function destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n if (this.decrypter == null) {\n this.decrypter = new _decrypter2.default(this.hls, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n this.decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.hls.trigger(_events2.default.FRAG_DECRYPTED, { level: level, sn: sn, stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n cc !== this.cc && !demuxer.probe(data)) {\n var hls = this.hls,\n id = this.id,\n config = this.config,\n typeSupported = this.typeSupported;\n // probe for content type\n if (_tsdemuxer2.default.probe(data)) {\n if (this.typeSupported.mp2t === true) {\n demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, config, typeSupported);\n } else {\n demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n }\n demuxer.probe = _tsdemuxer2.default.probe;\n } else if (_aacdemuxer2.default.probe(data)) {\n demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n demuxer.probe = _aacdemuxer2.default.probe;\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n this.cc = cc;\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"16\":16,\"18\":18,\"25\":25,\"26\":26,\"28\":28,\"38\":38,\"39\":39}],21:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* demuxer web worker.\n * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n */\n\nvar DemuxerWorker = function DemuxerWorker(self) {\n // observer setup\n var observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({ event: ev, data: data });\n };\n\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n //console.log('demuxer cmd:' + data.cmd);\n switch (data.cmd) {\n case 'init':\n var config = JSON.parse(data.config);\n self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n try {\n (0, _logger.enableLogs)(config.debug === true);\n } catch (err) {\n console.warn('demuxerWorker: unable to enable logs');\n }\n // signal end of worker init\n forwardMessage('init', null);\n break;\n case 'demux':\n self.demuxer.push(data.data, data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.decryptdata, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n observer.on(_events2.default.ERROR, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n var data1 = data.data1.buffer,\n data2 = data.data2.buffer;\n // remove data1 and data2 reference from data to avoid copying them ...\n delete data.data1;\n delete data.data2;\n self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"20\":20,\"28\":28,\"45\":45}],22:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(21);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Demuxer = function () {\n function Demuxer(hls, id) {\n _classCallCheck(this, Demuxer);\n\n this.hls = hls;\n this.id = id;\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\n w = this.w = work(_demuxerWorker2.default);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function (event) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n };\n w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n } catch (err) {\n _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n if (w) {\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(w.objectURL);\n }\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n this.demuxInitialized = true;\n }\n\n _createClass(Demuxer, [{\n key: 'destroy',\n value: function destroy() {\n var w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, decryptdata: decryptdata, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, [data]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS);\n }\n }\n }\n }, {\n key: 'onWorkerMessage',\n value: function onWorkerMessage(ev) {\n var data = ev.data,\n hls = this.hls;\n //console.log('onWorkerMessage:' + data.event);\n switch (data.event) {\n case 'init':\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(this.w.objectURL);\n break;\n // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n case _events2.default.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n data.data.data2 = new Uint8Array(data.data2);\n /* falls through */\n default:\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"20\":20,\"21\":21,\"26\":26,\"28\":28,\"3\":3,\"45\":45}],23:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ExpGolomb = function () {\n function ExpGolomb(data) {\n _classCallCheck(this, ExpGolomb);\n\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n\n\n _createClass(ExpGolomb, [{\n key: 'loadWord',\n value: function loadWord() {\n var data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n\n }, {\n key: 'skipBits',\n value: function skipBits(count) {\n var skipBytes; // :int\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes >> 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n\n }, {\n key: 'readBits',\n value: function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size),\n // :uint\n valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _logger.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n\n }, {\n key: 'skipLZ',\n value: function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n\n }, {\n key: 'skipUEG',\n value: function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n\n }, {\n key: 'skipEG',\n value: function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n\n }, {\n key: 'readUEG',\n value: function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n\n }, {\n key: 'readEG',\n value: function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n\n }, {\n key: 'readBoolean',\n value: function readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n\n }, {\n key: 'readUByte',\n value: function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n\n }, {\n key: 'readUShort',\n value: function readUShort() {\n return this.readBits(16);\n }\n // ():int\n\n }, {\n key: 'readUInt',\n value: function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n }, {\n key: 'skipScalingList',\n value: function skipScalingList(count) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n }, {\n key: 'readSPS',\n value: function readSPS() {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\n };\n }\n }, {\n key: 'readSliceType',\n value: function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;\n\n},{\"45\":45}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ID3 parser\n */\n\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n//import Hex from '../utils/hex';\n\nvar ID3 = function () {\n function ID3(data) {\n _classCallCheck(this, ID3);\n\n this._hasTimeStamp = false;\n var offset = 0,\n byte1,\n byte2,\n byte3,\n byte4,\n tagSize,\n endPos,\n header,\n len;\n do {\n header = this.readUTF(data, offset, 3);\n offset += 3;\n // first check for ID3 header\n if (header === 'ID3') {\n // skip 24 bits\n offset += 3;\n // retrieve tag(s) length\n byte1 = data[offset++] & 0x7f;\n byte2 = data[offset++] & 0x7f;\n byte3 = data[offset++] & 0x7f;\n byte4 = data[offset++] & 0x7f;\n tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n endPos = offset + tagSize;\n //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\n // read ID3 tags\n this._parseID3Frames(data, offset, endPos);\n offset = endPos;\n } else if (header === '3DI') {\n // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n offset += 7;\n _logger.logger.log('3DI footer found, end: ' + offset);\n } else {\n offset -= 3;\n len = offset;\n if (len) {\n //logger.log(`ID3 len: ${len}`);\n if (!this.hasTimeStamp) {\n _logger.logger.warn('ID3 tag found, but no timestamp');\n }\n this._length = len;\n this._payload = data.subarray(0, len);\n }\n return;\n }\n } while (true);\n }\n\n _createClass(ID3, [{\n key: 'readUTF',\n value: function readUTF(data, start, len) {\n\n var result = '',\n offset = start,\n end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while (offset < end);\n return result;\n }\n }, {\n key: '_parseID3Frames',\n value: function _parseID3Frames(data, offset, endPos) {\n var tagId, tagLen, tagStart, tagFlags, timestamp;\n while (offset + 8 <= endPos) {\n tagId = this.readUTF(data, offset, 4);\n offset += 4;\n\n tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\n tagFlags = data[offset++] << 8 + data[offset++];\n\n tagStart = offset;\n //logger.log(\"ID3 tag id:\" + tagId);\n switch (tagId) {\n case 'PRIV':\n //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n offset += 44;\n // smelling even better ! we found the right descriptor\n // skip null character (string end) + 3 first bytes\n offset += 4;\n\n // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n var pts33Bit = data[offset++] & 0x1;\n this._hasTimeStamp = true;\n\n timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: 'hasTimeStamp',\n get: function get() {\n return this._hasTimeStamp;\n }\n }, {\n key: 'timeStamp',\n get: function get() {\n return this._timeStamp;\n }\n }, {\n key: 'length',\n get: function get() {\n return this._length;\n }\n }, {\n key: 'payload',\n get: function get() {\n return this._payload;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\n\n},{\"45\":45}],25:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n// import Hex from '../utils/hex';\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(23);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TSDemuxer = function () {\n function TSDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.typeSupported = typeSupported;\n this.lastCC = 0;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n }\n\n _createClass(TSDemuxer, [{\n key: 'switchLevel',\n value: function switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.remuxer.switchLevel();\n }\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n codecsOnly = this.remuxer.passthrough,\n unknownPIDs = false;\n\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n this.contiguous = false;\n this.accurateTimeOffset = accurateTimeOffset;\n if (cc !== this.lastCC) {\n _logger.logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n }\n if (level !== this.lastLevel) {\n _logger.logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n } else if (sn === this.lastSN + 1) {\n this.contiguous = true;\n }\n this.lastSN = sn;\n\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.pesData,\n id3Data = id3Track.pesData,\n parsePAT = this._parsePAT,\n parsePMT = this._parsePMT,\n parsePES = this._parsePES,\n parseAVCPES = this._parseAVCPES.bind(this),\n parseAACPES = this._parseAACPES.bind(this),\n parseMPEGPES = this._parseMPEGPES.bind(this),\n parseID3PES = this._parseID3PES.bind(this);\n\n // don't parse last TS packet if incomplete\n len -= len % 188;\n // loop through TS packets\n for (start = 0; start < len; start += 188) {\n if (data[start] === 0x47) {\n stt = !!(data[start + 1] & 0x40);\n // pid is a 13-bit field starting at the last bit of TS[1]\n pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n atf = (data[start + 3] & 0x30) >> 4;\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + 188) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, false);\n if (codecsOnly) {\n // if we have video codec info AND\n // if audio PID is undefined OR if we have audio codec info,\n // we have all codec info !\n if (avcTrack.codec && (audioId === -1 || audioTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n avcData = { data: [], size: 0 };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + 188));\n avcData.size += start + 188 - offset;\n }\n break;\n case audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n if (codecsOnly) {\n // here we now that we have audio codec info\n // if video PID is undefined OR if we have video codec info,\n // we have all codec infos !\n if (audioTrack.codec && (avcId === -1 || avcTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.size += start + 188 - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n }\n id3Data = { data: [], size: 0 };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + 188));\n id3Data.size += start + 188 - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n break;\n case pmtId:\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n _logger.logger.log('reparse from beginning');\n unknownPIDs = false;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = -188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n case 17:\n case 0x1fff:\n break;\n default:\n unknownPIDs = true;\n break;\n }\n } else {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n }\n }\n // try to parse last PES packets\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, true);\n avcTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n avcTrack.pesData = avcData;\n }\n\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\n }\n\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n this.remux(level, sn, cc, null, timeOffset, defaultInitPTS);\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, data, timeOffset, defaultInitPTS) {\n var avcTrack = this._avcTrack,\n samples = avcTrack.samples,\n nbNalu = 0,\n naluLen = 0;\n\n // compute total/avc sample length and nb of NAL units\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i],\n units = sample.units.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n }\n avcTrack.len = naluLen;\n avcTrack.nbNalu = nbNalu;\n this.remuxer.remux(level, sn, cc, this._audioTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, defaultInitPTS, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n }, {\n key: '_parsePAT',\n value: function _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n }, {\n key: '_parsePMT',\n value: function _parsePMT(data, offset, mpegSupported) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\n sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n switch (data[offset]) {\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n case 0x0f:\n //logger.log('AAC PID:' + pid);\n if (result.audio === -1) {\n result.audio = pid;\n }\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n case 0x1b:\n //logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n default:\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n }\n return result;\n }\n }, {\n key: '_parsePES',\n value: function _parsePES(stream) {\n var i = 0,\n frag,\n pesFlags,\n pesPrefix,\n pesLen,\n pesHdrLen,\n pesData,\n pesPts,\n pesDts,\n payloadStartOffset,\n data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n //retrieve PTS/DTS from first fragment\n frag = data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen > stream.size - 6) {\n return null;\n }\n pesFlags = frag[7];\n if (pesFlags & 0xC0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n (frag[10] & 0xFF) * 4194304 + // 1 << 22\n (frag[11] & 0xFE) * 16384 + // 1 << 14\n (frag[12] & 0xFF) * 128 + // 1 << 7\n (frag[13] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesPts > 4294967295) {\n // decrement 2^33\n pesPts -= 8589934592;\n }\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n (frag[15] & 0xFF) * 4194304 + // 1 << 22\n (frag[16] & 0xFE) * 16384 + // 1 << 14\n (frag[17] & 0xFF) * 128 + // 1 << 7\n (frag[18] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesDts > 4294967295) {\n // decrement 2^33\n pesDts -= 8589934592;\n }\n if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n payloadStartOffset = pesHdrLen + 9;\n\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n } else {\n return null;\n }\n }\n }, {\n key: 'pushAccesUnit',\n value: function pushAccesUnit(avcSample, avcTrack) {\n if (avcSample.units.units.length && avcSample.frame) {\n // only push AVC sample if starting with a keyframe is not mandatory OR\n // if keyframe already found in this fragment OR\n // keyframe found in last fragment (track.sps) AND\n // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n avcTrack.samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if (avcSample.debug.length) {\n _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n }\n }\n }, {\n key: '_parseAVCPES',\n value: function _parseAVCPES(pes, last) {\n var _this = this;\n\n //logger.log('parse new PES');\n var track = this._avcTrack,\n units = this._parseAVCNALu(pes.data),\n debug = false,\n expGolombDecoder,\n avcSample = this.avcSample,\n push,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(function (unit) {\n switch (unit.type) {\n //NDR\n case 1:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var data = unit.data;\n if (data.length > 4) {\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\n }\n break;\n //IDR\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\n // skip frameType\n expGolombDecoder.readUByte();\n\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n\n while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n payloadType = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadType += b;\n } while (b === 0xFF);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadSize += b;\n } while (b === 0xFF);\n\n // TODO: there can be more than one payload in an SEI packet...\n // TODO: need to read type and size in a while loop to get them all\n if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\n endOfCaptions = true;\n\n var countryCode = expGolombDecoder.readUByte();\n\n if (countryCode === 181) {\n var providerCode = expGolombDecoder.readUShort();\n\n if (providerCode === 49) {\n var userStructure = expGolombDecoder.readUInt();\n\n if (userStructure === 0x47413934) {\n var userDataType = expGolombDecoder.readUByte();\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = expGolombDecoder.readUByte();\n var secondByte = expGolombDecoder.readUByte();\n\n var totalCCs = 31 & firstByte;\n var byteArray = [firstByte, secondByte];\n\n for (i = 0; i < totalCCs; i++) {\n // 3 bytes per CC\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n }\n\n _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n }\n }\n }\n }\n } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n for (i = 0; i < payloadSize; i++) {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n expGolombDecoder = new _expGolomb2.default(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n //PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n if (avcSample) {\n _this.pushAccesUnit(avcSample, track);\n }\n avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = false;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n this.pushAccesUnit(avcSample, track);\n this.avcSample = null;\n }\n }\n }, {\n key: '_createAVCSample',\n value: function _createAVCSample(key, pts, dts, debug) {\n return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n }\n }, {\n key: '_insertSampleInOrder',\n value: function _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len - 1].pts) {\n arr.push(data);\n } else {\n for (var pos = len - 1; pos >= 0; pos--) {\n if (data.pts < arr[pos].pts) {\n arr.splice(pos, 0, data);\n break;\n }\n }\n }\n } else {\n arr.push(data);\n }\n }\n }, {\n key: '_getLastNalUnit',\n value: function _getLastNalUnit() {\n var avcSample = this.avcSample,\n lastUnit = void 0;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.units.length === 0) {\n var track = this._avcTrack,\n samples = track.samples;\n avcSample = samples[samples.length - 1];\n }\n if (avcSample) {\n var units = avcSample.units.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n }, {\n key: '_parseAVCNALu',\n value: function _parseAVCNALu(array) {\n var i = 0,\n len = array.byteLength,\n value,\n overflow,\n track = this._avcTrack,\n state = track.naluState || 0,\n lastState = state;\n var units = [],\n unit,\n unitType,\n lastUnitStart = -1,\n lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -1) {\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n //logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n units.push(unit);\n //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this._getLastNalUnit();\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n }\n\n /**\n * remove Emulation Prevention bytes from a RBSP\n */\n\n }, {\n key: 'discardEPB',\n value: function discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength,\n newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - EPBPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }\n }, {\n key: '_parseAACPES',\n value: function _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n if (aacOverFlow) {\n var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n tmp.set(aacOverFlow, 0);\n tmp.set(data, aacOverFlow.byteLength);\n //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset) {\n var reason, fatal;\n if (offset < len - 1) {\n reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _logger.logger.warn('parsing error:' + reason);\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n var audioCodec = this.audioCodec;\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = this._duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n if (aacOverFlow && aacLastPTS) {\n var newPTS = aacLastPTS + frameDuration;\n if (Math.abs(newPTS - pts) > 1) {\n _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n pts = newPTS;\n }\n }\n\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n if (offset < len) {\n aacOverFlow = data.subarray(offset, len);\n //logger.log(`AAC: overflow detected:${len-offset}`);\n } else {\n aacOverFlow = null;\n }\n this.aacOverFlow = aacOverFlow;\n this.aacLastPTS = stamp;\n }\n }, {\n key: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n var data = pes.data;\n var pts = pes.pts;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var parsed;\n\n while (offset < length && (parsed = this._parseMpeg(data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n }, {\n key: '_onMpegFrame',\n value: function _onMpegFrame(data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 / sampleRate * 1000;\n var stamp = pts + frameIndex * frameDuration;\n var track = this._audioTrack;\n\n track.config = [];\n track.channelCount = channelCount;\n track.audiosamplerate = sampleRate;\n track.duration = this._duration;\n track.samples.push({ unit: data, pts: stamp, dts: stamp });\n track.len += data.length;\n }\n }, {\n key: '_onMpegNoise',\n value: function _onMpegNoise(data) {\n _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n }\n }, {\n key: '_parseMpeg',\n value: function _parseMpeg(data, start, end, frameIndex, pts) {\n var 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];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = data[start + 1] >> 3 & 3;\n var headerC = data[start + 1] >> 1 & 3;\n var headerE = data[start + 2] >> 4 & 15;\n var headerF = data[start + 2] >> 2 & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n if (start + frameLength > end) {\n return -1;\n }\n if (this._onMpegFrame) {\n this._onMpegFrame(data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n }\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n if (this._onMpegNoise) {\n this._onMpegNoise(data.subarray(start, offset - 1));\n }\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n }\n }, {\n key: '_parseID3PES',\n value: function _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n }], [{\n key: 'probe',\n value: function probe(data) {\n // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n return true;\n } else {\n return false;\n }\n }\n }]);\n\n return TSDemuxer;\n}();\n\nexports.default = TSDemuxer;\n\n},{\"19\":19,\"23\":23,\"26\":26,\"28\":28,\"45\":45}],26:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ErrorTypes = exports.ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'networkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'mediaError',\n // Identifier for a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nvar ErrorDetails = exports.ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n MANIFEST_PARSING_ERROR: 'manifestParsingError',\n // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n LEVEL_SWITCH_ERROR: 'levelSwitchError',\n // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n FRAG_LOAD_ERROR: 'fragLoadError',\n // Identifier for fragment loop loading error - data: { frag : fragment object}\n FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n // Identifier for fragment load timeout error - data: { frag : fragment object}\n FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n // Identifier for a fragment decryption error event - data: parsing error description\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a remux alloc error event - data: { id : demuxer Id, bytes : nb of bytes on which allocation failed , reason : error text }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\n // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n KEY_LOAD_ERROR: 'keyLoadError',\n // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n // Identifier for a buffer append error - data: append error description\n BUFFER_APPEND_ERROR: 'bufferAppendError',\n // Identifier for a buffer appending error event - data: appending error description\n BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n // Identifier for a buffer stalled error event\n BUFFER_STALLED_ERROR: 'bufferStalledError',\n // Identifier for a buffer full event\n BUFFER_FULL_ERROR: 'bufferFullError',\n // Identifier for a buffer seek over hole event\n BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException'\n};\n\n},{}],27:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * All objects in the event handling chain should inherit from this class\n *\n */\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventHandler = function () {\n function EventHandler(hls) {\n _classCallCheck(this, EventHandler);\n\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n\n for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n _createClass(EventHandler, [{\n key: 'destroy',\n value: function destroy() {\n this.unregisterListeners();\n }\n }, {\n key: 'isEventHandler',\n value: function isEventHandler() {\n return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n if (event === 'hlsEventGeneric') {\n throw new Error('Forbidden event name: ' + event);\n }\n this.hls.on(event, this.onEvent);\n }.bind(this));\n }\n }\n }, {\n key: 'unregisterListeners',\n value: function unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n this.hls.off(event, this.onEvent);\n }.bind(this));\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n\n }, {\n key: 'onEvent',\n value: function onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n }, {\n key: 'onEventGeneric',\n value: function onEventGeneric(event, data) {\n var eventToFunction = function eventToFunction(event, data) {\n var funcName = 'on' + event.replace('hls', '');\n if (typeof this[funcName] !== 'function') {\n throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n }\n return this[funcName].bind(this, data);\n };\n try {\n eventToFunction.call(this, event, data).call();\n } catch (err) {\n _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n }\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;\n\n},{\"26\":26,\"28\":28,\"45\":45}],28:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = {\n // fired before MediaSource is attaching to media element - data: { media }\n MEDIA_ATTACHING: 'hlsMediaAttaching',\n // fired when MediaSource has been succesfully attached to media element - data: { }\n MEDIA_ATTACHED: 'hlsMediaAttached',\n // fired before detaching MediaSource from media element - data: { }\n MEDIA_DETACHING: 'hlsMediaDetaching',\n // fired when MediaSource has been detached from media element - data: { }\n MEDIA_DETACHED: 'hlsMediaDetached',\n // fired when we buffer is going to be resetted\n BUFFER_RESET: 'hlsBufferReset',\n // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n BUFFER_CODECS: 'hlsBufferCodecs',\n // fired when sourcebuffers have been created data: { tracks : tracks}\n BUFFER_CREATED: 'hlsBufferCreated',\n // fired when we append a segment to the buffer - data: { segment: segment object }\n BUFFER_APPENDING: 'hlsBufferAppending',\n // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING , pending : nb of segments waiting for appending for this segment parent}\n BUFFER_APPENDED: 'hlsBufferAppended',\n // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n BUFFER_EOS: 'hlsBufferEos',\n // fired when the media buffer should be flushed - data {startOffset, endOffset}\n BUFFER_FLUSHING: 'hlsBufferFlushing',\n // fired when the media has been flushed\n BUFFER_FLUSHED: 'hlsBufferFlushed',\n // fired to signal that a manifest loading starts - data: { url : manifestURL}\n MANIFEST_LOADING: 'hlsManifestLoading',\n // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n MANIFEST_LOADED: 'hlsManifestLoaded',\n // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n MANIFEST_PARSED: 'hlsManifestParsed',\n // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n LEVEL_LOADING: 'hlsLevelLoading',\n // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n LEVEL_LOADED: 'hlsLevelLoaded',\n // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n LEVEL_UPDATED: 'hlsLevelUpdated',\n // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n // fired when an audio track switch occurs - data: { id : audio track id} // deprecated\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id}\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id}\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\n // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n // fired when the first timestamp is found. - data: { id : demuxer id, initPTS: initPTS }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\n // fired when a fragment loading starts - data: { frag : fragment object}\n FRAG_LOADING: 'hlsFragLoading',\n // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n FRAG_LOADED: 'hlsFragLoaded',\n // fired when a fragment has finished decrypting - data: { level : levelId, sn : sequence number }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFpsDrop',\n //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n ERROR: 'hlsError',\n // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n // fired when a decrypt key loading starts - data: { frag : fragment object}\n KEY_LOADING: 'hlsKeyLoading',\n // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n KEY_LOADED: 'hlsKeyLoaded',\n // fired upon stream controller state transitions - data: {previousState, nextState}\n STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n};\n\n},{}],29:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * AAC helper\n */\n\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: 'getSilentFrame',\n value: function getSilentFrame(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0:d=0.05\" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 2) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 3) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Buffer Helper class, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = function () {\n function BufferHelper() {\n _classCallCheck(this, BufferHelper);\n }\n\n _createClass(BufferHelper, null, [{\n key: \"isBuffered\",\n value: function isBuffered(media, position) {\n if (media) {\n var buffered = media.buffered;\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n return false;\n }\n }, {\n key: \"bufferInfo\",\n value: function bufferInfo(media, pos, maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered,\n buffered = [],\n i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n } else {\n return { len: 0, start: 0, end: 0, nextStart: undefined };\n }\n }\n }, {\n key: \"bufferedInfo\",\n value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n var buffered2 = [],\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,\n bufferStart,\n bufferEnd,\n bufferStartNext,\n i;\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n var start = buffered2[i].start,\n end = buffered2[i].end;\n //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n }\n }]);\n\n return BufferHelper;\n}();\n\nexports.default = BufferHelper;\n\n},{}],31:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LevelHelper = function () {\n function LevelHelper() {\n _classCallCheck(this, LevelHelper);\n }\n\n _createClass(LevelHelper, null, [{\n key: 'mergeDetails',\n value: function mergeDetails(oldDetails, newDetails) {\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n delta = newDetails.startSN - oldDetails.startSN,\n oldfragments = oldDetails.fragments,\n newfragments = newDetails.fragments,\n ccOffset = 0,\n PTSFrag;\n\n // check if old/new playlists have fragments in common\n if (end < start) {\n newDetails.PTSKnown = false;\n return;\n }\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n for (var i = start; i <= end; i++) {\n var oldFrag = oldfragments[delta + i],\n newFrag = newfragments[i];\n if (newFrag && oldFrag) {\n ccOffset = oldFrag.cc - newFrag.cc;\n if (!isNaN(oldFrag.startPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.duration = oldFrag.duration;\n PTSFrag = newFrag;\n }\n }\n }\n\n if (ccOffset) {\n _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].cc += ccOffset;\n }\n }\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldfragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n if (delta >= 0 && delta < oldfragments.length) {\n // adjust start by sliding offset\n var sliding = oldfragments[delta].start;\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].start += sliding;\n }\n }\n }\n // if we are here, it means we have fragments overlapping between\n // old and new level. reliable PTS info is thus relying on old level\n newDetails.PTSKnown = oldDetails.PTSKnown;\n return;\n }\n }, {\n key: 'updateFragPTSDTS',\n value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\n if (!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(frag.startPTS - startPTS);\n if (isNaN(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n startPTS = Math.min(startPTS, frag.startPTS);\n endPTS = Math.max(endPTS, frag.endPTS);\n startDTS = Math.min(startDTS, frag.startDTS);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n\n var drift = startPTS - frag.start;\n\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n LevelHelper.updatePTS(fragments, i, i - 1);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n LevelHelper.updatePTS(fragments, i, i + 1);\n }\n details.PTSKnown = true;\n //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\n return drift;\n }\n }, {\n key: 'updatePTS',\n value: function updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],\n fragTo = fragments[toIdx],\n fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if (!isNaN(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n if (toIdx > fromIdx) {\n fragFrom.duration = fragToPTS - fragFrom.start;\n if (fragFrom.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n }\n } else {\n fragTo.duration = fragFrom.start - fragToPTS;\n if (fragTo.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n }\n }\n } else {\n // we dont know startPTS[toIdx]\n if (toIdx > fromIdx) {\n fragTo.start = fragFrom.start + fragFrom.duration;\n } else {\n fragTo.start = fragFrom.start - fragTo.duration;\n }\n }\n }\n }]);\n\n return LevelHelper;\n}();\n\nexports.default = LevelHelper;\n\n},{\"45\":45}],32:[function(_dereq_,module,exports){\n/**\n * HLS interface\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n//import FetchLoader from './utils/fetch-loader';\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _playlistLoader = _dereq_(36);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(34);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _abrController = _dereq_(4);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(7);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(8);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _audioStreamController = _dereq_(5);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _streamController = _dereq_(12);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(11);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _timelineController = _dereq_(13);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _audioTrackController = _dereq_(6);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _logger = _dereq_(45);\n\nvar _xhrLoader = _dereq_(47);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _keyLoader = _dereq_(35);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _cues = _dereq_(43);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Hls = function () {\n _createClass(Hls, null, [{\n key: 'isSupported',\n value: function isSupported() {\n window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.6.21';\n }\n }, {\n key: 'Events',\n get: function get() {\n return _events2.default;\n }\n }, {\n key: 'ErrorTypes',\n get: function get() {\n return _errors.ErrorTypes;\n }\n }, {\n key: 'ErrorDetails',\n get: function get() {\n return _errors.ErrorDetails;\n }\n }, {\n key: 'DefaultConfig',\n get: function get() {\n if (!Hls.defaultConfig) {\n Hls.defaultConfig = {\n autoStartLoad: true,\n startPosition: -1,\n defaultAudioCodec: undefined,\n debug: false,\n capLevelOnFPSDrop: false,\n capLevelToPlayerSize: false,\n initialLiveManifestSize: 1,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n maxBufferHole: 0.5,\n maxMaxBufferLength: 600,\n maxSeekHole: 2,\n lowBufferWatchdogPeriod: 0.5,\n highBufferWatchdogPeriod: 3,\n nudgeOffset: 0.1,\n nudgeMaxRetry: 3,\n maxFragLookUpTolerance: 0.2,\n liveSyncDurationCount: 3,\n liveMaxLatencyDurationCount: Infinity,\n liveSyncDuration: undefined,\n liveMaxLatencyDuration: undefined,\n enableWorker: true,\n enableSoftwareAES: true,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n manifestLoadingMaxRetryTimeout: 64000,\n startLevel: undefined,\n levelLoadingTimeOut: 10000,\n levelLoadingMaxRetry: 4,\n levelLoadingRetryDelay: 1000,\n levelLoadingMaxRetryTimeout: 64000,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 1000,\n fragLoadingMaxRetryTimeout: 64000,\n fragLoadingLoopThreshold: 3,\n startFragPrefetch: false,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 3,\n loader: _xhrLoader2.default,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: _abrController2.default,\n bufferController: _bufferController2.default,\n capLevelController: _capLevelController2.default,\n fpsController: _fpsController2.default,\n streamController: _streamController2.default,\n audioStreamController: _audioStreamController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true,\n enableMP2TPassThrough: false,\n stretchShortVideoTrack: false,\n forceKeyFrameOnDiscontinuity: true,\n abrEwmaFastLive: 3,\n abrEwmaSlowLive: 9,\n abrEwmaFastVoD: 3,\n abrEwmaSlowVoD: 9,\n abrEwmaDefaultEstimate: 5e5, // 500 kbps\n abrBandWidthFactor: 0.95,\n abrBandWidthUpFactor: 0.7,\n maxStarvationDelay: 4,\n maxLoadingDelay: 4,\n minAutoBitrate: 0\n };\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Hls);\n\n var defaultConfig = Hls.DefaultConfig;\n\n if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n }\n\n for (var prop in defaultConfig) {\n if (prop in config) {\n continue;\n }\n config[prop] = defaultConfig[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n }\n\n if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n }\n\n (0, _logger.enableLogs)(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n this.playlistLoader = new _playlistLoader2.default(this);\n this.fragmentLoader = new _fragmentLoader2.default(this);\n this.levelController = new _levelController2.default(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new config.bufferController(this);\n this.capLevelController = new config.capLevelController(this);\n this.fpsController = new config.fpsController(this);\n this.streamController = new config.streamController(this);\n this.audioStreamController = new config.audioStreamController(this);\n this.timelineController = new config.timelineController(this);\n this.audioTrackController = new _audioTrackController2.default(this);\n this.keyLoader = new _keyLoader2.default(this);\n }\n\n _createClass(Hls, [{\n key: 'destroy',\n value: function destroy() {\n _logger.logger.log('destroy');\n this.trigger(_events2.default.DESTROYING);\n this.detachMedia();\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.abrController.destroy();\n this.bufferController.destroy();\n this.capLevelController.destroy();\n this.fpsController.destroy();\n this.streamController.destroy();\n this.audioStreamController.destroy();\n this.timelineController.destroy();\n this.audioTrackController.destroy();\n this.keyLoader.destroy();\n this.url = null;\n this.observer.removeAllListeners();\n }\n }, {\n key: 'attachMedia',\n value: function attachMedia(media) {\n _logger.logger.log('attachMedia');\n this.media = media;\n this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n }\n }, {\n key: 'detachMedia',\n value: function detachMedia() {\n _logger.logger.log('detachMedia');\n this.trigger(_events2.default.MEDIA_DETACHING);\n this.media = null;\n }\n }, {\n key: 'loadSource',\n value: function loadSource(url) {\n _logger.logger.log('loadSource:' + url);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.levelController.startLoad();\n this.streamController.startLoad(startPosition);\n this.audioStreamController.startLoad(startPosition);\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.levelController.stopLoad();\n this.streamController.stopLoad();\n this.audioStreamController.stopLoad();\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n _logger.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n }, {\n key: 'recoverMediaError',\n value: function recoverMediaError() {\n _logger.logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n\n }, {\n key: 'levels',\n get: function get() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n\n }, {\n key: 'currentLevel',\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set currentLevel:' + newLevel);\n this.loadLevel = newLevel;\n this.streamController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n\n }, {\n key: 'nextLevel',\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set nextLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n\n }, {\n key: 'loadLevel',\n get: function get() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set loadLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n ,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n\n }, {\n key: 'firstLevel',\n get: function get() {\n return Math.max(this.levelController.firstLevel, this.abrController.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set firstLevel:' + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /** Return start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n\n }, {\n key: 'startLevel',\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /** set start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set startLevel:' + newLevel);\n this.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set autoLevelCapping:' + newLevel);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n\n }, {\n key: 'autoLevelEnabled',\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /* return manual level */\n\n }, {\n key: 'manualLevel',\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.audioTrackController.audioTracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.audioTrackController.audioTrack;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n this.audioTrackController.audioTrack = audioTrackId;\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"26\":26,\"28\":28,\"34\":34,\"35\":35,\"36\":36,\"4\":4,\"43\":43,\"45\":45,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"8\":8}],33:[function(_dereq_,module,exports){\n'use strict';\n\n// This is mostly for support of the es6 module export\n// syntax with the babel compiler, it looks like it doesnt support\n// function exports like we are used to in node/commonjs\nmodule.exports = _dereq_(32).default;\n\n},{\"32\":32}],34:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Fragment Loader\n */\n\nvar FragmentLoader = function (_EventHandler) {\n _inherits(FragmentLoader, _EventHandler);\n\n function FragmentLoader(hls) {\n _classCallCheck(this, FragmentLoader);\n\n var _this = _possibleConstructorReturn(this, (FragmentLoader.__proto__ || Object.getPrototypeOf(FragmentLoader)).call(this, hls, _events2.default.FRAG_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(FragmentLoader, [{\n key: 'destroy',\n value: function destroy() {\n var loaders = this.loaders;\n for (var loaderName in loaders) {\n var loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n config = this.hls.config;\n\n frag.loaded = 0;\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n var start = frag.byteRangeStartOffset,\n end = frag.byteRangeEndOffset;\n if (!isNaN(start) && !isNaN(end)) {\n loaderContext.rangeStart = start;\n loaderContext.rangeEnd = end;\n }\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n loader.load(loaderContext, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var payload = response.data,\n frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n // jshint ignore:line\n var frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],35:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Decrypt key Loader\n */\n\nvar KeyLoader = function (_EventHandler) {\n _inherits(KeyLoader, _EventHandler);\n\n function KeyLoader(hls) {\n _classCallCheck(this, KeyLoader);\n\n var _this = _possibleConstructorReturn(this, (KeyLoader.__proto__ || Object.getPrototypeOf(KeyLoader)).call(this, hls, _events2.default.KEY_LOADING));\n\n _this.loaders = {};\n _this.decryptkey = null;\n _this.decrypturl = null;\n return _this;\n }\n\n _createClass(KeyLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onKeyLoading',\n value: function onKeyLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n decryptdata = frag.decryptdata,\n uri = decryptdata.uri;\n // if uri is different from previous one or if decrypt key not retrieved yet\n if (uri !== this.decrypturl || this.decryptkey === null) {\n var config = this.hls.config;\n\n if (loader) {\n _logger.logger.warn('abort previous key loader for type:' + type);\n loader.abort();\n }\n frag.loader = this.loaders[type] = new config.loader(config);\n this.decrypturl = uri;\n this.decryptkey = null;\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n } else if (this.decryptkey) {\n // we already loaded this key, return it\n decryptdata.key = this.decryptkey;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var frag = context.frag;\n this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n }\n }]);\n\n return KeyLoader;\n}(_eventHandler2.default);\n\nexports.default = KeyLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],36:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _attrList = _dereq_(40);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nvar LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri);\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n value: function createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n\n return uint8View;\n }\n\n /**\n * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n * @param levelkey - a playlist's encryption info\n * @param segmentNumber - the fragment's segment number\n * @returns {*} - an object to be applied as a fragment's decryptdata\n */\n\n }, {\n key: 'fragmentDecryptdataFromLevelkey',\n value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl);\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\n}();\n\nvar PlaylistLoader = function (_EventHandler) {\n _inherits(PlaylistLoader, _EventHandler);\n\n function PlaylistLoader(hls) {\n _classCallCheck(this, PlaylistLoader);\n\n var _this = _possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(PlaylistLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading(data) {\n this.load(data.url, { type: 'manifest' });\n }\n }, {\n key: 'onLevelLoading',\n value: function onLevelLoading(data) {\n this.load(data.url, { type: 'level', level: data.level, id: data.id });\n }\n }, {\n key: 'onAudioTrackLoading',\n value: function onAudioTrackLoading(data) {\n this.load(data.url, { type: 'audioTrack', id: data.id });\n }\n }, {\n key: 'load',\n value: function load(url, context) {\n var loader = this.loaders[context.type];\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n _logger.logger.trace('playlist request ongoing');\n return;\n } else {\n _logger.logger.warn('abort previous loader for type:' + context.type);\n loader.abort();\n }\n }\n var config = this.hls.config,\n retry = void 0,\n timeout = void 0,\n retryDelay = void 0,\n maxRetryDelay = void 0;\n if (context.type === 'manifest') {\n retry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeout;\n } else {\n retry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeout;\n _logger.logger.log('loading playlist for ' + context.type + ' ' + (context.level || context.id));\n }\n loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n context.url = url;\n context.responseType = '';\n\n var loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n loader.load(context, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'resolve',\n value: function resolve(url, baseUrl) {\n return _urlToolkit2.default.buildAbsoluteURL(baseUrl, url);\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {\n var level = {};\n\n var attrs = level.attrs = new _attrList2.default(result[1]);\n level.url = this.resolve(result[2], baseurl);\n\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n level.name = attrs.NAME;\n\n var codecs = attrs.CODECS;\n if (codecs) {\n codecs = codecs.split(/[ ,]+/);\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n }, {\n key: 'parseMasterPlaylistMedia',\n value: function parseMasterPlaylistMedia(string, baseurl, type) {\n var result = void 0,\n medias = [];\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null) {\n var media = {};\n var attrs = new _attrList2.default(result[1]);\n if (attrs.TYPE === type) {\n media.groupId = attrs['GROUP-ID'];\n media.name = attrs.NAME;\n media.type = type;\n media.default = attrs.DEFAULT === 'YES';\n media.autoselect = attrs.AUTOSELECT === 'YES';\n media.forced = attrs.FORCED === 'YES';\n if (attrs.URI) {\n media.url = this.resolve(attrs.URI, baseurl);\n }\n media.lang = attrs.LANGUAGE;\n if (!media.name) {\n media.name = media.lang;\n }\n medias.push(media);\n }\n }\n return medias;\n }\n }, {\n key: 'avc1toavcoti',\n value: function avc1toavcoti(codec) {\n var result,\n avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n }, {\n key: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new _attrList2.default(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if (decrypturi && decryptmethod === 'AES-128') {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\n var startAttrs = new _attrList2.default(startParams);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if (!isNaN(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\n level.fragments.pop();\n totalduration -= frag.duration;\n }\n level.totalduration = totalduration;\n level.averagetargetduration = totalduration / level.fragments.length;\n level.endSN = currentSN - 1;\n return level;\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var string = response.data,\n url = response.url,\n type = context.type,\n id = context.id,\n level = context.level,\n hls = this.hls;\n\n this.loaders[type] = undefined;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n stats.tload = performance.now();\n //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n var isLevel = type !== 'audioTrack',\n levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' });\n }\n } else {\n var levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n if (audiotracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = false;\n audiotracks.forEach(function (audioTrack) {\n if (!audioTrack.url) {\n embeddedAudioFound = true;\n }\n });\n // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audiotracks.unshift({ type: 'main', name: 'main' });\n }\n }\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n }\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"2\":2,\"26\":26,\"27\":27,\"28\":28,\"40\":40,\"45\":45}],37:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n var videoHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': videoHdlr,\n 'audio': audioHdlr\n };\n\n var dref = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\n MP4.STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00]);\n MP4.VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n }\n }, {\n key: 'box',\n value: function box(type) {\n var payload = Array.prototype.slice.call(arguments, 1),\n size = 8,\n i = payload.length,\n len = i,\n result;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n }, {\n key: 'hdlr',\n value: function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }, {\n key: 'mdhd',\n value: function mdhd(timescale, duration) {\n duration *= timescale;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]));\n }\n }, {\n key: 'mdia',\n value: function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n }\n }, {\n key: 'minf',\n value: function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n }\n }, {\n key: 'moof',\n value: function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */\n\n }, {\n key: 'moov',\n value: function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n }\n }, {\n key: 'mvex',\n value: function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n }\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n duration *= timescale;\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return MP4.box(MP4.types.mvhd, bytes);\n }\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n }, {\n key: 'stbl',\n value: function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n }\n }, {\n key: 'avc1',\n value: function avc1(track) {\n var sps = [],\n pps = [],\n i,\n data,\n len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xFF);\n sps.push(len & 0xFF);\n sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xFF);\n pps.push(len & 0xFF);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n sps[3], // profile\n sps[4], // profile compat\n sps[5], // level\n 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))),\n // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n width >> 8 & 0xFF, width & 0xff, // width\n height >> 8 & 0xFF, height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\n }\n }, {\n key: 'esds',\n value: function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17 + configlen, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f + configlen, // length\n 0x40, //codec : mpeg4_audio\n 0x15, // stream_type\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n }, {\n key: 'mp4a',\n value: function mp4a(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n }\n }, {\n key: 'tkhd',\n value: function tkhd(track) {\n var id = track.id,\n duration = track.duration * track.timescale,\n width = track.width,\n height = track.height;\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x00, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n ]));\n }\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id;\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n 16 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8), // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n }, {\n key: 'trak',\n value: function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n }, {\n key: 'trex',\n value: function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n }\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [],\n len = samples.length,\n arraylen = 12 + 16 * len,\n array = new Uint8Array(arraylen),\n i,\n sample,\n duration,\n size,\n flags,\n cts;\n offset += 8 + arraylen;\n array.set([0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n }, {\n key: 'initSegment',\n value: function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks),\n result;\n result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n }\n }]);\n\n return MP4;\n}();\n\nexports.default = MP4;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * fMP4 remuxer\n */\n\nvar _aac = _dereq_(29);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _mp4Generator = _dereq_(37);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, id, config, typeSupported) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.id = id;\n this.config = config;\n this.typeSupported = typeSupported;\n this.ISGenerated = false;\n this.PES2MP4SCALEFACTOR = 4;\n this.PES_TIMESCALE = 90000;\n this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._initPTS = this._initDTS = undefined;\n }\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS) {\n this.level = level;\n this.sn = sn;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset, cc);\n }\n\n if (defaultInitPTS !== null) {\n this._initPTS = this._initDTS = defaultInitPTS;\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n var audioTrackLength = void 0;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n }\n } else {\n var videoData = void 0;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n }\n if (videoData && audioTrack.codec) {\n this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n }\n }\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (id3Track.samples.length) {\n this.remuxID3(id3Track, timeOffset);\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (textTrack.samples.length) {\n this.remuxText(textTrack, timeOffset);\n }\n //notify end of parsing\n this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n }\n }, {\n key: 'generateIS',\n value: function generateIS(audioTrack, videoTrack, timeOffset, cc) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n pesTimeScale = this.PES_TIMESCALE,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n computePTSDTS = this._initPTS === undefined,\n initPTS,\n initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n audioTrack.timescale = audioTrack.audiosamplerate;\n // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n // we know that each AAC sample contains 1024 frames....\n // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n (function () {\n var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n if (!b) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n };\n audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, audioTrack.isAAC ? 1024 : 1152);\n })();\n }\n _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _mp4Generator2.default.initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n videoTrack.timescale = this.MP4_TIMESCALE;\n tracks.video = {\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { id: this.id, initPTS: initPTS, cc: cc });\n }\n }\n\n if (Object.keys(tracks).length) {\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n } else {\n observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n }\n }\n }, {\n key: 'remuxVideo',\n value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var offset = 8,\n pesTimeScale = this.PES_TIMESCALE,\n pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.units.units;\n // let unitsString = '';\n // for (let j = 0; j < units.length ; j++) {\n // unitsString += units[j].type + ',';\n // if (units[j].data.length < 500) {\n // unitsString += Hex.hexDump(units[j].data);\n // }\n // }\n // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n // }\n\n // sort video samples by DTS then PTS order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n return deltadts ? deltadts : a.pts - b.pts;\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n }, 0);\n if (PTSDTSshift < 0) {\n _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n for (var i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n var nextAvcDts = void 0;\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n nextAvcDts = this.nextAvcDts;\n } else {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * pesTimeScale;\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n firstPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = Math.round((firstDTS - nextAvcDts) / 90);\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n if (delta) {\n if (delta > 1) {\n _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n } else if (delta < -1) {\n _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n }\n // remove hole/gap : set DTS to next expected DTS\n firstDTS = nextAvcDts;\n inputSamples[0].dts = firstDTS + initDTS;\n // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n inputSamples[0].pts = firstPTS + initDTS;\n _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n }\n }\n nextDTS = firstDTS;\n\n // compute lastPTS/lastDTS\n sample = inputSamples[inputSamples.length - 1];\n lastDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(lastPTS, lastDTS);\n\n var vendor = navigator.vendor,\n userAgent = navigator.userAgent,\n isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\n // on Safari let's signal the same sample duration for all samples\n // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n if (isSafari) {\n mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n }\n\n // normalize all PTS/DTS now ...\n for (var _i = 0; _i < nbSamples; _i++) {\n var _sample = inputSamples[_i];\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(ptsNormalize(_sample.dts - initDTS, nextAvcDts), firstDTS);\n // ensure dts is a multiple of scale factor to avoid rounding issues\n _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n // and we ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(ptsNormalize(_sample.pts - initDTS, nextAvcDts), _sample.dts);\n // ensure pts is a multiple of scale factor to avoid rounding issues\n _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n var mdatSize = track.len + 4 * track.nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var j = 0, nbUnits = avcSampleUnits.length; j < nbUnits; j++) {\n var unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n } else {\n var config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n if (config.stretchShortVideoTrack) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAudioPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n }\n _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n mp4SampleDuration /= pes2mp4ScaleFactor;\n compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n outputSamples.push({\n size: mp4SampleLength,\n // constant duration\n duration: mp4SampleDuration,\n cts: compositionTimeOffset,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: avcSample.key ? 2 : 1,\n isNonSync: avcSample.key ? 0 : 1\n }\n });\n }\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n var dropped = track.dropped;\n track.len = 0;\n track.nbNalu = 0;\n track.dropped = 0;\n if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var flags = outputSamples[0].flags;\n // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n track.samples = outputSamples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n\n var data = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: this.nextAvcDts / pesTimeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped: dropped\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n return data;\n }\n }, {\n key: 'remuxAudio',\n value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n expectedSampleDuration = track.timescale * (track.isAAC ? 1024 : 1152) / track.audiosamplerate,\n pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var view,\n offset = rawMPEG ? 0 : 8,\n audioSample,\n mp4Sample,\n unit,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n lastDTS,\n pts,\n dts,\n ptsnorm,\n dtsnorm,\n outputSamples = [],\n inputSamples = [],\n fillFrame,\n newStamp,\n nextAudioPts;\n\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n inputSamples = track.samples;\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset and next expected PTS OR\n // - less than 20 audio frames distance\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\n nextAudioPts = this.nextAudioPts;\n contiguous |= inputSamples.length && nextAudioPts && (Math.abs(timeOffset - nextAudioPts / pesTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - this._initDTS) < 20 * pesFrameDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * pesTimeScale;\n }\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPtsNorm = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n ptsNorm = ptsNormalize(sample.pts - initDTS, nextAudioPts),\n delta = ptsNorm - nextPtsNorm;\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -pesFrameDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n // also only inject silent audio frames if currentTime !== 0 (nextPtsNorm !== 0)\n else if (delta >= pesFrameDuration && nextPtsNorm) {\n var missing = Math.round(delta / pesFrameDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n newStamp = nextPtsNorm + initDTS;\n newStamp = Math.max(newStamp, initDTS);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPtsNorm + initDTS;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n // Otherwise, we're within half a frame duration, so just adjust pts\n else {\n if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n }\n nextPtsNorm += pesFrameDuration;\n if (i === 0) {\n sample.pts = sample.dts = initDTS + nextAudioPts;\n } else {\n sample.pts = sample.dts = inputSamples[i - 1].pts + pesFrameDuration;\n }\n i += 1;\n }\n }\n }\n\n for (var _j = 0, _nbSamples = inputSamples.length; _j < _nbSamples; _j++) {\n audioSample = inputSamples[_j];\n unit = audioSample.unit;\n pts = audioSample.pts - initDTS;\n dts = audioSample.dts - initDTS;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastDTS !== undefined) {\n ptsnorm = ptsNormalize(pts, lastDTS);\n dtsnorm = ptsNormalize(dts, lastDTS);\n mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n } else {\n ptsnorm = ptsNormalize(pts, nextAudioPts);\n dtsnorm = ptsNormalize(dts, nextAudioPts);\n var _delta = Math.round(1000 * (ptsnorm - nextAudioPts) / pesTimeScale),\n numMissingFrames = 0;\n // if fragment are contiguous, detect hole/overlapping between fragments\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0) {\n numMissingFrames = Math.round((ptsnorm - nextAudioPts) / pesFrameDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\n }\n track.len += numMissingFrames * fillFrame.length;\n }\n // if we have frame overlap, overlapping for more than half a frame duraion\n } else if (_delta < -12) {\n // drop overlapping audio frames... browser will deal with it\n _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n ptsnorm = dtsnorm = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, ptsnorm);\n firstDTS = Math.max(0, dtsnorm);\n if (track.len > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n\n var mdatSize = rawMPEG ? track.len : track.len + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });\n return;\n }\n if (!rawMPEG) {\n view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\n }\n mdat.set(fillFrame, offset);\n offset += fillFrame.byteLength;\n mp4Sample = {\n size: fillFrame.byteLength,\n cts: 0,\n duration: 1024,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\n cts: 0,\n duration: 0,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n lastDTS = dtsnorm;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n }\n track.samples = [];\n var audioData = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: this.nextAudioPts / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n }, {\n key: 'remuxEmptyAudio',\n value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * pesTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n\n // silent frame\n silentFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({ unit: silentFrame, pts: stamp, dts: stamp });\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n }, {\n key: 'remuxID3',\n value: function remuxID3(track, timeOffset) {\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: 'remuxText',\n value: function remuxText(track, timeOffset) {\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: '_PTSNormalize',\n value: function _PTSNormalize(value, reference) {\n var offset;\n if (reference === undefined) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return false;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"26\":26,\"28\":28,\"29\":29,\"37\":37,\"45\":45}],39:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * passthrough remuxer\n */\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PassThroughRemuxer = function () {\n function PassThroughRemuxer(observer, id) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n this.id = id;\n this.ISGenerated = false;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {}\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n var observer = this.observer;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n var tracks = {},\n data = { id: this.id, tracks: tracks, unique: true },\n track = videoTrack,\n codec = track.codec;\n\n if (codec) {\n data.tracks.video = {\n container: track.container,\n codec: codec,\n metadata: {\n width: track.width,\n height: track.height\n }\n };\n }\n\n track = audioTrack;\n codec = track.codec;\n if (codec) {\n data.tracks.audio = {\n container: track.container,\n codec: codec,\n metadata: {\n channelCount: track.channelCount\n }\n };\n }\n this.ISGenerated = true;\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n id: this.id,\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: 'audiovideo',\n nb: 1,\n dropped: 0\n });\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return true;\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"28\":28}],40:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\nvar AttrList = function () {\n function AttrList(attrs) {\n _classCallCheck(this, AttrList);\n\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n\n _createClass(AttrList, [{\n key: 'decimalInteger',\n value: function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'hexadecimalInteger',\n value: function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: 'hexadecimalIntegerAsNumber',\n value: function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'decimalFloatingPoint',\n value: function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n }, {\n key: 'enumeratedString',\n value: function enumeratedString(attrName) {\n return this[attrName];\n }\n }, {\n key: 'decimalResolution',\n value: function decimalResolution(attrName) {\n var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n }\n }], [{\n key: 'parseAttrList',\n value: function parseAttrList(input) {\n var match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2],\n quote = '\"';\n\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n }\n }]);\n\n return AttrList;\n}();\n\nexports.default = AttrList;\n\n},{}],41:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array} list The array to search.\n * @param {Function} comparisonFunction\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {*} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFunction) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n\n var comparisonResult = comparisonFunction(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n\n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n},{}],42:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n * This code was ported from the dash.js project at:\n * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n *\n * The original copyright appears below:\n *\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2015-2016, DASH Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * 2. Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n */\n\nvar specialCea608CharsCodes = {\n 0x2a: 0xe1, // lowercase a, acute accent\n 0x5c: 0xe9, // lowercase e, acute accent\n 0x5e: 0xed, // lowercase i, acute accent\n 0x5f: 0xf3, // lowercase o, acute accent\n 0x60: 0xfa, // lowercase u, acute accent\n 0x7b: 0xe7, // lowercase c with cedilla\n 0x7c: 0xf7, // division symbol\n 0x7d: 0xd1, // uppercase N tilde\n 0x7e: 0xf1, // lowercase n tilde\n 0x7f: 0x2588, // Full block\n // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n 0x80: 0xae, // Registered symbol (R)\n 0x81: 0xb0, // degree sign\n 0x82: 0xbd, // 1/2 symbol\n 0x83: 0xbf, // Inverted (open) question mark\n 0x84: 0x2122, // Trademark symbol (TM)\n 0x85: 0xa2, // Cents symbol\n 0x86: 0xa3, // Pounds sterling\n 0x87: 0x266a, // Music 8'th note\n 0x88: 0xe0, // lowercase a, grave accent\n 0x89: 0x20, // transparent space (regular)\n 0x8a: 0xe8, // lowercase e, grave accent\n 0x8b: 0xe2, // lowercase a, circumflex accent\n 0x8c: 0xea, // lowercase e, circumflex accent\n 0x8d: 0xee, // lowercase i, circumflex accent\n 0x8e: 0xf4, // lowercase o, circumflex accent\n 0x8f: 0xfb, // lowercase u, circumflex accent\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n 0x90: 0xc1, // capital letter A with acute\n 0x91: 0xc9, // capital letter E with acute\n 0x92: 0xd3, // capital letter O with acute\n 0x93: 0xda, // capital letter U with acute\n 0x94: 0xdc, // capital letter U with diaresis\n 0x95: 0xfc, // lowercase letter U with diaeresis\n 0x96: 0x2018, // opening single quote\n 0x97: 0xa1, // inverted exclamation mark\n 0x98: 0x2a, // asterisk\n 0x99: 0x2019, // closing single quote\n 0x9a: 0x2501, // box drawings heavy horizontal\n 0x9b: 0xa9, // copyright sign\n 0x9c: 0x2120, // Service mark\n 0x9d: 0x2022, // (round) bullet\n 0x9e: 0x201c, // Left double quotation mark\n 0x9f: 0x201d, // Right double quotation mark\n 0xa0: 0xc0, // uppercase A, grave accent\n 0xa1: 0xc2, // uppercase A, circumflex\n 0xa2: 0xc7, // uppercase C with cedilla\n 0xa3: 0xc8, // uppercase E, grave accent\n 0xa4: 0xca, // uppercase E, circumflex\n 0xa5: 0xcb, // capital letter E with diaresis\n 0xa6: 0xeb, // lowercase letter e with diaresis\n 0xa7: 0xce, // uppercase I, circumflex\n 0xa8: 0xcf, // uppercase I, with diaresis\n 0xa9: 0xef, // lowercase i, with diaresis\n 0xaa: 0xd4, // uppercase O, circumflex\n 0xab: 0xd9, // uppercase U, grave accent\n 0xac: 0xf9, // lowercase u, grave accent\n 0xad: 0xdb, // uppercase U, circumflex\n 0xae: 0xab, // left-pointing double angle quotation mark\n 0xaf: 0xbb, // right-pointing double angle quotation mark\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n 0xb0: 0xc3, // Uppercase A, tilde\n 0xb1: 0xe3, // Lowercase a, tilde\n 0xb2: 0xcd, // Uppercase I, acute accent\n 0xb3: 0xcc, // Uppercase I, grave accent\n 0xb4: 0xec, // Lowercase i, grave accent\n 0xb5: 0xd2, // Uppercase O, grave accent\n 0xb6: 0xf2, // Lowercase o, grave accent\n 0xb7: 0xd5, // Uppercase O, tilde\n 0xb8: 0xf5, // Lowercase o, tilde\n 0xb9: 0x7b, // Open curly brace\n 0xba: 0x7d, // Closing curly brace\n 0xbb: 0x5c, // Backslash\n 0xbc: 0x5e, // Caret\n 0xbd: 0x5f, // Underscore\n 0xbe: 0x7c, // Pipe (vertical line)\n 0xbf: 0x223c, // Tilde operator\n 0xc0: 0xc4, // Uppercase A, umlaut\n 0xc1: 0xe4, // Lowercase A, umlaut\n 0xc2: 0xd6, // Uppercase O, umlaut\n 0xc3: 0xf6, // Lowercase o, umlaut\n 0xc4: 0xdf, // Esszett (sharp S)\n 0xc5: 0xa5, // Yen symbol\n 0xc6: 0xa4, // Generic currency sign\n 0xc7: 0x2503, // Box drawings heavy vertical\n 0xc8: 0xc5, // Uppercase A, ring\n 0xc9: 0xe5, // Lowercase A, ring\n 0xca: 0xd8, // Uppercase O, stroke\n 0xcb: 0xf8, // Lowercase o, strok\n 0xcc: 0x250f, // Box drawings heavy down and right\n 0xcd: 0x2513, // Box drawings heavy down and left\n 0xce: 0x2517, // Box drawings heavy up and right\n 0xcf: 0x251b // Box drawings heavy up and left\n};\n\n/**\n * Utils\n */\nvar getCharForByte = function getCharForByte(byte) {\n var charCode = byte;\n if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n charCode = specialCea608CharsCodes[byte];\n }\n return String.fromCharCode(charCode);\n};\n\nvar NR_ROWS = 15,\n NR_COLS = 32;\n// Tables to look up row from PAC data\nvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\nvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\nvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\nvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\nvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\n/**\n * Simple logger class to be able to write with time-stamps and filter on level.\n */\nvar logger = {\n verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n time: null,\n verboseLevel: 0, // Only write errors\n setTime: function setTime(newTime) {\n this.time = newTime;\n },\n log: function log(severity, msg) {\n var minLevel = this.verboseFilter[severity];\n if (this.verboseLevel >= minLevel) {\n console.log(this.time + ' [' + severity + '] ' + msg);\n }\n }\n};\n\nvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n var hexArray = [];\n for (var j = 0; j < numArray.length; j++) {\n hexArray.push(numArray[j].toString(16));\n }\n return hexArray;\n};\n\nvar PenState = function () {\n function PenState(foreground, underline, italics, background, flash) {\n _classCallCheck(this, PenState);\n\n this.foreground = foreground || 'white';\n this.underline = underline || false;\n this.italics = italics || false;\n this.background = background || 'black';\n this.flash = flash || false;\n }\n\n _createClass(PenState, [{\n key: 'reset',\n value: function reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n }, {\n key: 'setStyles',\n value: function setStyles(styles) {\n var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n for (var i = 0; i < attribs.length; i++) {\n var style = attribs[i];\n if (styles.hasOwnProperty(style)) {\n this[style] = styles[style];\n }\n }\n }\n }, {\n key: 'isDefault',\n value: function isDefault() {\n return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n }\n }, {\n key: 'copy',\n value: function copy(newPenState) {\n this.foreground = newPenState.foreground;\n this.underline = newPenState.underline;\n this.italics = newPenState.italics;\n this.background = newPenState.background;\n this.flash = newPenState.flash;\n }\n }, {\n key: 'toString',\n value: function toString() {\n return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n }\n }]);\n\n return PenState;\n}();\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\n\n\nvar StyledUnicodeChar = function () {\n function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n _classCallCheck(this, StyledUnicodeChar);\n\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline, italics, background, flash);\n }\n\n _createClass(StyledUnicodeChar, [{\n key: 'reset',\n value: function reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n }, {\n key: 'setChar',\n value: function setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n }, {\n key: 'setPenState',\n value: function setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n }, {\n key: 'copy',\n value: function copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n }]);\n\n return StyledUnicodeChar;\n}();\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\n\n\nvar Row = function () {\n function Row() {\n _classCallCheck(this, Row);\n\n this.chars = [];\n for (var i = 0; i < NR_COLS; i++) {\n this.chars.push(new StyledUnicodeChar());\n }\n this.pos = 0;\n this.currPenState = new PenState();\n }\n\n _createClass(Row, [{\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].equals(other.chars[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_COLS; i++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n\n /**\n * Set the cursor to a valid column.\n */\n\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n if (this.pos !== absPos) {\n this.pos = absPos;\n }\n if (this.pos < 0) {\n logger.log('ERROR', 'Negative cursor position ' + this.pos);\n this.pos = 0;\n } else if (this.pos > NR_COLS) {\n logger.log('ERROR', 'Too large cursor position ' + this.pos);\n this.pos = NR_COLS;\n }\n }\n\n /**\n * Move the cursor relative to current position.\n */\n\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var newPos = this.pos + relPos;\n if (relPos > 1) {\n for (var i = this.pos + 1; i < newPos + 1; i++) {\n this.chars[i].setPenState(this.currPenState);\n }\n }\n this.setCursor(newPos);\n }\n\n /**\n * Backspace, move one step back and clear character.\n */\n\n }, {\n key: 'backSpace',\n value: function backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n }, {\n key: 'insertChar',\n value: function insertChar(byte) {\n if (byte >= 0x90) {\n //Extended char\n this.backSpace();\n }\n var char = getCharForByte(byte);\n if (this.pos >= NR_COLS) {\n logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n return;\n }\n this.chars[this.pos].setChar(char, this.currPenState);\n this.moveCursor(1);\n }\n }, {\n key: 'clearFromPos',\n value: function clearFromPos(startPos) {\n var i;\n for (i = startPos; i < NR_COLS; i++) {\n this.chars[i].reset();\n }\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n }, {\n key: 'getTextString',\n value: function getTextString() {\n var chars = [];\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n var char = this.chars[i].uchar;\n if (char !== ' ') {\n empty = false;\n }\n chars.push(char);\n }\n if (empty) {\n return '';\n } else {\n return chars.join('');\n }\n }\n }, {\n key: 'setPenStyles',\n value: function setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n }]);\n\n return Row;\n}();\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\n\n\nvar CaptionScreen = function () {\n function CaptionScreen() {\n _classCallCheck(this, CaptionScreen);\n\n this.rows = [];\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n }\n this.currRow = NR_ROWS - 1;\n this.nrRollUpRows = null;\n this.reset();\n }\n\n _createClass(CaptionScreen, [{\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n this.currRow = NR_ROWS - 1;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].equals(other.rows[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: 'backSpace',\n value: function backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n var row = this.rows[this.currRow];\n row.clearToEndOfRow();\n }\n\n /**\n * Insert a character (without styling) in the current row.\n */\n\n }, {\n key: 'insertChar',\n value: function insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n }, {\n key: 'setPen',\n value: function setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData, lastOutputScreen) {\n logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n var newRow = pacData.row - 1;\n if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n newRow = this.nrRollUpRows - 1;\n }\n\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow - this.nrRollUpRows + i + 1].copy(lastOutputScreen.rows[topRowIndex + i]);\n }\n }\n }\n\n this.currRow = newRow;\n var row = this.rows[this.currRow];\n if (pacData.indent !== null) {\n var indent = pacData.indent;\n var prevPos = Math.max(indent - 1, 0);\n row.setCursor(pacData.indent);\n pacData.color = row.chars[prevPos].penState.foreground;\n }\n var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n this.setPen(styles);\n }\n\n /**\n * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n */\n\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n\n logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n this.backSpace();\n this.setPen(bkgData);\n this.insertChar(0x20); //Space\n }\n }, {\n key: 'setRollUpRows',\n value: function setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n }, {\n key: 'rollUp',\n value: function rollUp() {\n if (this.nrRollUpRows === null) {\n logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n return; //Not properly setup\n }\n logger.log('TEXT', this.getDisplayText());\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n var topRow = this.rows.splice(topRowIndex, 1)[0];\n topRow.clear();\n this.rows.splice(this.currRow, 0, topRow);\n logger.log('INFO', 'Rolling up');\n //logger.log('TEXT', this.get_display_text())\n }\n\n /**\n * Get all non-empty rows with as unicode text.\n */\n\n }, {\n key: 'getDisplayText',\n value: function getDisplayText(asOneRow) {\n asOneRow = asOneRow || false;\n var displayText = [];\n var text = '';\n var rowNr = -1;\n for (var i = 0; i < NR_ROWS; i++) {\n var rowText = this.rows[i].getTextString();\n if (rowText) {\n rowNr = i + 1;\n if (asOneRow) {\n displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n } else {\n displayText.push(rowText.trim());\n }\n }\n }\n if (displayText.length > 0) {\n if (asOneRow) {\n text = '[' + displayText.join(' | ') + ']';\n } else {\n text = displayText.join('\\n');\n }\n }\n return text;\n }\n }, {\n key: 'getTextAndFormat',\n value: function getTextAndFormat() {\n return this.rows;\n }\n }]);\n\n return CaptionScreen;\n}();\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nvar Cea608Channel = function () {\n function Cea608Channel(channelNumber, outputFilter) {\n _classCallCheck(this, Cea608Channel);\n\n this.chNr = channelNumber;\n this.outputFilter = outputFilter;\n this.mode = null;\n this.verbose = 0;\n this.displayedMemory = new CaptionScreen();\n this.nonDisplayedMemory = new CaptionScreen();\n this.lastOutputScreen = new CaptionScreen();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null; // Keeps track of where a cue started.\n }\n\n _createClass(Cea608Channel, [{\n key: 'reset',\n value: function reset() {\n this.mode = null;\n this.displayedMemory.reset();\n this.nonDisplayedMemory.reset();\n this.lastOutputScreen.reset();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null;\n this.lastCueEndTime = null;\n }\n }, {\n key: 'getHandler',\n value: function getHandler() {\n return this.outputFilter;\n }\n }, {\n key: 'setHandler',\n value: function setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n this.writeScreen.setPAC(pacData, this.lastOutputScreen);\n }\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n }, {\n key: 'setMode',\n value: function setMode(newMode) {\n if (newMode === this.mode) {\n return;\n }\n this.mode = newMode;\n logger.log('INFO', 'MODE=' + newMode);\n if (this.mode === 'MODE_POP-ON') {\n this.writeScreen = this.nonDisplayedMemory;\n } else {\n this.writeScreen = this.displayedMemory;\n this.writeScreen.reset();\n this.lastOutputScreen.reset();\n }\n if (this.mode !== 'MODE_ROLL-UP') {\n this.displayedMemory.nrRollUpRows = null;\n this.nonDisplayedMemory.nrRollUpRows = null;\n }\n this.mode = newMode;\n }\n }, {\n key: 'insertChars',\n value: function insertChars(chars) {\n for (var i = 0; i < chars.length; i++) {\n this.writeScreen.insertChar(chars[i]);\n }\n var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccRCL',\n value: function ccRCL() {\n // Resume Caption Loading (switch mode to Pop On)\n logger.log('INFO', 'RCL - Resume Caption Loading');\n this.setMode('MODE_POP-ON');\n }\n }, {\n key: 'ccBS',\n value: function ccBS() {\n // BackSpace\n logger.log('INFO', 'BS - BackSpace');\n if (this.mode === 'MODE_TEXT') {\n return;\n }\n this.writeScreen.backSpace();\n if (this.writeScreen === this.displayedMemory) {\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccAOF',\n value: function ccAOF() {\n // Reserved (formerly Alarm Off)\n return;\n }\n }, {\n key: 'ccAON',\n value: function ccAON() {\n // Reserved (formerly Alarm On)\n return;\n }\n }, {\n key: 'ccDER',\n value: function ccDER() {\n // Delete to End of Row\n logger.log('INFO', 'DER- Delete to End of Row');\n this.writeScreen.clearToEndOfRow();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccRU',\n value: function ccRU(nrRows) {\n //Roll-Up Captions-2,3,or 4 Rows\n logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n this.writeScreen = this.displayedMemory;\n this.setMode('MODE_ROLL-UP');\n this.writeScreen.setRollUpRows(nrRows);\n }\n }, {\n key: 'ccFON',\n value: function ccFON() {\n //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({ flash: true });\n }\n }, {\n key: 'ccRDC',\n value: function ccRDC() {\n // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n }, {\n key: 'ccTR',\n value: function ccTR() {\n // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccRTD',\n value: function ccRTD() {\n // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccEDM',\n value: function ccEDM() {\n // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccCR',\n value: function ccCR() {\n // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccENM',\n value: function ccENM() {\n //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n }, {\n key: 'ccEOC',\n value: function ccEOC() {\n //End of Caption (Flip Memories)\n logger.log('INFO', 'EOC - End Of Caption');\n if (this.mode === 'MODE_POP-ON') {\n var tmp = this.displayedMemory;\n this.displayedMemory = this.nonDisplayedMemory;\n this.nonDisplayedMemory = tmp;\n this.writeScreen = this.nonDisplayedMemory;\n logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n }\n this.outputDataUpdate();\n }\n }, {\n key: 'ccTO',\n value: function ccTO(nrCols) {\n // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n }, {\n key: 'ccMIDROW',\n value: function ccMIDROW(secondByte) {\n // Parse MIDROW command\n var styles = { flash: false };\n styles.underline = secondByte % 2 === 1;\n styles.italics = secondByte >= 0x2e;\n if (!styles.italics) {\n var colorIndex = Math.floor(secondByte / 2) - 0x10;\n var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n styles.foreground = colors[colorIndex];\n } else {\n styles.foreground = 'white';\n }\n logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n this.writeScreen.setPen(styles);\n }\n }, {\n key: 'outputDataUpdate',\n value: function outputDataUpdate() {\n var t = logger.time;\n if (t === null) {\n return;\n }\n if (this.outputFilter) {\n if (this.outputFilter.updateData) {\n this.outputFilter.updateData(t, this.displayedMemory);\n }\n if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n // Start of a new cue\n this.cueStartTime = t;\n } else {\n if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n }\n this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n }\n }\n this.lastOutputScreen.copy(this.displayedMemory);\n }\n }\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n if (this.outputFilter) {\n if (!this.displayedMemory.isEmpty()) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n }\n this.cueStartTime = t;\n }\n }\n }\n }]);\n\n return Cea608Channel;\n}();\n\nvar Cea608Parser = function () {\n function Cea608Parser(field, out1, out2) {\n _classCallCheck(this, Cea608Parser);\n\n this.field = field || 1;\n this.outputs = [out1, out2];\n this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n this.currChNr = -1; // Will be 1 or 2\n this.lastCmdA = null; // First byte of last command\n this.lastCmdB = null; // Second byte of last command\n this.bufferedData = [];\n this.startTime = null;\n this.lastTime = null;\n this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n }\n\n _createClass(Cea608Parser, [{\n key: 'getHandler',\n value: function getHandler(index) {\n return this.channels[index].getHandler();\n }\n }, {\n key: 'setHandler',\n value: function setHandler(index, newHandler) {\n this.channels[index].setHandler(newHandler);\n }\n\n /**\n * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n */\n\n }, {\n key: 'addData',\n value: function addData(t, byteList) {\n var cmdFound,\n a,\n b,\n charsFound = false;\n\n this.lastTime = t;\n logger.setTime(t);\n\n for (var i = 0; i < byteList.length; i += 2) {\n a = byteList[i] & 0x7f;\n b = byteList[i + 1] & 0x7f;\n if (a === 0 && b === 0) {\n this.dataCounters.padding += 2;\n continue;\n } else {\n logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n }\n cmdFound = this.parseCmd(a, b);\n if (!cmdFound) {\n cmdFound = this.parseMidrow(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parsePAC(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parseBackgroundAttributes(a, b);\n }\n if (!cmdFound) {\n charsFound = this.parseChars(a, b);\n if (charsFound) {\n if (this.currChNr && this.currChNr >= 0) {\n var channel = this.channels[this.currChNr - 1];\n channel.insertChars(charsFound);\n } else {\n logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n }\n }\n }\n if (cmdFound) {\n this.dataCounters.cmd += 2;\n } else if (charsFound) {\n this.dataCounters.char += 2;\n } else {\n this.dataCounters.other += 2;\n logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n }\n }\n }\n\n /**\n * Parse Command.\n * @returns {Boolean} Tells if a command was found\n */\n\n }, {\n key: 'parseCmd',\n value: function parseCmd(a, b) {\n var chNr = null;\n\n var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n if (!(cond1 || cond2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null; // Repeated commands are dropped (once)\n logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n return true;\n }\n\n if (a === 0x14 || a === 0x17) {\n chNr = 1;\n } else {\n chNr = 2; // (a === 0x1C || a=== 0x1f)\n }\n\n var channel = this.channels[chNr - 1];\n\n if (a === 0x14 || a === 0x1C) {\n if (b === 0x20) {\n channel.ccRCL();\n } else if (b === 0x21) {\n channel.ccBS();\n } else if (b === 0x22) {\n channel.ccAOF();\n } else if (b === 0x23) {\n channel.ccAON();\n } else if (b === 0x24) {\n channel.ccDER();\n } else if (b === 0x25) {\n channel.ccRU(2);\n } else if (b === 0x26) {\n channel.ccRU(3);\n } else if (b === 0x27) {\n channel.ccRU(4);\n } else if (b === 0x28) {\n channel.ccFON();\n } else if (b === 0x29) {\n channel.ccRDC();\n } else if (b === 0x2A) {\n channel.ccTR();\n } else if (b === 0x2B) {\n channel.ccRTD();\n } else if (b === 0x2C) {\n channel.ccEDM();\n } else if (b === 0x2D) {\n channel.ccCR();\n } else if (b === 0x2E) {\n channel.ccENM();\n } else if (b === 0x2F) {\n channel.ccEOC();\n }\n } else {\n //a == 0x17 || a == 0x1F\n channel.ccTO(b - 0x20);\n }\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Parse midrow styling command\n * @returns {Boolean}\n */\n\n }, {\n key: 'parseMidrow',\n value: function parseMidrow(a, b) {\n var chNr = null;\n\n if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n if (a === 0x11) {\n chNr = 1;\n } else {\n chNr = 2;\n }\n if (chNr !== this.currChNr) {\n logger.log('ERROR', 'Mismatch channel in midrow parsing');\n return false;\n }\n var channel = this.channels[chNr - 1];\n channel.ccMIDROW(b);\n logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n return true;\n }\n return false;\n }\n /**\n * Parse Preable Access Codes (Table 53).\n * @returns {Boolean} Tells if PAC found\n */\n\n }, {\n key: 'parsePAC',\n value: function parsePAC(a, b) {\n\n var chNr = null;\n var row = null;\n\n var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n if (!(case1 || case2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true; // Repeated commands are dropped (once)\n }\n\n chNr = a <= 0x17 ? 1 : 2;\n\n if (0x40 <= b && b <= 0x5F) {\n row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n } else {\n // 0x60 <= b <= 0x7F\n row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n }\n var pacData = this.interpretPAC(row, b);\n var channel = this.channels[chNr - 1];\n channel.setPAC(pacData);\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Interpret the second byte of the pac, and return the information.\n * @returns {Object} pacData with style parameters.\n */\n\n }, {\n key: 'interpretPAC',\n value: function interpretPAC(row, byte) {\n var pacIndex = byte;\n var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\n if (byte > 0x5F) {\n pacIndex = byte - 0x60;\n } else {\n pacIndex = byte - 0x40;\n }\n pacData.underline = (pacIndex & 1) === 1;\n if (pacIndex <= 0xd) {\n pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n } else if (pacIndex <= 0xf) {\n pacData.italics = true;\n pacData.color = 'white';\n } else {\n pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n }\n return pacData; // Note that row has zero offset. The spec uses 1.\n }\n\n /**\n * Parse characters.\n * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n */\n\n }, {\n key: 'parseChars',\n value: function parseChars(a, b) {\n\n var channelNr = null,\n charCodes = null,\n charCode1 = null;\n\n if (a >= 0x19) {\n channelNr = 2;\n charCode1 = a - 8;\n } else {\n channelNr = 1;\n charCode1 = a;\n }\n if (0x11 <= charCode1 && charCode1 <= 0x13) {\n // Special character\n var oneCode = b;\n if (charCode1 === 0x11) {\n oneCode = b + 0x50;\n } else if (charCode1 === 0x12) {\n oneCode = b + 0x70;\n } else {\n oneCode = b + 0x90;\n }\n logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n charCodes = [oneCode];\n } else if (0x20 <= a && a <= 0x7f) {\n charCodes = b === 0 ? [a] : [a, b];\n }\n if (charCodes) {\n var hexCodes = numArrayToHexArray(charCodes);\n logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n return charCodes;\n }\n\n /**\n * Parse extended background attributes as well as new foreground color black.\n * @returns{Boolean} Tells if background attributes are found\n */\n\n }, {\n key: 'parseBackgroundAttributes',\n value: function parseBackgroundAttributes(a, b) {\n var bkgData, index, chNr, channel;\n\n var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n if (!(case1 || case2)) {\n return false;\n }\n bkgData = {};\n if (a === 0x10 || a === 0x18) {\n index = Math.floor((b - 0x20) / 2);\n bkgData.background = backgroundColors[index];\n if (b % 2 === 1) {\n bkgData.background = bkgData.background + '_semi';\n }\n } else if (b === 0x2d) {\n bkgData.background = 'transparent';\n } else {\n bkgData.foreground = 'black';\n if (b === 0x2f) {\n bkgData.underline = true;\n }\n }\n chNr = a < 0x18 ? 1 : 2;\n channel = this.channels[chNr - 1];\n channel.setBkgData(bkgData);\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true;\n }\n\n /**\n * Reset state of parser and its channels.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].reset();\n }\n }\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n\n /**\n * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n */\n\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].cueSplitAtTime(t);\n }\n }\n }\n }]);\n\n return Cea608Parser;\n}();\n\nexports.default = Cea608Parser;\n\n},{}],43:[function(_dereq_,module,exports){\n'use strict';\n\nvar Cues = {\n\n newCue: function newCue(track, startTime, endTime, captionScreen) {\n var row;\n var cue;\n var indenting;\n var indent;\n var text;\n var VTTCue = window.VTTCue || window.TextTrackCue;\n\n for (var r = 0; r < captionScreen.rows.length; r++) {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty()) {\n for (var c = 0; c < row.chars.length; c++) {\n if (row.chars[c].uchar.match(/\\s/) && indenting) {\n indent++;\n } else {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n cue = new VTTCue(startTime, endTime, text.trim());\n\n if (indent >= 16) {\n indent--;\n } else {\n indent++;\n }\n\n // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n // also, drop line 1 since it's to close to the top\n if (navigator.userAgent.match(/Firefox\\//)) {\n cue.line = r + 1;\n } else {\n cue.line = r > 7 ? r - 2 : r + 1;\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{}],44:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\n\nvar EWMA = function () {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n function EWMA(halfLife) {\n _classCallCheck(this, EWMA);\n\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = 0;\n this.totalWeight_ = 0;\n }\n\n _createClass(EWMA, [{\n key: \"sample\",\n value: function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n }\n }, {\n key: \"getTotalWeight\",\n value: function getTotalWeight() {\n return this.totalWeight_;\n }\n }, {\n key: \"getEstimate\",\n value: function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n } else {\n return this.estimate_;\n }\n }\n }]);\n\n return EWMA;\n}();\n\nexports.default = EWMA;\n\n},{}],45:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction noop() {}\n\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nvar exportedLogger = fakeLogger;\n\n/*globals self: false */\n\n//let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction formatMsg(type, msg) {\n msg = '[' + type + '] > ' + msg;\n return msg;\n}\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args[0]) {\n args[0] = formatMsg(type, args[0]);\n }\n func.apply(self.console, args);\n };\n }\n return noop;\n}\n\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n functions[_key2 - 1] = arguments[_key2];\n }\n\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log();\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n};\n\nvar logger = exports.logger = exportedLogger;\n\n},{}],46:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = function () {\n function TimeRanges() {\n _classCallCheck(this, TimeRanges);\n }\n\n _createClass(TimeRanges, null, [{\n key: 'toString',\n value: function toString(r) {\n var log = '',\n len = r.length;\n for (var i = 0; i < len; i++) {\n log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n }\n return log;\n }\n }]);\n\n return TimeRanges;\n}();\n\nexports.default = TimeRanges;\n\n},{}],47:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * XHR based logger\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar XhrLoader = function () {\n function XhrLoader(config) {\n _classCallCheck(this, XhrLoader);\n\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n _createClass(XhrLoader, [{\n key: 'destroy',\n value: function destroy() {\n this.abort();\n this.loader = null;\n }\n }, {\n key: 'abort',\n value: function abort() {\n var loader = this.loader;\n if (loader && loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n\n window.clearTimeout(this.requestTimeout);\n this.requestTimeout = null;\n window.clearTimeout(this.retryTimeout);\n this.retryTimeout = null;\n }\n }, {\n key: 'load',\n value: function load(context, config, callbacks) {\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.stats = { trequest: performance.now(), retry: 0 };\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n }\n }, {\n key: 'loadInternal',\n value: function loadInternal() {\n var xhr,\n context = this.context;\n\n if (typeof XDomainRequest !== 'undefined') {\n xhr = this.loader = new XDomainRequest();\n } else {\n xhr = this.loader = new XMLHttpRequest();\n }\n\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n\n xhr.open('GET', context.url, true);\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.responseType = context.responseType;\n var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n if (this.xhrSetup) {\n this.xhrSetup(xhr, context.url);\n }\n // setup timeout before we perform request\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n xhr.send();\n }\n }, {\n key: 'readystatechange',\n value: function readystatechange(event) {\n var xhr = event.currentTarget,\n readyState = xhr.readyState,\n stats = this.stats,\n context = this.context,\n config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n if (status >= 200 && status < 300) {\n stats.tload = Math.max(stats.tfirst, performance.now());\n var data = void 0,\n len = void 0;\n if (context.responseType === 'arraybuffer') {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n var response = { url: xhr.responseURL, data: data };\n this.callbacks.onSuccess(response, stats, context);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _logger.logger.error(status + ' while loading ' + context.url);\n this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n } else {\n // retry\n _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n // aborts and resets internal state\n this.destroy();\n // schedule retry\n this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout() {\n _logger.logger.warn('timeout while loading ' + this.context.url);\n this.callbacks.onTimeout(this.stats, this.context);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // last args is to provide on progress data\n onProgress(stats, this.context, null);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"45\":45}]},{},[33])(33)\n});\n//# sourceMappingURL=hls.js.map\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Hls = __webpack_require__(0);\n\n/**\n * hls.js source handler\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = new Hls(options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n\n return function() {\n var now = Date.now();\n\n if (!_recoverDecodingErrorDate || (now - _recoverDecodingErrorDate) > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n }\n else if (!_recoverAudioCodecErrorDate || (now - _recoverAudioCodecErrorDate) > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function(e) {\n var mediaError = e.currentTarget.error;\n\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n *\n */\n this.dispose = function() {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function() {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(Hls.Events.LEVEL_LOADED, function(event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(Hls.Events.ERROR, function(event, data) {\n if (data.fatal) {\n switch (data.type) {\n case Hls.ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case Hls.ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n\n Object.keys(Hls.Events).forEach(function(key) {\n var eventName = Hls.Events[key];\n hls.on(eventName, function(event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\n\nvar HlsSourceHandler = {\n canHandleSource: function(source) {\n var hlsTypeRE = /^application\\/x-mpegURL$/i;\n var hlsExtRE = /\\.m3u8/i;\n\n if (source.skipContribHlsJs) {\n return '';\n }\n else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n }\n else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n }\n else {\n return '';\n }\n },\n handleSource: function(source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function(type) {\n var hlsTypeRE = /^application\\/x-mpegURL$/i;\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n }\n};\n\nif (Hls.isSupported()) {\n var videojs = __webpack_require__(1); // resolved UMD-wise through webpack\n\n if (videojs) {\n videojs.getComponent('Html5').registerSourceHandler(HlsSourceHandler, 0);\n }\n else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// videojs-contrib-hlsjs.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 024939d3dc9bf0dd5877","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],2:[function(_dereq_,module,exports){\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var HASH_SPLIT = /^([^#]*)(.*)$/;\r\n var QUERY_SPLIT = /^([^\\?]*)(.*)$/;\r\n var DOMAIN_SPLIT = /^(([a-z]+:\\/\\/)?[^:\\/]+(?::[0-9]+)?)?(\\/?.*)$/i;\r\n\r\n var URLToolkit = {\r\n // build an absolute URL from a relative one using the provided baseURL\r\n // if relativeURL is an absolute URL it will be returned as is.\r\n buildAbsoluteURL: function(baseURL, relativeURL) {\r\n // remove any remaining space and CRLF\r\n relativeURL = relativeURL.trim();\r\n if (/^[a-z]+:/i.test(relativeURL)) {\r\n // complete url, not relative\r\n return relativeURL;\r\n }\r\n\r\n var relativeURLQuery = null;\r\n var relativeURLHash = null;\r\n\r\n var relativeURLHashSplit = HASH_SPLIT.exec(relativeURL);\r\n if (relativeURLHashSplit) {\r\n relativeURLHash = relativeURLHashSplit[2];\r\n relativeURL = relativeURLHashSplit[1];\r\n }\r\n var relativeURLQuerySplit = QUERY_SPLIT.exec(relativeURL);\r\n if (relativeURLQuerySplit) {\r\n relativeURLQuery = relativeURLQuerySplit[2];\r\n relativeURL = relativeURLQuerySplit[1];\r\n }\r\n\r\n var baseURLHashSplit = HASH_SPLIT.exec(baseURL);\r\n if (baseURLHashSplit) {\r\n baseURL = baseURLHashSplit[1];\r\n }\r\n var baseURLQuerySplit = QUERY_SPLIT.exec(baseURL);\r\n if (baseURLQuerySplit) {\r\n baseURL = baseURLQuerySplit[1];\r\n }\r\n\r\n var baseURLDomainSplit = DOMAIN_SPLIT.exec(baseURL);\r\n if (!baseURLDomainSplit) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n \r\n // e.g. 'http://', 'https://', ''\r\n var baseURLProtocol = baseURLDomainSplit[2] || '';\r\n // e.g. 'http://example.com', '//example.com', 'example.com', ''\r\n var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\r\n // e.g. '/a/b/c/playlist.m3u8', 'a/b/c/playlist.m3u8'\r\n var baseURLPath = baseURLDomainSplit[3];\r\n if (baseURLPath.indexOf('/') !== 0 && baseURLProtocolDomain !== '') {\r\n // this handles a base url of http://example.com (missing last slash)\r\n baseURLPath = '/'+baseURLPath;\r\n }\r\n\r\n var builtURL = null;\r\n if (/^\\/\\//.test(relativeURL)) {\r\n // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\r\n builtURL = baseURLProtocol+URLToolkit.buildAbsolutePath('', relativeURL.substring(2));\r\n }\r\n else if (/^\\//.test(relativeURL)) {\r\n // relative url starts with '/' so start from root of domain\r\n builtURL = baseURLProtocolDomain+'/'+URLToolkit.buildAbsolutePath('', relativeURL.substring(1));\r\n }\r\n else {\r\n builtURL = URLToolkit.buildAbsolutePath(baseURLProtocolDomain+baseURLPath, relativeURL);\r\n }\r\n\r\n // put the query and hash parts back\r\n if (relativeURLQuery) {\r\n builtURL += relativeURLQuery;\r\n }\r\n if (relativeURLHash) {\r\n builtURL += relativeURLHash;\r\n }\r\n return builtURL;\r\n },\r\n\r\n // build an absolute path using the provided basePath\r\n // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\r\n // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\r\n buildAbsolutePath: function(basePath, relativePath) {\r\n var sRelPath = relativePath;\r\n var nUpLn, sDir = '', sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\r\n for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\r\n nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\r\n sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + ((nUpLn - 1) / 3) + '}$'), '/');\r\n }\r\n return sDir + sPath.substr(nStart);\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[function(_dereq_,module,exports){\nvar bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn, options) {\n var wkey;\n var cacheKeys = Object.keys(cache);\n\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n var exp = cache[key].exports;\n // Using babel as a transpiler to use esmodule, the export will always\n // be an object with the default export as a property of it. To ensure\n // the existing api and babel esmodule exports are both supported we\n // check for both\n if (exp === fn || exp && exp.default === fn) {\n wkey = key;\n break;\n }\n }\n\n if (!wkey) {\n wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n var wcache = {};\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n wcache[key] = key;\n }\n sources[wkey] = [\n Function(['require','module','exports'], '(' + fn + ')(self)'),\n wcache\n ];\n }\n var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\n var scache = {}; scache[wkey] = wkey;\n sources[skey] = [\n Function(['require'], (\n // try to call default if defined to also support babel esmodule\n // exports\n 'var f = require(' + stringify(wkey) + ');' +\n '(f.default ? f.default : f)(self);'\n )),\n scache\n ];\n\n var workerSources = {};\n resolveSources(skey);\n\n function resolveSources(key) {\n workerSources[key] = true;\n\n for (var depPath in sources[key][1]) {\n var depKey = sources[key][1][depPath];\n if (!workerSources[depKey]) {\n resolveSources(depKey);\n }\n }\n }\n\n var src = '(' + bundleFn + ')({'\n + Object.keys(workerSources).map(function (key) {\n return stringify(key) + ':['\n + sources[key][0]\n + ',' + stringify(sources[key][1]) + ']'\n ;\n }).join(',')\n + '},{},[' + stringify(skey) + '])'\n ;\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n var blob = new Blob([src], { type: 'text/javascript' });\n if (options && options.bare) { return blob; }\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n};\n\n},{}],4:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nvar _ewmaBandwidthEstimator = _dereq_(9);\n\nvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * simple ABR Controller\n * - compute next level based on last fragment bw heuristics\n * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n */\n\nvar AbrController = function (_EventHandler) {\n _inherits(AbrController, _EventHandler);\n\n function AbrController(hls) {\n _classCallCheck(this, AbrController);\n\n var _this = _possibleConstructorReturn(this, (AbrController.__proto__ || Object.getPrototypeOf(AbrController)).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\n _this.lastLoadedFragLevel = 0;\n _this._autoLevelCapping = -1;\n _this._nextAutoLevel = -1;\n _this.hls = hls;\n _this.onCheck = _this.abandonRulesCheck.bind(_this);\n return _this;\n }\n\n _createClass(AbrController, [{\n key: 'destroy',\n value: function destroy() {\n this.clearTimer();\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n if (!this.timer) {\n this.timer = setInterval(this.onCheck, 100);\n }\n // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n // so we need to wait for stream manifest / playlist type to instantiate it.\n if (!this.bwEstimator) {\n var hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast = void 0,\n ewmaSlow = void 0;\n\n if (isLive) {\n ewmaFast = config.abrEwmaFastLive;\n ewmaSlow = config.abrEwmaSlowLive;\n } else {\n ewmaFast = config.abrEwmaFastVoD;\n ewmaSlow = config.abrEwmaSlowVoD;\n }\n this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n }, {\n key: 'abandonRulesCheck',\n value: function abandonRulesCheck() {\n /*\n monitor fragment retrieval time...\n we compute expected time of arrival of the complete fragment.\n we compare it to expected time of buffer starvation\n */\n var hls = this.hls,\n v = hls.media,\n frag = this.fragCurrent,\n loader = frag.loader,\n minAutoLevel = this.minAutoLevel;\n\n // if loader has been destroyed or loading has been aborted, stop timer and return\n if (!loader || loader.stats && loader.stats.aborted) {\n _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n var stats = loader.stats;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n var requestDelay = performance.now() - stats.trequest,\n playbackRate = Math.abs(v.playbackRate);\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > 500 * frag.duration / playbackRate) {\n var levels = hls.levels,\n loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n // byte/s; at least 1 byte/s to avoid division by zero\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n // consider emergency switch down only if we have less than 2 frag buffered AND\n // time to finish loading current fragment is bigger than buffer starvation delay\n // ie if we risk buffer starvation if bw does not increase quickly\n if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n var fragLevelNextLoadedDelay = void 0,\n nextLoadLevel = void 0;\n // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n // we start from current level - 1 and we step down , until we find a matching level\n for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n // we found a lower level that be rebuffering free with current estimated bw !\n break;\n }\n }\n // only emergency switch down if it takes less time to load new fragment at lowest level instead\n // of finishing loading current one ...\n if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']= minAutoLevel; i--) {\n var levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...\n !fetchDuration || live || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var nextAutoLevel = this._nextAutoLevel,\n bwEstimator = this.bwEstimator,\n hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n // in case next auto level has been forced, and bw not available or not reliable\n if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n // cap next auto level by max auto level\n return Math.min(nextAutoLevel, this.maxAutoLevel);\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this.nextABRAutoLevel;\n if (nextAutoLevel !== -1) {\n // nextAutoLevel is defined, use it to cap ABR computed quality level\n nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n }\n if (minAutoBitrate !== undefined) {\n var levelNextBitrate = levels[nextABRAutoLevel].realBitrate ? Math.max(levels[nextABRAutoLevel].realBitrate, levels[nextABRAutoLevel].bitrate) : levels[nextABRAutoLevel].bitrate;\n while (levelNextBitrate < minAutoBitrate) {\n nextABRAutoLevel++;\n }\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var levels = this.hls.levels,\n autoLevelCapping = this._autoLevelCapping,\n maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n }, {\n key: 'nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = this.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = this.minAutoLevel;\n var v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = v ? v.currentTime : 0,\n\n // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n if (bestLevel >= 0) {\n return bestLevel;\n } else {\n _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,\n bwFactor = config.abrBandWidthFactor,\n bwUpFactor = config.abrBandWidthUpFactor;\n if (bufferStarvationDelay === 0) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n return Math.max(bestLevel, 0);\n }\n }\n }]);\n\n return AbrController;\n}(_eventHandler2.default);\n\nexports.default = AbrController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45,\"9\":9}],5:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Audio Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n STARTING: 'STARTING',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\n};\n\nvar AudioStreamController = function (_EventHandler) {\n _inherits(AudioStreamController, _EventHandler);\n\n function AudioStreamController(hls) {\n _classCallCheck(this, AudioStreamController);\n\n var _this = _possibleConstructorReturn(this, (AudioStreamController.__proto__ || Object.getPrototypeOf(AudioStreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED, _events2.default.INIT_PTS_FOUND));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\n return _this;\n }\n\n _createClass(AudioStreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n _logger.logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n this.startPosition = startPosition;\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n var _this2 = this;\n\n var pos,\n track,\n trackDetails,\n hls = this.hls,\n config = hls.config;\n //logger.log('audioStream:' + this.state);\n var now;\n var retryDate;\n var isSeeking;\n\n var _ret = function () {\n switch (_this2.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n _this2.state = State.WAITING_TRACK;\n _this2.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = _this2.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\n }\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!_this2.media && (_this2.startFragRequested || !config.startFragPrefetch)) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // if we have not yet loaded any fragment, start loading from start position\n if (_this2.loadedmetadata) {\n pos = _this2.media.currentTime;\n } else {\n pos = _this2.nextLoadPosition;\n }\n var media = _this2.mediaBuffer ? _this2.mediaBuffer : _this2.media,\n bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = _this2.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = _this2.audioSwitch,\n trackId = _this2.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen && trackId < tracks.length) {\n trackDetails = tracks[trackId].details;\n // if track info not retrieved yet, switch state and wait for track retrieval\n if (typeof trackDetails === 'undefined') {\n _this2.state = State.WAITING_TRACK;\n break;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!_this2.media.seeking || _this2.media.duration - bufferEnd < fragPrevious.duration / 2) {\n // Finalize the media stream\n _this2.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n _this2.state = State.ENDED;\n break;\n }\n }\n\n // find fragment index, contiguous with end of buffer position\n var fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n frag = void 0;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n _this2.media.currentTime = start + 0.05;\n } else {\n return {\n v: void 0\n };\n }\n }\n }\n }\n\n // if bufferEnd before start of playlist, load first fragment\n if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === _this2.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + _this2.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n _this2.media.currentTime = nextBuffered + 0.05;\n return {\n v: void 0\n };\n }\n } else {\n (function () {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n return -1;\n }\n return 0;\n });\n if (!foundFrag) {\n _logger.logger.log('frag not found @bufferEnd/start:' + bufferEnd + '/' + start);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < trackDetails.endSN) {\n frag = fragments[frag.sn + 1 - trackDetails.startSN];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n } else {\n frag = null;\n }\n }\n }\n })();\n }\n if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);\n _this2.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (_this2.fragLoadIdx !== undefined) {\n _this2.fragLoadIdx++;\n } else {\n _this2.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(_this2.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return {\n v: void 0\n };\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = _this2.fragLoadIdx;\n _this2.fragCurrent = frag;\n _this2.startFragRequested = true;\n _this2.nextLoadPosition = frag.start + frag.duration;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n _this2.state = State.FRAG_LOADING;\n }\n }\n }\n break;\n case State.WAITING_TRACK:\n track = _this2.tracks[_this2.trackId];\n // check if playlist is already loaded\n if (track && track.details) {\n _this2.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n now = performance.now();\n retryDate = _this2.retryDate;\n\n media = _this2.media;\n isSeeking = media && media.seeking;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\n if (!retryDate || now >= retryDate || isSeeking) {\n _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n _this2.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var tracks = this.tracks;\n if (tracks) {\n // reset fragment load counter\n tracks.forEach(function (track) {\n if (track.details) {\n track.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (this.media) {\n this.lastCurrentTime = this.media.currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onAudioTracksUpdated',\n value: function onAudioTracksUpdated(data) {\n _logger.logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n this.trackId = data.id;\n this.state = State.IDLE;\n\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment = null;\n // destroy useless demuxer when switching audio to main\n if (!altAudio) {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n } else {\n // switching to audio track, start timer if not already started\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n }\n\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\n\n // compute start position\n if (!this.startFragRequested) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n this.startPosition = 0;\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n if (this.state === State.WAITING_TRACK) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n if (initPTS !== undefined) {\n this.pendingBuffering = true;\n _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, audioCodec, null, start, cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, initPTS);\n } else {\n _logger.logger.log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = 'mp4a.40.2';\n track.id = data.id;\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this3 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n (function () {\n var trackId = _this3.trackId,\n track = _this3.tracks[trackId],\n frag = _this3.fragCurrent,\n hls = _this3.hls;\n\n _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\n var audioSwitch = _this3.audioSwitch,\n media = _this3.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n _this3.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = _this3.pendingData;\n if (!_this3.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // arm pending Buffering flag before appending a segment\n _this3.pendingBuffering = true;\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n _this3.pendingData = [];\n _this3.appended = true;\n }\n }\n //trigger handler right now\n _this3.tick();\n })();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'audio') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to audio fragment\n if (frag && frag.type !== 'audio') {\n return;\n }\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n if (loadError <= config.fragLoadingMaxRetry) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this4 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this4.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n this.tick();\n }\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],6:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * audio track controller\n */\n\nvar AudioTrackController = function (_EventHandler) {\n _inherits(AudioTrackController, _EventHandler);\n\n function AudioTrackController(hls) {\n _classCallCheck(this, AudioTrackController);\n\n var _this = _possibleConstructorReturn(this, (AudioTrackController.__proto__ || Object.getPrototypeOf(AudioTrackController)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n this.updateTrack(this.trackId);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.audioTracks || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n // loop through available audio tracks and autoselect default if needed\n var id = 0;\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n _logger.logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n _logger.logger.log('audioTrack ' + data.id + ' loaded');\n this.tracks[data.id].details = data.details;\n // check if current playlist is a live playlist\n if (data.details.live && !this.timer) {\n // if live playlist we will have to reload it periodically\n // set reload period to playlist target duration\n this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n }\n if (!data.details.live && this.timer) {\n // playlist is not live and timer is armed : stopping it\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'setAudioTrackInternal',\n value: function setAudioTrackInternal(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('switching to audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n }]);\n\n return AudioTrackController;\n}(_eventHandler2.default);\n\nexports.default = AudioTrackController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],7:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Buffer Controller\n */\n\nvar BufferController = function (_EventHandler) {\n _inherits(BufferController, _EventHandler);\n\n function BufferController(hls) {\n _classCallCheck(this, BufferController);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\n var _this = _possibleConstructorReturn(this, (BufferController.__proto__ || Object.getPrototypeOf(BufferController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_PTS_UPDATED, _events2.default.LEVEL_UPDATED));\n\n _this._msDuration = null;\n // the value that we want to set mediaSource.duration to\n _this._levelDuration = null;\n\n // Source Buffer listeners\n _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n _this.onsbe = _this.onSBUpdateError.bind(_this);\n _this.pendingTracks = {};\n _this.tracks = {};\n return _this;\n }\n\n _createClass(BufferController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/dailymotion/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var audioExpected = data.audio,\n videoExpected = data.video,\n sourceBufferNb = 0;\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n if (data.altAudio && (audioExpected || videoExpected)) {\n sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var media = this.media = data.media;\n if (media) {\n // setup the media source\n var ms = this.mediaSource = new MediaSource();\n //Media Source listeners\n this.onmso = this.onMediaSourceOpen.bind(this);\n this.onmse = this.onMediaSourceEnded.bind(this);\n this.onmsc = this.onMediaSourceClose.bind(this);\n ms.addEventListener('sourceopen', this.onmso);\n ms.addEventListener('sourceended', this.onmse);\n ms.addEventListener('sourceclose', this.onmsc);\n // link video and media Source\n media.src = URL.createObjectURL(ms);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n _logger.logger.log('media source detaching');\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n ms.endOfStream();\n } catch (err) {\n _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n }\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (this.media) {\n URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n this.onmso = this.onmse = this.onmsc = null;\n this.hls.trigger(_events2.default.MEDIA_DETACHED);\n }\n }, {\n key: 'onMediaSourceOpen',\n value: function onMediaSourceOpen() {\n _logger.logger.log('media source opened');\n this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n var mediaSource = this.mediaSource;\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n this.checkPendingTracks();\n }\n }, {\n key: 'checkPendingTracks',\n value: function checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n var pendingTracks = this.pendingTracks,\n pendingTracksNb = Object.keys(pendingTracks).length;\n // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n this.doAppending();\n }\n }\n }, {\n key: 'onMediaSourceClose',\n value: function onMediaSourceClose() {\n _logger.logger.log('media source closed');\n }\n }, {\n key: 'onMediaSourceEnded',\n value: function onMediaSourceEnded() {\n _logger.logger.log('media source ended');\n }\n }, {\n key: 'onSBUpdateEnd',\n value: function onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n }, {\n key: 'onSBUpdateError',\n value: function onSBUpdateError(event) {\n _logger.logger.error('sourceBuffer error:' + event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n }\n }, {\n key: 'onBufferReset',\n value: function onBufferReset() {\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n var sb = sourceBuffer[type];\n try {\n this.mediaSource.removeSourceBuffer(sb);\n sb.removeEventListener('updateend', this.onsbue);\n sb.removeEventListener('error', this.onsbe);\n } catch (err) {}\n }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n }, {\n key: 'onBufferCodecs',\n value: function onBufferCodecs(tracks) {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n // if sourcebuffers already created, do nothing ...\n if (Object.keys(this.sourceBuffer).length === 0) {\n for (var trackName in tracks) {\n this.pendingTracks[trackName] = tracks[trackName];\n }\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n // try to create sourcebuffers if mediasource opened\n this.checkPendingTracks();\n }\n }\n }\n }, {\n key: 'createSourceBuffers',\n value: function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + ';codecs=' + codec;\n _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = { codec: codec, container: track.container };\n track.buffer = sb;\n } catch (err) {\n _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n }\n }\n }\n this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n }\n }, {\n key: 'onBufferAppending',\n value: function onBufferAppending(data) {\n if (!this._needsFlush) {\n if (!this.segments) {\n this.segments = [data];\n } else {\n this.segments.push(data);\n }\n this.doAppending();\n }\n }\n }, {\n key: 'onBufferAppendFail',\n value: function onBufferAppendFail(data) {\n _logger.logger.error('sourceBuffer error:', data.event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\n }, {\n key: 'onBufferEos',\n value: function onBufferEos(data) {\n var sb = this.sourceBuffer;\n var dataType = data.type;\n for (var type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n _logger.logger.log(type + ' sourceBuffer now EOS');\n }\n }\n }\n this.checkEos();\n }\n\n // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\n }, {\n key: 'checkEos',\n value: function checkEos() {\n var sb = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for (var type in sb) {\n var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n //Notify the media element that it now has all of the media data\n try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n }, {\n key: 'onBufferFlushing',\n value: function onBufferFlushing(data) {\n this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n // attempt flush immediatly\n this.flushBufferCounter = 0;\n this.doFlush();\n }\n }, {\n key: 'onLevelUpdated',\n value: function onLevelUpdated(event) {\n var details = event.details;\n if (details.fragments.length === 0) {\n return;\n }\n this._levelDuration = details.totalduration + details.fragments[0].start;\n this.updateMediaElementDuration();\n }\n\n // https://github.com/dailymotion/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (var type in sourceBuffer) {\n if (sourceBuffer[type].updating) {\n // can't set duration whilst a buffer is updating\n return;\n }\n }\n if (this._msDuration === null) {\n // initialise to the value that the media source is reporting\n this._msDuration = mediaSource.duration;\n }\n var duration = media.duration;\n // levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update mediasource duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n }, {\n key: 'doFlush',\n value: function doFlush() {\n // loop through all buffer ranges to flush\n while (this.flushRange.length) {\n var range = this.flushRange[0];\n // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n if (this.flushBuffer(range.start, range.end, range.type)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n this.flushBufferCounter = 0;\n } else {\n this._needsFlush = true;\n // avoid looping, wait for SB update end to retrigger a flush\n return;\n }\n }\n if (this.flushRange.length === 0) {\n // everything flushed\n this._needsFlush = false;\n\n // let's recompute this.appended, which is used to avoid flush looping\n var appended = 0;\n var sourceBuffer = this.sourceBuffer;\n try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n }\n }\n }, {\n key: 'doAppending',\n value: function doAppending() {\n var hls = this.hls,\n sourceBuffer = this.sourceBuffer,\n segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n return;\n }\n if (this.appending) {\n //logger.log(`sb appending in progress`);\n return;\n }\n if (segments && segments.length) {\n var segment = segments.shift();\n try {\n var type = segment.type,\n sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\n } else {\n // in case we don't have any source buffer matching with this segment type,\n // it means that Mediasource fails to create sourcebuffer\n // discard this segment, and trigger update end\n this.onSBUpdateEnd();\n }\n } catch (err) {\n // in case any error occured while appending, put back segment in segments table\n _logger.logger.error('error while trying to append buffer:' + err.message);\n segments.unshift(segment);\n var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n if (err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n event.frag = this.fragCurrent;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. retrying help recovering this\n */\n if (this.appendError > hls.config.appendErrorMaxRetry) {\n _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n segments = [];\n event.fatal = true;\n hls.trigger(_events2.default.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n }\n } else {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n this.segments = [];\n event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n return;\n }\n }\n }\n }\n }\n\n /*\n flush specified buffered range,\n return true once range has been flushed.\n as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n */\n\n }, {\n key: 'flushBuffer',\n value: function flushBuffer(startOffset, endOffset, typeIn) {\n var sb,\n i,\n bufStart,\n bufEnd,\n flushStart,\n flushEnd,\n sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n if (this.flushBufferCounter < this.appended) {\n for (var type in sourceBuffer) {\n // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n // if no, let's flush all sourcebuffers\n if (typeIn && type !== typeIn) {\n continue;\n }\n sb = sourceBuffer[type];\n // we are going to flush buffer, mark source buffer as 'not ended'\n sb.ended = false;\n if (!sb.updating) {\n try {\n for (i = 0; i < sb.buffered.length; i++) {\n bufStart = sb.buffered.start(i);\n bufEnd = sb.buffered.end(i);\n // workaround firefox not able to properly flush multiple buffered range.\n if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n flushStart = startOffset;\n flushEnd = endOffset;\n } else {\n flushStart = Math.max(bufStart, startOffset);\n flushEnd = Math.min(bufEnd, endOffset);\n }\n /* sometimes sourcebuffer.remove() does not flush\n the exact expected time range.\n to avoid rounding issues/infinite loop,\n only flush buffer range of length greater than 500ms.\n */\n if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n this.flushBufferCounter++;\n _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n _logger.logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n _logger.logger.warn('abort flushing too many retries');\n }\n _logger.logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n }]);\n\n return BufferController;\n}(_eventHandler2.default);\n\nexports.default = BufferController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],8:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * cap stream level to media size dimension controller\n */\n\nvar CapLevelController = function (_EventHandler) {\n _inherits(CapLevelController, _EventHandler);\n\n function CapLevelController(hls) {\n _classCallCheck(this, CapLevelController);\n\n return _possibleConstructorReturn(this, (CapLevelController.__proto__ || Object.getPrototypeOf(CapLevelController)).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n }\n\n _createClass(CapLevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.hls.config.capLevelToPlayerSize) {\n this.media = this.restrictedLevels = null;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n this.timer = clearInterval(this.timer);\n }\n }\n }\n }, {\n key: 'onFpsDropLevelCapping',\n value: function onFpsDropLevelCapping(data) {\n if (!this.restrictedLevels) {\n this.restrictedLevels = [];\n }\n if (!this.isLevelRestricted(data.droppedLevel)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n hls.firstLevel = this.getMaxLevel(data.firstLevel);\n clearInterval(this.timer);\n this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n }\n }\n }, {\n key: 'detectPlayerSize',\n value: function detectPlayerSize() {\n if (this.media) {\n var levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (hls.autoLevelCapping > this.autoLevelCapping) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */\n\n }, {\n key: 'getMaxLevel',\n value: function getMaxLevel(capLevelIndex) {\n var result = 0,\n i = void 0,\n level = void 0,\n mWidth = this.mediaWidth,\n mHeight = this.mediaHeight,\n lWidth = 0,\n lHeight = 0;\n\n for (i = 0; i <= capLevelIndex; i++) {\n level = this.levels[i];\n if (this.isLevelRestricted(i)) {\n break;\n }\n result = i;\n lWidth = level.width;\n lHeight = level.height;\n if (mWidth <= lWidth || mHeight <= lHeight) {\n break;\n }\n }\n return result;\n }\n }, {\n key: 'isLevelRestricted',\n value: function isLevelRestricted(level) {\n return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n }\n }, {\n key: 'contentScaleFactor',\n get: function get() {\n var pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch (e) {}\n return pixelRatio;\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n }]);\n\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"27\":27,\"28\":28}],9:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\nvar _ewma = _dereq_(44);\n\nvar _ewma2 = _interopRequireDefault(_ewma);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EwmaBandWidthEstimator = function () {\n function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n _classCallCheck(this, EwmaBandWidthEstimator);\n\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _ewma2.default(slow);\n this.fast_ = new _ewma2.default(fast);\n }\n\n _createClass(EwmaBandWidthEstimator, [{\n key: 'sample',\n value: function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000 * numBytes / durationMs,\n\n //console.log('instant bw:'+ Math.round(bandwidth));\n // we weight sample using loading duration....\n weight = durationMs / 1000;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n }\n }, {\n key: 'canEstimate',\n value: function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n }\n }, {\n key: 'getEstimate',\n value: function getEstimate() {\n if (this.canEstimate()) {\n //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }]);\n\n return EwmaBandWidthEstimator;\n}();\n\nexports.default = EwmaBandWidthEstimator;\n\n},{\"44\":44}],10:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * FPS Controller\n */\n\nvar FPSController = function (_EventHandler) {\n _inherits(FPSController, _EventHandler);\n\n function FPSController(hls) {\n _classCallCheck(this, FPSController);\n\n return _possibleConstructorReturn(this, (FPSController.__proto__ || Object.getPrototypeOf(FPSController)).call(this, hls, _events2.default.MEDIA_ATTACHING));\n }\n\n _createClass(FPSController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n }, {\n key: 'checkFPS',\n value: function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n if (droppedFPS > 0) {\n //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n }, {\n key: 'checkFPSInterval',\n value: function checkFPSInterval() {\n var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],11:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Level Controller\n */\n\nvar LevelController = function (_EventHandler) {\n _inherits(LevelController, _EventHandler);\n\n function LevelController(hls) {\n _classCallCheck(this, LevelController);\n\n var _this = _possibleConstructorReturn(this, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = _this._autoLevelCapping = -1;\n return _this;\n }\n\n _createClass(LevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n this.canload = true;\n var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n this.canload = false;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels0.length;\n level.url = [level.url];\n level.urlId = 0;\n levels0.push(level);\n } else {\n levels0[redundantLevelId].url.push(level.url);\n }\n });\n\n // remove audio-only level if we also have levels with audio+video codecs signalled\n if (videoCodecFound && audioCodecFound) {\n levels0.forEach(function (level) {\n if (level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', videoCodec));\n });\n\n if (levels.length) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort level on bitrate\n levels.sort(function (a, b) {\n return a.bitrate - b.bitrate;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n break;\n }\n }\n hls.trigger(_events2.default.MANIFEST_PARSED, { levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n }\n return;\n }\n }, {\n key: 'setLevelInternal',\n value: function setLevelInternal(newLevel) {\n var levels = this._levels;\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (this._level !== newLevel) {\n _logger.logger.log('switching to level ' + newLevel);\n this._level = newLevel;\n this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n }\n var level = levels[newLevel],\n levelDetails = level.details;\n // check if we need to load playlist for this level\n if (!levelDetails || levelDetails.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n if (data.fatal) {\n return;\n }\n\n var details = data.details,\n hls = this.hls,\n levelId = void 0,\n level = void 0,\n levelError = false,\n abrController = hls.abrController,\n minAutoLevel = abrController.minAutoLevel;\n // try to recover not fatal errors\n switch (details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\n break;\n default:\n break;\n }\n /* try to switch to a redundant stream if any available.\n * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n * otherwise, we cannot recover this network error ...\n */\n if (levelId !== undefined) {\n level = this._levels[levelId];\n if (!level.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n } else {\n // we could try to recover if in auto mode and current level not lowest level (0)\n var recoverable = this._manualLevel === -1 && levelId;\n if (recoverable) {\n _logger.logger.warn('level controller,' + details + ': switch-down for next fragment');\n abrController.nextAutoLevel = Math.max(minAutoLevel, levelId - 1);\n } else if (level && level.details && level.details.live) {\n _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n if (levelError) {\n // reset this._level so that another call to set level() will retrigger a frag load\n this._level = undefined;\n }\n // other errors are handled by stream controller\n } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n var media = hls.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n if (mediaBuffered) {\n var retryDelay = hls.config.levelLoadingRetryDelay;\n _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n this.timer = setTimeout(this.ontick, retryDelay);\n } else {\n _logger.logger.error('cannot recover ' + details + ' error');\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n hls.trigger(_events2.default.ERROR, data);\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n var newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n curDetails = curLevel.details;\n if (curDetails && newDetails.endSN === curDetails.endSN) {\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n _logger.logger.log('same live playlist, reload twice faster');\n }\n // decrement reloadInterval with level loading delay\n reloadInterval -= performance.now() - data.stats.trequest;\n // in any case, don't reload more than every second\n reloadInterval = Math.max(1000, Math.round(reloadInterval));\n _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n this.timer = setTimeout(this.ontick, reloadInterval);\n } else {\n this.timer = null;\n }\n }\n }\n }, {\n key: 'tick',\n value: function tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId],\n urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\n }\n }, {\n key: 'levels',\n get: function get() {\n return this._levels;\n }\n }, {\n key: 'level',\n get: function get() {\n return this._level;\n },\n set: function set(newLevel) {\n var levels = this._levels;\n if (levels && levels.length > newLevel) {\n if (this._level !== newLevel || levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n }\n }, {\n key: 'manualLevel',\n get: function get() {\n return this._manualLevel;\n },\n set: function set(newLevel) {\n this._manualLevel = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: 'firstLevel',\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: 'startLevel',\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n // if not in autostart level, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, this.hls.abrController.minAutoLevel);\n }\n this._startLevel = newLevel;\n }\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.abrController.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45}],12:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_LEVEL: 'WAITING_LEVEL',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar StreamController = function (_EventHandler) {\n _inherits(StreamController, _EventHandler);\n\n function StreamController(hls) {\n _classCallCheck(this, StreamController);\n\n var _this = _possibleConstructorReturn(this, (StreamController.__proto__ || Object.getPrototypeOf(StreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_SWITCHED, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(StreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.levels) {\n var lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.level = -1;\n this.fragLoadError = 0;\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n _logger.logger.warn('cannot start loading as manifest not parsed yet');\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n // when this returns false there was an error and we shall return immediatly\n // from current tick\n if (!this._doTickIdle()) {\n return;\n }\n break;\n case State.WAITING_LEVEL:\n var level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n // check buffer\n this._checkBuffer();\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\n }, {\n key: '_doTickIdle',\n value: function _doTickIdle() {\n var hls = this.hls,\n config = hls.config,\n media = this.media;\n\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return true;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n var pos = void 0;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n var level = hls.nextLoadLevel,\n levelInfo = this.levels[level],\n levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\n // determine next candidate fragment to be loaded, based on current position and end of buffer position\n // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\n var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len;\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return true;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\n // set next load level : this will trigger a playlist load if needed\n this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n this.state = State.WAITING_LEVEL;\n return true;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // if everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference\n // using half frag duration should help cope with these cases.\n // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/dailymotion/hls.js/pull/657\n if (media.duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration / 2)) {\n // Finalize the media stream\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_EOS, data);\n this.state = State.ENDED;\n return true;\n }\n }\n\n // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n return this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n var fragPrevious = this.fragPrevious,\n level = this.level,\n fragments = levelDetails.fragments,\n fragLen = fragments.length;\n\n // empty playlist\n if (fragLen === 0) {\n return false;\n }\n\n // find fragment index, contiguous with end of buffer position\n var start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n bufferEnd = bufferInfo.end,\n frag = void 0;\n\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return false;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return false;\n }\n } else {\n // VoD playlist: if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n }\n }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n return this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return true;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n var config = this.hls.config,\n media = this.media;\n\n var frag = void 0;\n\n // check if requested position is within seekable boundaries :\n //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {\n var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n bufferEnd = liveSyncPosition;\n if (media && media.readyState && media.duration > liveSyncPosition) {\n media.currentTime = liveSyncPosition;\n }\n }\n\n // if end of buffer greater than live edge, don't load any fragment\n // this could happen if live playlist intermittently slides in the past.\n // level 1 loaded [182580161,182580167]\n // level 1 loaded [182580162,182580169]\n // Loading 182580168 of [182580162 ,182580169],level 1 ..\n // Loading 182580169 of [182580162 ,182580169],level 1 ..\n // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n // level 1 loaded [182580164,182580171]\n //\n // don't return null in case media not loaded yet (readystate === 0)\n if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n return null;\n }\n\n if (this.startFragRequested && !levelDetails.PTSKnown) {\n /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n try to load frag matching with next SN.\n even if SN are not synchronized between playlists, loading this frag will help us\n compute playlist sliding and find the right one after in case it was not the right consecutive one */\n if (fragPrevious) {\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n }\n }\n if (!frag) {\n /* we have no idea about which fragment should be loaded.\n so let's load mid fragment. it will help computing playlist sliding and find the right one\n */\n frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n }\n }\n return frag;\n }\n }, {\n key: '_findFragment',\n value: function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n\n var frag = void 0,\n foundFrag = void 0,\n maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS,\n curSNIdx = frag.sn - levelDetails.startSN;\n // if there is a significant delta between audio and video, larger than max allowed hole,\n // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n // let's try to load previous fragment again to get last keyframe\n // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n frag = fragments[curSNIdx - 1];\n _logger.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');\n // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n fragPrevious.loadCounter--;\n } else {\n frag = fragments[curSNIdx + 1];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n var hls = this.hls,\n config = hls.config;\n\n //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return false;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n this.nextLoadPosition = frag.start + frag.duration;\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return true;\n }\n }\n }, {\n key: 'getBufferRange',\n value: function getBufferRange(position) {\n return _binarySearch2.default.search(this.bufferRange, function (range) {\n if (position < range.start) {\n return -1;\n } else if (position > range.end) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferRange',\n value: function followingBufferRange(range) {\n if (range) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferRange(range.end + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var rangeCurrent,\n currentTime,\n video = this.media;\n if (video && video.readyState && video.seeking === false) {\n currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n if (currentTime > video.playbackRate * this.lastCurrentTime) {\n this.lastCurrentTime = currentTime;\n }\n if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n rangeCurrent = this.getBufferRange(currentTime + 0.1);\n }\n if (rangeCurrent) {\n var fragPlaying = rangeCurrent.frag;\n if (fragPlaying !== this.fragPlaying) {\n this.fragPlaying = fragPlaying;\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n }\n }\n }\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */\n\n }, {\n key: 'immediateLevelSwitch',\n value: function immediateLevelSwitch() {\n _logger.logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n var media = this.media,\n previouslyPaused = void 0;\n if (media) {\n previouslyPaused = media.paused;\n media.pause();\n } else {\n // don't restart playback after instant level switch in case media not attached\n previouslyPaused = true;\n }\n this.previouslyPaused = previouslyPaused;\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n - resume the playback if needed\n */\n\n }, {\n key: 'immediateLevelSwitchEnd',\n value: function immediateLevelSwitchEnd() {\n var media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n // only nudge if currentTime is buffered\n media.currentTime -= 0.0001;\n }\n if (!this.previouslyPaused) {\n media.play();\n }\n }\n }\n }, {\n key: 'nextLevelSwitch',\n value: function nextLevelSwitch() {\n /* try to switch ASAP without breaking video playback :\n in order to ensure smooth but quick level switching,\n we need to find the next flushable buffer range\n we should take into account new segment fetch time\n */\n var media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n var fetchdelay = void 0,\n currentRange = void 0,\n nextRange = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n currentRange = this.getBufferRange(media.currentTime);\n if (currentRange && currentRange.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.flushMainBuffer(0, currentRange.start - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,\n nextLevel = this.levels[nextLevelId],\n fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n //logger.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n if (nextRange) {\n // we can flush buffer range following this one without stalling playback\n nextRange = this.followingBufferRange(nextRange);\n if (nextRange) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush position is the start position of this new buffer\n this.flushMainBuffer(nextRange.start, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('seeked', this.onvseeked);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var levels = this.levels;\n if (levels) {\n // reset fragment load counter\n levels.forEach(function (level) {\n if (level.details) {\n level.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('seeked', this.onvseeked);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined,\n config = this.config;\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n if (this.state === State.FRAG_LOADING) {\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole),\n fragCurrent = this.fragCurrent;\n // check if we are seeking to a unbuffered area AND if frag loading is in progress\n if (bufferInfo.len === 0 && fragCurrent) {\n var tolerance = config.maxFragLookUpTolerance,\n fragStartOffset = fragCurrent.start - tolerance,\n fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n if (fragCurrent.loader) {\n _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n } else {\n _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n _logger.logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset buffer on manifest loading\n _logger.logger.log('trigger BUFFER_RESET');\n this.hls.trigger(_events2.default.BUFFER_RESET);\n this.bufferRange = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var aac = false,\n heaac = false,\n codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac;\n if (this.audioCodecSwitch) {\n _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragRequested = false;\n var config = this.config;\n if (config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n this.levelLastLoaded = newLevelId;\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n // override level info\n curLevel.details = newDetails;\n this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n if (this.startFragRequested === false) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = this.computeLivePosition(sliding, newDetails);\n _logger.logger.log('configure startPosition to ' + this.startPosition);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n // reset frag bitrate test in any case after frag loaded event\n this.bitrateTest = false;\n // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n // then this means that we should be able to load a fragment at a higher quality level\n if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = State.IDLE;\n this.startFragRequested = false;\n stats.tparsed = stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = stats;\n var duration = details.totalduration,\n start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec === undefined) {\n audioCodec = this.lastAudioCodec;\n }\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n }\n this.pendingBuffering = true;\n this.appended = false;\n _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n var demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n }\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, null);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n trackName,\n track;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (tracks.audio && this.altAudio) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n var audioCodec = this.levels[this.level].audioCodec,\n ua = navigator.userAgent.toLowerCase();\n if (audioCodec && this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // in case AAC and HE-AAC audio codecs are signalled in manifest\n // force HE-AAC , as it seems that most browsers prefers that way,\n // except for mono streams OR on FF\n // these conditions might need to be reviewed ...\n if (this.audioCodecSwitch) {\n // don't force HE-AAC if mono stream\n if (track.metadata.channelCount !== 1 &&\n // don't force HE-AAC if firefox\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n _logger.logger.log('Android: force audio codec to ' + audioCodec);\n }\n track.levelCodec = audioCodec;\n track.id = data.id;\n }\n track = tracks.video;\n if (track) {\n track.levelCodec = this.levels[this.level].videoCodec;\n track.id = data.id;\n }\n\n // if remuxer specify that a unique track needs to generated,\n // let's merge all tracks together\n if (data.unique) {\n var mergedTrack = {\n codec: '',\n levelCodec: ''\n };\n for (trackName in data.tracks) {\n track = tracks[trackName];\n mergedTrack.container = track.container;\n if (mergedTrack.codec) {\n mergedTrack.codec += ',';\n mergedTrack.levelCodec += ',';\n }\n if (track.codec) {\n mergedTrack.codec += track.codec;\n }\n if (track.levelCodec) {\n mergedTrack.levelCodec += track.levelCodec;\n }\n }\n tracks = { audiovideo: mergedTrack };\n }\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n for (trackName in tracks) {\n track = tracks[trackName];\n _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n\n _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n hls = this.hls;\n hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n }\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent.loader) {\n _logger.logger.log('switching to main audio track, cancel main fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // destroy demuxer to force init segment generation (following audio switch)\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var tracks = data.tracks,\n mediaTrack = void 0,\n name = void 0,\n alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n this.videoBuffer = tracks[type].buffer;\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'main') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n var _this3 = this;\n\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n (function () {\n var media = _this3.mediaBuffer ? _this3.mediaBuffer : _this3.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter potentially evicted bufferRange. this is to avoid memleak on live streams\n var bufferRange = _this3.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n // push new range\n bufferRange.push({ type: frag.type, start: frag.startPTS, end: frag.endPTS, frag: frag });\n // sort, as we use BinarySearch for lookup in getBufferRange ...\n _this3.bufferRange = bufferRange.sort(function (a, b) {\n return a.start - b.start;\n });\n _this3.fragPrevious = frag;\n var stats = _this3.stats;\n stats.tbuffered = performance.now();\n // we should get rid of this.fragLastKbps\n _this3.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n _this3.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n _this3.state = State.IDLE;\n })();\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag || this.fragCurrent;\n // don't handle frag error not related to main fragment\n if (frag && frag.type !== 'main') {\n return;\n }\n var media = this.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n if (!data.fatal) {\n // if buffer is not empty\n if (mediaBuffered) {\n // try to reduce max buffer length : rationale is that we could get\n // frag loop loading error because of buffer eviction\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // buffer empty. report as fatal if in manual mode or if lowest level.\n // level controller takes care of emergency switch down logic\n if (!frag.autoLevel || frag.level === 0) {\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n }\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in cas of non fatal error while waiting level load to be completed, switch back to IDLE\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (this.state === State.PARSING || this.state === State.PARSED) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n // in that case flush the whole buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: '_reduceMaxBufferLength',\n value: function _reduceMaxBufferLength(minLength) {\n var config = this.config;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n }, {\n key: '_checkBuffer',\n value: function _checkBuffer() {\n var media = this.media;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if (media && media.readyState) {\n var currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.buffered;\n // adjust currentTime to start position on loaded metadata\n if (!this.loadedmetadata && buffered.length && !media.seeking) {\n this.loadedmetadata = true;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n var startPosition = this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n _logger.logger.log('target start position:' + startPosition);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if (!startPositionBuffered) {\n startPosition = buffered.start(0);\n _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n }\n _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n expectedPlaying = !(media.paused || // not playing when media is paused\n media.ended || // not playing when media is ended\n media.buffered.length === 0),\n // not playing if nothing buffered\n jumpThreshold = 0.5,\n // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart,\n delta = nextBufferStart - currentTime;\n if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\n }\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoadEmergencyAborted',\n value: function onFragLoadEmergencyAborted() {\n this.state = State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferRange\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this.bufferRange = this.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n }, {\n key: 'computeLivePosition',\n value: function computeLivePosition(sliding, levelDetails) {\n var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('main stream:' + previousState + '->' + nextState);\n this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n }\n },\n get: function get() {\n return this._state;\n }\n }, {\n key: 'currentLevel',\n get: function get() {\n var media = this.media;\n if (media) {\n var range = this.getBufferRange(media.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferRange',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this._liveSyncPosition;\n },\n set: function set(value) {\n this._liveSyncPosition = value;\n }\n }]);\n\n return StreamController;\n}(_eventHandler2.default);\n\nexports.default = StreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],13:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(42);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Timeline Controller\n */\n\nvar TimelineController = function (_EventHandler) {\n _inherits(TimelineController, _EventHandler);\n\n function TimelineController(hls) {\n _classCallCheck(this, TimelineController);\n\n var _this = _possibleConstructorReturn(this, (TimelineController.__proto__ || Object.getPrototypeOf(TimelineController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack1) {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1) {\n self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n self.textTrack1.textTrack1 = true;\n } else {\n self.textTrack1 = existingTrack1;\n self.clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n }\n };\n\n var channel2 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack2) {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2) {\n self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n self.textTrack2.textTrack2 = true;\n } else {\n self.textTrack2 = existingTrack2;\n self.clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n }\n };\n\n _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n }\n return _this;\n }\n\n _createClass(TimelineController, [{\n key: 'clearCurrentCues',\n value: function clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n }\n }, {\n key: 'getExistingTrack',\n value: function getExistingTrack(channelNumber) {\n var media = this.media;\n if (media) {\n for (var i = 0; i < media.textTracks.length; i++) {\n var textTrack = media.textTracks[i];\n var propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n }, {\n key: 'createTextTrack',\n value: function createTextTrack(kind, label, lang) {\n if (this.media) {\n return this.media.addTextTrack(kind, label, lang);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media;\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastPts = Number.NEGATIVE_INFINITY;\n }\n }, {\n key: 'onLevelSwitch',\n value: function onLevelSwitch() {\n if (this.hls.currentLevel.closedCaptions === 'NONE') {\n this.enabled = false;\n } else {\n this.enabled = true;\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n if (data.frag.type === 'main') {\n var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n // if this is a frag for a previously loaded timerange, remove all captions\n // TODO: consider just removing captions for the timerange\n if (pts <= this.lastPts) {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n this.lastPts = pts;\n }\n }\n }, {\n key: 'onFragParsingUserdata',\n value: function onFragParsingUserdata(data) {\n // push all of the CEA-708 messages into the interpreter\n // immediately. It will create the proper timestamps based on our PTS value\n if (this.enabled && this.config.enableCEA708Captions) {\n for (var i = 0; i < data.samples.length; i++) {\n var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n }\n }\n }\n }, {\n key: 'extractCea608Data',\n value: function extractCea608Data(byteArray) {\n var count = byteArray[0] & 31;\n var position = 2;\n var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n var actualCCBytes = [];\n\n for (var j = 0; j < count; j++) {\n tmpByte = byteArray[position++];\n ccbyte1 = 0x7F & byteArray[position++];\n ccbyte2 = 0x7F & byteArray[position++];\n ccValid = (4 & tmpByte) === 0 ? false : true;\n ccType = 3 & tmpByte;\n\n if (ccbyte1 === 0 && ccbyte2 === 0) {\n continue;\n }\n\n if (ccValid) {\n if (ccType === 0) // || ccType === 1\n {\n actualCCBytes.push(ccbyte1);\n actualCCBytes.push(ccbyte2);\n }\n }\n }\n return actualCCBytes;\n }\n }]);\n\n return TimelineController;\n}(_eventHandler2.default);\n\nexports.default = TimelineController;\n\n},{\"27\":27,\"28\":28,\"42\":42}],14:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],15:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n this.subMix = [];\n this.subMix[0] = new Uint32Array(256);\n this.subMix[1] = new Uint32Array(256);\n this.subMix[2] = new Uint32Array(256);\n this.subMix[3] = new Uint32Array(256);\n\n this.invSubMix = [];\n this.invSubMix[0] = new Uint32Array(256);\n this.invSubMix[1] = new Uint32Array(256);\n this.invSubMix[2] = new Uint32Array(256);\n this.invSubMix[3] = new Uint32Array(256);\n\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix0 = this.subMix[0];\n var subMix1 = this.subMix[1];\n var subMix2 = this.subMix[2];\n var subMix3 = this.subMix[3];\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(this.ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(this.ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n\n while (offset < inputInt32.length) {\n inputWords0 = this.networkToHostOrderSwap(inputInt32[offset]);\n inputWords1 = this.networkToHostOrderSwap(inputInt32[offset + 1]);\n inputWords2 = this.networkToHostOrderSwap(inputInt32[offset + 2]);\n inputWords3 = this.networkToHostOrderSwap(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = this.networkToHostOrderSwap(t0 ^ initVector0);\n outputInt32[offset + 1] = this.networkToHostOrderSwap(t3 ^ initVector1);\n outputInt32[offset + 2] = this.networkToHostOrderSwap(t2 ^ initVector2);\n outputInt32[offset + 3] = this.networkToHostOrderSwap(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],16:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _aesCrypto = _dereq_(14);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(17);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(15);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n _logger.logger.log('JS AES decrypt');\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n (function () {\n _logger.logger.log('WebCrypto AES decrypt');\n var subtle = _this.subtle;\n if (_this.key !== key) {\n _this.key = key;\n _this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n _this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n })();\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"14\":14,\"15\":15,\"17\":17,\"26\":26,\"45\":45}],17:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],18:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * AAC demuxer\n */\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(45);\n\nvar _id = _dereq_(24);\n\nvar _id2 = _interopRequireDefault(_id);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AACDemuxer = function () {\n function AACDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n this.insertDiscontinuity();\n }\n\n _createClass(AACDemuxer, [{\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0 };\n }\n }, {\n key: 'push',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var track,\n id3 = new _id2.default(data),\n pts = 90 * id3.timeStamp,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n\n var contiguous = false;\n if (cc !== this.lastCC) {\n _logger.logger.log(this.id + ' discontinuity detected');\n this.lastCC = cc;\n this.insertDiscontinuity();\n this.remuxer.switchLevel();\n this.remuxer.insertDiscontinuity();\n } else if (level !== this.lastLevel) {\n _logger.logger.log('audio track switch detected');\n this.lastLevel = level;\n this.remuxer.switchLevel();\n this.insertDiscontinuity();\n } else if (sn === this.lastSN + 1) {\n contiguous = true;\n }\n track = this._aacTrack;\n this.lastSN = sn;\n this.lastLevel = level;\n\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(level, sn, cc, track, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n // check if data contains ID3 timestamp and ADTS sync worc\n var id3 = new _id2.default(data),\n offset,\n len;\n if (id3.hasTimeStamp) {\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return AACDemuxer;\n}();\n\nexports.default = AACDemuxer;\n\n},{\"19\":19,\"24\":24,\"45\":45}],19:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ADTS parser helper\n */\n\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ADTS = function () {\n function ADTS() {\n _classCallCheck(this, ADTS);\n }\n\n _createClass(ADTS, null, [{\n key: 'getAudioConfig',\n value: function getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType,\n // :int\n adtsSampleingIndex,\n // :int\n adtsExtensionSampleingIndex,\n // :int\n adtsChanelConfig,\n // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n return;\n }\n adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/i.test(userAgent)) {\n if (adtsSampleingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi/Opera ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n config[1] |= (adtsSampleingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChanelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSampleingIndex\n config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };\n }\n }]);\n\n return ADTS;\n}();\n\nexports.default = ADTS;\n\n},{\"26\":26,\"45\":45}],20:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _decrypter = _dereq_(16);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(18);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _tsdemuxer = _dereq_(25);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp4Remuxer = _dereq_(38);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(39);\n\nvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DemuxerInline = function () {\n function DemuxerInline(hls, id, typeSupported) {\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, DemuxerInline);\n\n this.hls = hls;\n this.id = id;\n this.config = this.hls.config || config;\n this.typeSupported = typeSupported;\n }\n\n _createClass(DemuxerInline, [{\n key: 'destroy',\n value: function destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n if (this.decrypter == null) {\n this.decrypter = new _decrypter2.default(this.hls, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n this.decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.hls.trigger(_events2.default.FRAG_DECRYPTED, { level: level, sn: sn, stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n cc !== this.cc && !demuxer.probe(data)) {\n var hls = this.hls,\n id = this.id,\n config = this.config,\n typeSupported = this.typeSupported;\n // probe for content type\n if (_tsdemuxer2.default.probe(data)) {\n if (this.typeSupported.mp2t === true) {\n demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, config, typeSupported);\n } else {\n demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n }\n demuxer.probe = _tsdemuxer2.default.probe;\n } else if (_aacdemuxer2.default.probe(data)) {\n demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n demuxer.probe = _aacdemuxer2.default.probe;\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n this.cc = cc;\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"16\":16,\"18\":18,\"25\":25,\"26\":26,\"28\":28,\"38\":38,\"39\":39}],21:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* demuxer web worker.\n * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n */\n\nvar DemuxerWorker = function DemuxerWorker(self) {\n // observer setup\n var observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({ event: ev, data: data });\n };\n\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n //console.log('demuxer cmd:' + data.cmd);\n switch (data.cmd) {\n case 'init':\n var config = JSON.parse(data.config);\n self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n try {\n (0, _logger.enableLogs)(config.debug === true);\n } catch (err) {\n console.warn('demuxerWorker: unable to enable logs');\n }\n // signal end of worker init\n forwardMessage('init', null);\n break;\n case 'demux':\n self.demuxer.push(data.data, data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.decryptdata, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n observer.on(_events2.default.ERROR, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n var data1 = data.data1.buffer,\n data2 = data.data2.buffer;\n // remove data1 and data2 reference from data to avoid copying them ...\n delete data.data1;\n delete data.data2;\n self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"20\":20,\"28\":28,\"45\":45}],22:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(21);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Demuxer = function () {\n function Demuxer(hls, id) {\n _classCallCheck(this, Demuxer);\n\n this.hls = hls;\n this.id = id;\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\n w = this.w = work(_demuxerWorker2.default);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function (event) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n };\n w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n } catch (err) {\n _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n if (w) {\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(w.objectURL);\n }\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n this.demuxInitialized = true;\n }\n\n _createClass(Demuxer, [{\n key: 'destroy',\n value: function destroy() {\n var w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, decryptdata: decryptdata, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, [data]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS);\n }\n }\n }\n }, {\n key: 'onWorkerMessage',\n value: function onWorkerMessage(ev) {\n var data = ev.data,\n hls = this.hls;\n //console.log('onWorkerMessage:' + data.event);\n switch (data.event) {\n case 'init':\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(this.w.objectURL);\n break;\n // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n case _events2.default.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n data.data.data2 = new Uint8Array(data.data2);\n /* falls through */\n default:\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"20\":20,\"21\":21,\"26\":26,\"28\":28,\"3\":3,\"45\":45}],23:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ExpGolomb = function () {\n function ExpGolomb(data) {\n _classCallCheck(this, ExpGolomb);\n\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n\n\n _createClass(ExpGolomb, [{\n key: 'loadWord',\n value: function loadWord() {\n var data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n\n }, {\n key: 'skipBits',\n value: function skipBits(count) {\n var skipBytes; // :int\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes >> 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n\n }, {\n key: 'readBits',\n value: function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size),\n // :uint\n valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _logger.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n\n }, {\n key: 'skipLZ',\n value: function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n\n }, {\n key: 'skipUEG',\n value: function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n\n }, {\n key: 'skipEG',\n value: function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n\n }, {\n key: 'readUEG',\n value: function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n\n }, {\n key: 'readEG',\n value: function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n\n }, {\n key: 'readBoolean',\n value: function readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n\n }, {\n key: 'readUByte',\n value: function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n\n }, {\n key: 'readUShort',\n value: function readUShort() {\n return this.readBits(16);\n }\n // ():int\n\n }, {\n key: 'readUInt',\n value: function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n }, {\n key: 'skipScalingList',\n value: function skipScalingList(count) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n }, {\n key: 'readSPS',\n value: function readSPS() {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\n };\n }\n }, {\n key: 'readSliceType',\n value: function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;\n\n},{\"45\":45}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ID3 parser\n */\n\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n//import Hex from '../utils/hex';\n\nvar ID3 = function () {\n function ID3(data) {\n _classCallCheck(this, ID3);\n\n this._hasTimeStamp = false;\n var offset = 0,\n byte1,\n byte2,\n byte3,\n byte4,\n tagSize,\n endPos,\n header,\n len;\n do {\n header = this.readUTF(data, offset, 3);\n offset += 3;\n // first check for ID3 header\n if (header === 'ID3') {\n // skip 24 bits\n offset += 3;\n // retrieve tag(s) length\n byte1 = data[offset++] & 0x7f;\n byte2 = data[offset++] & 0x7f;\n byte3 = data[offset++] & 0x7f;\n byte4 = data[offset++] & 0x7f;\n tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n endPos = offset + tagSize;\n //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\n // read ID3 tags\n this._parseID3Frames(data, offset, endPos);\n offset = endPos;\n } else if (header === '3DI') {\n // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n offset += 7;\n _logger.logger.log('3DI footer found, end: ' + offset);\n } else {\n offset -= 3;\n len = offset;\n if (len) {\n //logger.log(`ID3 len: ${len}`);\n if (!this.hasTimeStamp) {\n _logger.logger.warn('ID3 tag found, but no timestamp');\n }\n this._length = len;\n this._payload = data.subarray(0, len);\n }\n return;\n }\n } while (true);\n }\n\n _createClass(ID3, [{\n key: 'readUTF',\n value: function readUTF(data, start, len) {\n\n var result = '',\n offset = start,\n end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while (offset < end);\n return result;\n }\n }, {\n key: '_parseID3Frames',\n value: function _parseID3Frames(data, offset, endPos) {\n var tagId, tagLen, tagStart, tagFlags, timestamp;\n while (offset + 8 <= endPos) {\n tagId = this.readUTF(data, offset, 4);\n offset += 4;\n\n tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\n tagFlags = data[offset++] << 8 + data[offset++];\n\n tagStart = offset;\n //logger.log(\"ID3 tag id:\" + tagId);\n switch (tagId) {\n case 'PRIV':\n //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n offset += 44;\n // smelling even better ! we found the right descriptor\n // skip null character (string end) + 3 first bytes\n offset += 4;\n\n // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n var pts33Bit = data[offset++] & 0x1;\n this._hasTimeStamp = true;\n\n timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: 'hasTimeStamp',\n get: function get() {\n return this._hasTimeStamp;\n }\n }, {\n key: 'timeStamp',\n get: function get() {\n return this._timeStamp;\n }\n }, {\n key: 'length',\n get: function get() {\n return this._length;\n }\n }, {\n key: 'payload',\n get: function get() {\n return this._payload;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\n\n},{\"45\":45}],25:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n// import Hex from '../utils/hex';\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(23);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TSDemuxer = function () {\n function TSDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.typeSupported = typeSupported;\n this.lastCC = 0;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n }\n\n _createClass(TSDemuxer, [{\n key: 'switchLevel',\n value: function switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.remuxer.switchLevel();\n }\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n codecsOnly = this.remuxer.passthrough,\n unknownPIDs = false;\n\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n this.contiguous = false;\n this.accurateTimeOffset = accurateTimeOffset;\n if (cc !== this.lastCC) {\n _logger.logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n }\n if (level !== this.lastLevel) {\n _logger.logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n } else if (sn === this.lastSN + 1) {\n this.contiguous = true;\n }\n this.lastSN = sn;\n\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.pesData,\n id3Data = id3Track.pesData,\n parsePAT = this._parsePAT,\n parsePMT = this._parsePMT,\n parsePES = this._parsePES,\n parseAVCPES = this._parseAVCPES.bind(this),\n parseAACPES = this._parseAACPES.bind(this),\n parseMPEGPES = this._parseMPEGPES.bind(this),\n parseID3PES = this._parseID3PES.bind(this);\n\n // don't parse last TS packet if incomplete\n len -= len % 188;\n // loop through TS packets\n for (start = 0; start < len; start += 188) {\n if (data[start] === 0x47) {\n stt = !!(data[start + 1] & 0x40);\n // pid is a 13-bit field starting at the last bit of TS[1]\n pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n atf = (data[start + 3] & 0x30) >> 4;\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + 188) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, false);\n if (codecsOnly) {\n // if we have video codec info AND\n // if audio PID is undefined OR if we have audio codec info,\n // we have all codec info !\n if (avcTrack.codec && (audioId === -1 || audioTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n avcData = { data: [], size: 0 };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + 188));\n avcData.size += start + 188 - offset;\n }\n break;\n case audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n if (codecsOnly) {\n // here we now that we have audio codec info\n // if video PID is undefined OR if we have video codec info,\n // we have all codec infos !\n if (audioTrack.codec && (avcId === -1 || avcTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.size += start + 188 - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n }\n id3Data = { data: [], size: 0 };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + 188));\n id3Data.size += start + 188 - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n break;\n case pmtId:\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n _logger.logger.log('reparse from beginning');\n unknownPIDs = false;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = -188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n case 17:\n case 0x1fff:\n break;\n default:\n unknownPIDs = true;\n break;\n }\n } else {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n }\n }\n // try to parse last PES packets\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, true);\n avcTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n avcTrack.pesData = avcData;\n }\n\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\n }\n\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n this.remux(level, sn, cc, null, timeOffset, defaultInitPTS);\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, data, timeOffset, defaultInitPTS) {\n var avcTrack = this._avcTrack,\n samples = avcTrack.samples,\n nbNalu = 0,\n naluLen = 0;\n\n // compute total/avc sample length and nb of NAL units\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i],\n units = sample.units.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n }\n avcTrack.len = naluLen;\n avcTrack.nbNalu = nbNalu;\n this.remuxer.remux(level, sn, cc, this._audioTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, defaultInitPTS, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n }, {\n key: '_parsePAT',\n value: function _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n }, {\n key: '_parsePMT',\n value: function _parsePMT(data, offset, mpegSupported) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\n sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n switch (data[offset]) {\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n case 0x0f:\n //logger.log('AAC PID:' + pid);\n if (result.audio === -1) {\n result.audio = pid;\n }\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n case 0x1b:\n //logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n default:\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n }\n return result;\n }\n }, {\n key: '_parsePES',\n value: function _parsePES(stream) {\n var i = 0,\n frag,\n pesFlags,\n pesPrefix,\n pesLen,\n pesHdrLen,\n pesData,\n pesPts,\n pesDts,\n payloadStartOffset,\n data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n //retrieve PTS/DTS from first fragment\n frag = data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen > stream.size - 6) {\n return null;\n }\n pesFlags = frag[7];\n if (pesFlags & 0xC0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n (frag[10] & 0xFF) * 4194304 + // 1 << 22\n (frag[11] & 0xFE) * 16384 + // 1 << 14\n (frag[12] & 0xFF) * 128 + // 1 << 7\n (frag[13] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesPts > 4294967295) {\n // decrement 2^33\n pesPts -= 8589934592;\n }\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n (frag[15] & 0xFF) * 4194304 + // 1 << 22\n (frag[16] & 0xFE) * 16384 + // 1 << 14\n (frag[17] & 0xFF) * 128 + // 1 << 7\n (frag[18] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesDts > 4294967295) {\n // decrement 2^33\n pesDts -= 8589934592;\n }\n if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n payloadStartOffset = pesHdrLen + 9;\n\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n } else {\n return null;\n }\n }\n }, {\n key: 'pushAccesUnit',\n value: function pushAccesUnit(avcSample, avcTrack) {\n if (avcSample.units.units.length && avcSample.frame) {\n // only push AVC sample if starting with a keyframe is not mandatory OR\n // if keyframe already found in this fragment OR\n // keyframe found in last fragment (track.sps) AND\n // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n avcTrack.samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if (avcSample.debug.length) {\n _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n }\n }\n }, {\n key: '_parseAVCPES',\n value: function _parseAVCPES(pes, last) {\n var _this = this;\n\n //logger.log('parse new PES');\n var track = this._avcTrack,\n units = this._parseAVCNALu(pes.data),\n debug = false,\n expGolombDecoder,\n avcSample = this.avcSample,\n push,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(function (unit) {\n switch (unit.type) {\n //NDR\n case 1:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var data = unit.data;\n if (data.length > 4) {\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\n }\n break;\n //IDR\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\n // skip frameType\n expGolombDecoder.readUByte();\n\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n\n while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n payloadType = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadType += b;\n } while (b === 0xFF);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadSize += b;\n } while (b === 0xFF);\n\n // TODO: there can be more than one payload in an SEI packet...\n // TODO: need to read type and size in a while loop to get them all\n if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\n endOfCaptions = true;\n\n var countryCode = expGolombDecoder.readUByte();\n\n if (countryCode === 181) {\n var providerCode = expGolombDecoder.readUShort();\n\n if (providerCode === 49) {\n var userStructure = expGolombDecoder.readUInt();\n\n if (userStructure === 0x47413934) {\n var userDataType = expGolombDecoder.readUByte();\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = expGolombDecoder.readUByte();\n var secondByte = expGolombDecoder.readUByte();\n\n var totalCCs = 31 & firstByte;\n var byteArray = [firstByte, secondByte];\n\n for (i = 0; i < totalCCs; i++) {\n // 3 bytes per CC\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n }\n\n _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n }\n }\n }\n }\n } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n for (i = 0; i < payloadSize; i++) {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n expGolombDecoder = new _expGolomb2.default(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n //PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n if (avcSample) {\n _this.pushAccesUnit(avcSample, track);\n }\n avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = false;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n this.pushAccesUnit(avcSample, track);\n this.avcSample = null;\n }\n }\n }, {\n key: '_createAVCSample',\n value: function _createAVCSample(key, pts, dts, debug) {\n return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n }\n }, {\n key: '_insertSampleInOrder',\n value: function _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len - 1].pts) {\n arr.push(data);\n } else {\n for (var pos = len - 1; pos >= 0; pos--) {\n if (data.pts < arr[pos].pts) {\n arr.splice(pos, 0, data);\n break;\n }\n }\n }\n } else {\n arr.push(data);\n }\n }\n }, {\n key: '_getLastNalUnit',\n value: function _getLastNalUnit() {\n var avcSample = this.avcSample,\n lastUnit = void 0;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.units.length === 0) {\n var track = this._avcTrack,\n samples = track.samples;\n avcSample = samples[samples.length - 1];\n }\n if (avcSample) {\n var units = avcSample.units.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n }, {\n key: '_parseAVCNALu',\n value: function _parseAVCNALu(array) {\n var i = 0,\n len = array.byteLength,\n value,\n overflow,\n track = this._avcTrack,\n state = track.naluState || 0,\n lastState = state;\n var units = [],\n unit,\n unitType,\n lastUnitStart = -1,\n lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -1) {\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n //logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n units.push(unit);\n //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this._getLastNalUnit();\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n }\n\n /**\n * remove Emulation Prevention bytes from a RBSP\n */\n\n }, {\n key: 'discardEPB',\n value: function discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength,\n newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - EPBPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }\n }, {\n key: '_parseAACPES',\n value: function _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n if (aacOverFlow) {\n var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n tmp.set(aacOverFlow, 0);\n tmp.set(data, aacOverFlow.byteLength);\n //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset) {\n var reason, fatal;\n if (offset < len - 1) {\n reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _logger.logger.warn('parsing error:' + reason);\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n var audioCodec = this.audioCodec;\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = this._duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n if (aacOverFlow && aacLastPTS) {\n var newPTS = aacLastPTS + frameDuration;\n if (Math.abs(newPTS - pts) > 1) {\n _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n pts = newPTS;\n }\n }\n\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n if (offset < len) {\n aacOverFlow = data.subarray(offset, len);\n //logger.log(`AAC: overflow detected:${len-offset}`);\n } else {\n aacOverFlow = null;\n }\n this.aacOverFlow = aacOverFlow;\n this.aacLastPTS = stamp;\n }\n }, {\n key: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n var data = pes.data;\n var pts = pes.pts;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var parsed;\n\n while (offset < length && (parsed = this._parseMpeg(data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n }, {\n key: '_onMpegFrame',\n value: function _onMpegFrame(data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 / sampleRate * 1000;\n var stamp = pts + frameIndex * frameDuration;\n var track = this._audioTrack;\n\n track.config = [];\n track.channelCount = channelCount;\n track.audiosamplerate = sampleRate;\n track.duration = this._duration;\n track.samples.push({ unit: data, pts: stamp, dts: stamp });\n track.len += data.length;\n }\n }, {\n key: '_onMpegNoise',\n value: function _onMpegNoise(data) {\n _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n }\n }, {\n key: '_parseMpeg',\n value: function _parseMpeg(data, start, end, frameIndex, pts) {\n var 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];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = data[start + 1] >> 3 & 3;\n var headerC = data[start + 1] >> 1 & 3;\n var headerE = data[start + 2] >> 4 & 15;\n var headerF = data[start + 2] >> 2 & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n if (start + frameLength > end) {\n return -1;\n }\n if (this._onMpegFrame) {\n this._onMpegFrame(data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n }\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n if (this._onMpegNoise) {\n this._onMpegNoise(data.subarray(start, offset - 1));\n }\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n }\n }, {\n key: '_parseID3PES',\n value: function _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n }], [{\n key: 'probe',\n value: function probe(data) {\n // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n return true;\n } else {\n return false;\n }\n }\n }]);\n\n return TSDemuxer;\n}();\n\nexports.default = TSDemuxer;\n\n},{\"19\":19,\"23\":23,\"26\":26,\"28\":28,\"45\":45}],26:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ErrorTypes = exports.ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'networkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'mediaError',\n // Identifier for a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nvar ErrorDetails = exports.ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n MANIFEST_PARSING_ERROR: 'manifestParsingError',\n // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n LEVEL_SWITCH_ERROR: 'levelSwitchError',\n // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n FRAG_LOAD_ERROR: 'fragLoadError',\n // Identifier for fragment loop loading error - data: { frag : fragment object}\n FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n // Identifier for fragment load timeout error - data: { frag : fragment object}\n FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n // Identifier for a fragment decryption error event - data: parsing error description\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a remux alloc error event - data: { id : demuxer Id, bytes : nb of bytes on which allocation failed , reason : error text }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\n // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n KEY_LOAD_ERROR: 'keyLoadError',\n // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n // Identifier for a buffer append error - data: append error description\n BUFFER_APPEND_ERROR: 'bufferAppendError',\n // Identifier for a buffer appending error event - data: appending error description\n BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n // Identifier for a buffer stalled error event\n BUFFER_STALLED_ERROR: 'bufferStalledError',\n // Identifier for a buffer full event\n BUFFER_FULL_ERROR: 'bufferFullError',\n // Identifier for a buffer seek over hole event\n BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException'\n};\n\n},{}],27:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * All objects in the event handling chain should inherit from this class\n *\n */\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventHandler = function () {\n function EventHandler(hls) {\n _classCallCheck(this, EventHandler);\n\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n\n for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n _createClass(EventHandler, [{\n key: 'destroy',\n value: function destroy() {\n this.unregisterListeners();\n }\n }, {\n key: 'isEventHandler',\n value: function isEventHandler() {\n return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n if (event === 'hlsEventGeneric') {\n throw new Error('Forbidden event name: ' + event);\n }\n this.hls.on(event, this.onEvent);\n }.bind(this));\n }\n }\n }, {\n key: 'unregisterListeners',\n value: function unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n this.hls.off(event, this.onEvent);\n }.bind(this));\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n\n }, {\n key: 'onEvent',\n value: function onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n }, {\n key: 'onEventGeneric',\n value: function onEventGeneric(event, data) {\n var eventToFunction = function eventToFunction(event, data) {\n var funcName = 'on' + event.replace('hls', '');\n if (typeof this[funcName] !== 'function') {\n throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n }\n return this[funcName].bind(this, data);\n };\n try {\n eventToFunction.call(this, event, data).call();\n } catch (err) {\n _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n }\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;\n\n},{\"26\":26,\"28\":28,\"45\":45}],28:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = {\n // fired before MediaSource is attaching to media element - data: { media }\n MEDIA_ATTACHING: 'hlsMediaAttaching',\n // fired when MediaSource has been succesfully attached to media element - data: { }\n MEDIA_ATTACHED: 'hlsMediaAttached',\n // fired before detaching MediaSource from media element - data: { }\n MEDIA_DETACHING: 'hlsMediaDetaching',\n // fired when MediaSource has been detached from media element - data: { }\n MEDIA_DETACHED: 'hlsMediaDetached',\n // fired when we buffer is going to be resetted\n BUFFER_RESET: 'hlsBufferReset',\n // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n BUFFER_CODECS: 'hlsBufferCodecs',\n // fired when sourcebuffers have been created data: { tracks : tracks}\n BUFFER_CREATED: 'hlsBufferCreated',\n // fired when we append a segment to the buffer - data: { segment: segment object }\n BUFFER_APPENDING: 'hlsBufferAppending',\n // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING , pending : nb of segments waiting for appending for this segment parent}\n BUFFER_APPENDED: 'hlsBufferAppended',\n // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n BUFFER_EOS: 'hlsBufferEos',\n // fired when the media buffer should be flushed - data {startOffset, endOffset}\n BUFFER_FLUSHING: 'hlsBufferFlushing',\n // fired when the media has been flushed\n BUFFER_FLUSHED: 'hlsBufferFlushed',\n // fired to signal that a manifest loading starts - data: { url : manifestURL}\n MANIFEST_LOADING: 'hlsManifestLoading',\n // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n MANIFEST_LOADED: 'hlsManifestLoaded',\n // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n MANIFEST_PARSED: 'hlsManifestParsed',\n // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n LEVEL_LOADING: 'hlsLevelLoading',\n // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n LEVEL_LOADED: 'hlsLevelLoaded',\n // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n LEVEL_UPDATED: 'hlsLevelUpdated',\n // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n // fired when an audio track switch occurs - data: { id : audio track id} // deprecated\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id}\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id}\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\n // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n // fired when the first timestamp is found. - data: { id : demuxer id, initPTS: initPTS }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\n // fired when a fragment loading starts - data: { frag : fragment object}\n FRAG_LOADING: 'hlsFragLoading',\n // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n FRAG_LOADED: 'hlsFragLoaded',\n // fired when a fragment has finished decrypting - data: { level : levelId, sn : sequence number }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFpsDrop',\n //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n ERROR: 'hlsError',\n // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n // fired when a decrypt key loading starts - data: { frag : fragment object}\n KEY_LOADING: 'hlsKeyLoading',\n // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n KEY_LOADED: 'hlsKeyLoaded',\n // fired upon stream controller state transitions - data: {previousState, nextState}\n STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n};\n\n},{}],29:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * AAC helper\n */\n\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: 'getSilentFrame',\n value: function getSilentFrame(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0:d=0.05\" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 2) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 3) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Buffer Helper class, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = function () {\n function BufferHelper() {\n _classCallCheck(this, BufferHelper);\n }\n\n _createClass(BufferHelper, null, [{\n key: \"isBuffered\",\n value: function isBuffered(media, position) {\n if (media) {\n var buffered = media.buffered;\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n return false;\n }\n }, {\n key: \"bufferInfo\",\n value: function bufferInfo(media, pos, maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered,\n buffered = [],\n i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n } else {\n return { len: 0, start: 0, end: 0, nextStart: undefined };\n }\n }\n }, {\n key: \"bufferedInfo\",\n value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n var buffered2 = [],\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,\n bufferStart,\n bufferEnd,\n bufferStartNext,\n i;\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n var start = buffered2[i].start,\n end = buffered2[i].end;\n //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n }\n }]);\n\n return BufferHelper;\n}();\n\nexports.default = BufferHelper;\n\n},{}],31:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LevelHelper = function () {\n function LevelHelper() {\n _classCallCheck(this, LevelHelper);\n }\n\n _createClass(LevelHelper, null, [{\n key: 'mergeDetails',\n value: function mergeDetails(oldDetails, newDetails) {\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n delta = newDetails.startSN - oldDetails.startSN,\n oldfragments = oldDetails.fragments,\n newfragments = newDetails.fragments,\n ccOffset = 0,\n PTSFrag;\n\n // check if old/new playlists have fragments in common\n if (end < start) {\n newDetails.PTSKnown = false;\n return;\n }\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n for (var i = start; i <= end; i++) {\n var oldFrag = oldfragments[delta + i],\n newFrag = newfragments[i];\n if (newFrag && oldFrag) {\n ccOffset = oldFrag.cc - newFrag.cc;\n if (!isNaN(oldFrag.startPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.duration = oldFrag.duration;\n PTSFrag = newFrag;\n }\n }\n }\n\n if (ccOffset) {\n _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].cc += ccOffset;\n }\n }\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldfragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n if (delta >= 0 && delta < oldfragments.length) {\n // adjust start by sliding offset\n var sliding = oldfragments[delta].start;\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].start += sliding;\n }\n }\n }\n // if we are here, it means we have fragments overlapping between\n // old and new level. reliable PTS info is thus relying on old level\n newDetails.PTSKnown = oldDetails.PTSKnown;\n return;\n }\n }, {\n key: 'updateFragPTSDTS',\n value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\n if (!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(frag.startPTS - startPTS);\n if (isNaN(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n startPTS = Math.min(startPTS, frag.startPTS);\n endPTS = Math.max(endPTS, frag.endPTS);\n startDTS = Math.min(startDTS, frag.startDTS);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n\n var drift = startPTS - frag.start;\n\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n LevelHelper.updatePTS(fragments, i, i - 1);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n LevelHelper.updatePTS(fragments, i, i + 1);\n }\n details.PTSKnown = true;\n //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\n return drift;\n }\n }, {\n key: 'updatePTS',\n value: function updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],\n fragTo = fragments[toIdx],\n fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if (!isNaN(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n if (toIdx > fromIdx) {\n fragFrom.duration = fragToPTS - fragFrom.start;\n if (fragFrom.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n }\n } else {\n fragTo.duration = fragFrom.start - fragToPTS;\n if (fragTo.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n }\n }\n } else {\n // we dont know startPTS[toIdx]\n if (toIdx > fromIdx) {\n fragTo.start = fragFrom.start + fragFrom.duration;\n } else {\n fragTo.start = fragFrom.start - fragTo.duration;\n }\n }\n }\n }]);\n\n return LevelHelper;\n}();\n\nexports.default = LevelHelper;\n\n},{\"45\":45}],32:[function(_dereq_,module,exports){\n/**\n * HLS interface\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n//import FetchLoader from './utils/fetch-loader';\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _playlistLoader = _dereq_(36);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(34);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _abrController = _dereq_(4);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(7);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(8);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _audioStreamController = _dereq_(5);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _streamController = _dereq_(12);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(11);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _timelineController = _dereq_(13);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _audioTrackController = _dereq_(6);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _logger = _dereq_(45);\n\nvar _xhrLoader = _dereq_(47);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _keyLoader = _dereq_(35);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _cues = _dereq_(43);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Hls = function () {\n _createClass(Hls, null, [{\n key: 'isSupported',\n value: function isSupported() {\n window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.6.21';\n }\n }, {\n key: 'Events',\n get: function get() {\n return _events2.default;\n }\n }, {\n key: 'ErrorTypes',\n get: function get() {\n return _errors.ErrorTypes;\n }\n }, {\n key: 'ErrorDetails',\n get: function get() {\n return _errors.ErrorDetails;\n }\n }, {\n key: 'DefaultConfig',\n get: function get() {\n if (!Hls.defaultConfig) {\n Hls.defaultConfig = {\n autoStartLoad: true,\n startPosition: -1,\n defaultAudioCodec: undefined,\n debug: false,\n capLevelOnFPSDrop: false,\n capLevelToPlayerSize: false,\n initialLiveManifestSize: 1,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n maxBufferHole: 0.5,\n maxMaxBufferLength: 600,\n maxSeekHole: 2,\n lowBufferWatchdogPeriod: 0.5,\n highBufferWatchdogPeriod: 3,\n nudgeOffset: 0.1,\n nudgeMaxRetry: 3,\n maxFragLookUpTolerance: 0.2,\n liveSyncDurationCount: 3,\n liveMaxLatencyDurationCount: Infinity,\n liveSyncDuration: undefined,\n liveMaxLatencyDuration: undefined,\n enableWorker: true,\n enableSoftwareAES: true,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n manifestLoadingMaxRetryTimeout: 64000,\n startLevel: undefined,\n levelLoadingTimeOut: 10000,\n levelLoadingMaxRetry: 4,\n levelLoadingRetryDelay: 1000,\n levelLoadingMaxRetryTimeout: 64000,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 1000,\n fragLoadingMaxRetryTimeout: 64000,\n fragLoadingLoopThreshold: 3,\n startFragPrefetch: false,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 3,\n loader: _xhrLoader2.default,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: _abrController2.default,\n bufferController: _bufferController2.default,\n capLevelController: _capLevelController2.default,\n fpsController: _fpsController2.default,\n streamController: _streamController2.default,\n audioStreamController: _audioStreamController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true,\n enableMP2TPassThrough: false,\n stretchShortVideoTrack: false,\n forceKeyFrameOnDiscontinuity: true,\n abrEwmaFastLive: 3,\n abrEwmaSlowLive: 9,\n abrEwmaFastVoD: 3,\n abrEwmaSlowVoD: 9,\n abrEwmaDefaultEstimate: 5e5, // 500 kbps\n abrBandWidthFactor: 0.95,\n abrBandWidthUpFactor: 0.7,\n maxStarvationDelay: 4,\n maxLoadingDelay: 4,\n minAutoBitrate: 0\n };\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Hls);\n\n var defaultConfig = Hls.DefaultConfig;\n\n if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n }\n\n for (var prop in defaultConfig) {\n if (prop in config) {\n continue;\n }\n config[prop] = defaultConfig[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n }\n\n if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n }\n\n (0, _logger.enableLogs)(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n this.playlistLoader = new _playlistLoader2.default(this);\n this.fragmentLoader = new _fragmentLoader2.default(this);\n this.levelController = new _levelController2.default(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new config.bufferController(this);\n this.capLevelController = new config.capLevelController(this);\n this.fpsController = new config.fpsController(this);\n this.streamController = new config.streamController(this);\n this.audioStreamController = new config.audioStreamController(this);\n this.timelineController = new config.timelineController(this);\n this.audioTrackController = new _audioTrackController2.default(this);\n this.keyLoader = new _keyLoader2.default(this);\n }\n\n _createClass(Hls, [{\n key: 'destroy',\n value: function destroy() {\n _logger.logger.log('destroy');\n this.trigger(_events2.default.DESTROYING);\n this.detachMedia();\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.abrController.destroy();\n this.bufferController.destroy();\n this.capLevelController.destroy();\n this.fpsController.destroy();\n this.streamController.destroy();\n this.audioStreamController.destroy();\n this.timelineController.destroy();\n this.audioTrackController.destroy();\n this.keyLoader.destroy();\n this.url = null;\n this.observer.removeAllListeners();\n }\n }, {\n key: 'attachMedia',\n value: function attachMedia(media) {\n _logger.logger.log('attachMedia');\n this.media = media;\n this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n }\n }, {\n key: 'detachMedia',\n value: function detachMedia() {\n _logger.logger.log('detachMedia');\n this.trigger(_events2.default.MEDIA_DETACHING);\n this.media = null;\n }\n }, {\n key: 'loadSource',\n value: function loadSource(url) {\n _logger.logger.log('loadSource:' + url);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.levelController.startLoad();\n this.streamController.startLoad(startPosition);\n this.audioStreamController.startLoad(startPosition);\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.levelController.stopLoad();\n this.streamController.stopLoad();\n this.audioStreamController.stopLoad();\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n _logger.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n }, {\n key: 'recoverMediaError',\n value: function recoverMediaError() {\n _logger.logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n\n }, {\n key: 'levels',\n get: function get() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n\n }, {\n key: 'currentLevel',\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set currentLevel:' + newLevel);\n this.loadLevel = newLevel;\n this.streamController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n\n }, {\n key: 'nextLevel',\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set nextLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n\n }, {\n key: 'loadLevel',\n get: function get() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set loadLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n ,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n\n }, {\n key: 'firstLevel',\n get: function get() {\n return Math.max(this.levelController.firstLevel, this.abrController.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set firstLevel:' + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /** Return start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n\n }, {\n key: 'startLevel',\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /** set start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set startLevel:' + newLevel);\n this.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set autoLevelCapping:' + newLevel);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n\n }, {\n key: 'autoLevelEnabled',\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /* return manual level */\n\n }, {\n key: 'manualLevel',\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.audioTrackController.audioTracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.audioTrackController.audioTrack;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n this.audioTrackController.audioTrack = audioTrackId;\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"26\":26,\"28\":28,\"34\":34,\"35\":35,\"36\":36,\"4\":4,\"43\":43,\"45\":45,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"8\":8}],33:[function(_dereq_,module,exports){\n'use strict';\n\n// This is mostly for support of the es6 module export\n// syntax with the babel compiler, it looks like it doesnt support\n// function exports like we are used to in node/commonjs\nmodule.exports = _dereq_(32).default;\n\n},{\"32\":32}],34:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Fragment Loader\n */\n\nvar FragmentLoader = function (_EventHandler) {\n _inherits(FragmentLoader, _EventHandler);\n\n function FragmentLoader(hls) {\n _classCallCheck(this, FragmentLoader);\n\n var _this = _possibleConstructorReturn(this, (FragmentLoader.__proto__ || Object.getPrototypeOf(FragmentLoader)).call(this, hls, _events2.default.FRAG_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(FragmentLoader, [{\n key: 'destroy',\n value: function destroy() {\n var loaders = this.loaders;\n for (var loaderName in loaders) {\n var loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n config = this.hls.config;\n\n frag.loaded = 0;\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n var start = frag.byteRangeStartOffset,\n end = frag.byteRangeEndOffset;\n if (!isNaN(start) && !isNaN(end)) {\n loaderContext.rangeStart = start;\n loaderContext.rangeEnd = end;\n }\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n loader.load(loaderContext, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var payload = response.data,\n frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n // jshint ignore:line\n var frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],35:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Decrypt key Loader\n */\n\nvar KeyLoader = function (_EventHandler) {\n _inherits(KeyLoader, _EventHandler);\n\n function KeyLoader(hls) {\n _classCallCheck(this, KeyLoader);\n\n var _this = _possibleConstructorReturn(this, (KeyLoader.__proto__ || Object.getPrototypeOf(KeyLoader)).call(this, hls, _events2.default.KEY_LOADING));\n\n _this.loaders = {};\n _this.decryptkey = null;\n _this.decrypturl = null;\n return _this;\n }\n\n _createClass(KeyLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onKeyLoading',\n value: function onKeyLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n decryptdata = frag.decryptdata,\n uri = decryptdata.uri;\n // if uri is different from previous one or if decrypt key not retrieved yet\n if (uri !== this.decrypturl || this.decryptkey === null) {\n var config = this.hls.config;\n\n if (loader) {\n _logger.logger.warn('abort previous key loader for type:' + type);\n loader.abort();\n }\n frag.loader = this.loaders[type] = new config.loader(config);\n this.decrypturl = uri;\n this.decryptkey = null;\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n } else if (this.decryptkey) {\n // we already loaded this key, return it\n decryptdata.key = this.decryptkey;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var frag = context.frag;\n this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n }\n }]);\n\n return KeyLoader;\n}(_eventHandler2.default);\n\nexports.default = KeyLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],36:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _attrList = _dereq_(40);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nvar LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri);\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n value: function createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n\n return uint8View;\n }\n\n /**\n * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n * @param levelkey - a playlist's encryption info\n * @param segmentNumber - the fragment's segment number\n * @returns {*} - an object to be applied as a fragment's decryptdata\n */\n\n }, {\n key: 'fragmentDecryptdataFromLevelkey',\n value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl);\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\n}();\n\nvar PlaylistLoader = function (_EventHandler) {\n _inherits(PlaylistLoader, _EventHandler);\n\n function PlaylistLoader(hls) {\n _classCallCheck(this, PlaylistLoader);\n\n var _this = _possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(PlaylistLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading(data) {\n this.load(data.url, { type: 'manifest' });\n }\n }, {\n key: 'onLevelLoading',\n value: function onLevelLoading(data) {\n this.load(data.url, { type: 'level', level: data.level, id: data.id });\n }\n }, {\n key: 'onAudioTrackLoading',\n value: function onAudioTrackLoading(data) {\n this.load(data.url, { type: 'audioTrack', id: data.id });\n }\n }, {\n key: 'load',\n value: function load(url, context) {\n var loader = this.loaders[context.type];\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n _logger.logger.trace('playlist request ongoing');\n return;\n } else {\n _logger.logger.warn('abort previous loader for type:' + context.type);\n loader.abort();\n }\n }\n var config = this.hls.config,\n retry = void 0,\n timeout = void 0,\n retryDelay = void 0,\n maxRetryDelay = void 0;\n if (context.type === 'manifest') {\n retry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeout;\n } else {\n retry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeout;\n _logger.logger.log('loading playlist for ' + context.type + ' ' + (context.level || context.id));\n }\n loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n context.url = url;\n context.responseType = '';\n\n var loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n loader.load(context, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'resolve',\n value: function resolve(url, baseUrl) {\n return _urlToolkit2.default.buildAbsoluteURL(baseUrl, url);\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {\n var level = {};\n\n var attrs = level.attrs = new _attrList2.default(result[1]);\n level.url = this.resolve(result[2], baseurl);\n\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n level.name = attrs.NAME;\n\n var codecs = attrs.CODECS;\n if (codecs) {\n codecs = codecs.split(/[ ,]+/);\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n }, {\n key: 'parseMasterPlaylistMedia',\n value: function parseMasterPlaylistMedia(string, baseurl, type) {\n var result = void 0,\n medias = [];\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null) {\n var media = {};\n var attrs = new _attrList2.default(result[1]);\n if (attrs.TYPE === type) {\n media.groupId = attrs['GROUP-ID'];\n media.name = attrs.NAME;\n media.type = type;\n media.default = attrs.DEFAULT === 'YES';\n media.autoselect = attrs.AUTOSELECT === 'YES';\n media.forced = attrs.FORCED === 'YES';\n if (attrs.URI) {\n media.url = this.resolve(attrs.URI, baseurl);\n }\n media.lang = attrs.LANGUAGE;\n if (!media.name) {\n media.name = media.lang;\n }\n medias.push(media);\n }\n }\n return medias;\n }\n }, {\n key: 'avc1toavcoti',\n value: function avc1toavcoti(codec) {\n var result,\n avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n }, {\n key: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new _attrList2.default(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if (decrypturi && decryptmethod === 'AES-128') {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\n var startAttrs = new _attrList2.default(startParams);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if (!isNaN(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\n level.fragments.pop();\n totalduration -= frag.duration;\n }\n level.totalduration = totalduration;\n level.averagetargetduration = totalduration / level.fragments.length;\n level.endSN = currentSN - 1;\n return level;\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var string = response.data,\n url = response.url,\n type = context.type,\n id = context.id,\n level = context.level,\n hls = this.hls;\n\n this.loaders[type] = undefined;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n stats.tload = performance.now();\n //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n var isLevel = type !== 'audioTrack',\n levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' });\n }\n } else {\n var levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n if (audiotracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = false;\n audiotracks.forEach(function (audioTrack) {\n if (!audioTrack.url) {\n embeddedAudioFound = true;\n }\n });\n // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audiotracks.unshift({ type: 'main', name: 'main' });\n }\n }\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n }\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"2\":2,\"26\":26,\"27\":27,\"28\":28,\"40\":40,\"45\":45}],37:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n var videoHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': videoHdlr,\n 'audio': audioHdlr\n };\n\n var dref = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\n MP4.STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00]);\n MP4.VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n }\n }, {\n key: 'box',\n value: function box(type) {\n var payload = Array.prototype.slice.call(arguments, 1),\n size = 8,\n i = payload.length,\n len = i,\n result;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n }, {\n key: 'hdlr',\n value: function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }, {\n key: 'mdhd',\n value: function mdhd(timescale, duration) {\n duration *= timescale;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]));\n }\n }, {\n key: 'mdia',\n value: function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n }\n }, {\n key: 'minf',\n value: function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n }\n }, {\n key: 'moof',\n value: function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */\n\n }, {\n key: 'moov',\n value: function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n }\n }, {\n key: 'mvex',\n value: function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n }\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n duration *= timescale;\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return MP4.box(MP4.types.mvhd, bytes);\n }\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n }, {\n key: 'stbl',\n value: function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n }\n }, {\n key: 'avc1',\n value: function avc1(track) {\n var sps = [],\n pps = [],\n i,\n data,\n len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xFF);\n sps.push(len & 0xFF);\n sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xFF);\n pps.push(len & 0xFF);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n sps[3], // profile\n sps[4], // profile compat\n sps[5], // level\n 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))),\n // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n width >> 8 & 0xFF, width & 0xff, // width\n height >> 8 & 0xFF, height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\n }\n }, {\n key: 'esds',\n value: function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17 + configlen, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f + configlen, // length\n 0x40, //codec : mpeg4_audio\n 0x15, // stream_type\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n }, {\n key: 'mp4a',\n value: function mp4a(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n }\n }, {\n key: 'tkhd',\n value: function tkhd(track) {\n var id = track.id,\n duration = track.duration * track.timescale,\n width = track.width,\n height = track.height;\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x00, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n ]));\n }\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id;\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n 16 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8), // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n }, {\n key: 'trak',\n value: function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n }, {\n key: 'trex',\n value: function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n }\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [],\n len = samples.length,\n arraylen = 12 + 16 * len,\n array = new Uint8Array(arraylen),\n i,\n sample,\n duration,\n size,\n flags,\n cts;\n offset += 8 + arraylen;\n array.set([0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n }, {\n key: 'initSegment',\n value: function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks),\n result;\n result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n }\n }]);\n\n return MP4;\n}();\n\nexports.default = MP4;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * fMP4 remuxer\n */\n\nvar _aac = _dereq_(29);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _mp4Generator = _dereq_(37);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, id, config, typeSupported) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.id = id;\n this.config = config;\n this.typeSupported = typeSupported;\n this.ISGenerated = false;\n this.PES2MP4SCALEFACTOR = 4;\n this.PES_TIMESCALE = 90000;\n this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._initPTS = this._initDTS = undefined;\n }\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS) {\n this.level = level;\n this.sn = sn;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset, cc);\n }\n\n if (defaultInitPTS !== null) {\n this._initPTS = this._initDTS = defaultInitPTS;\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n var audioTrackLength = void 0;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n }\n } else {\n var videoData = void 0;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n }\n if (videoData && audioTrack.codec) {\n this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n }\n }\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (id3Track.samples.length) {\n this.remuxID3(id3Track, timeOffset);\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (textTrack.samples.length) {\n this.remuxText(textTrack, timeOffset);\n }\n //notify end of parsing\n this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n }\n }, {\n key: 'generateIS',\n value: function generateIS(audioTrack, videoTrack, timeOffset, cc) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n pesTimeScale = this.PES_TIMESCALE,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n computePTSDTS = this._initPTS === undefined,\n initPTS,\n initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n audioTrack.timescale = audioTrack.audiosamplerate;\n // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n // we know that each AAC sample contains 1024 frames....\n // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n (function () {\n var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n if (!b) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n };\n audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, audioTrack.isAAC ? 1024 : 1152);\n })();\n }\n _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _mp4Generator2.default.initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n videoTrack.timescale = this.MP4_TIMESCALE;\n tracks.video = {\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { id: this.id, initPTS: initPTS, cc: cc });\n }\n }\n\n if (Object.keys(tracks).length) {\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n } else {\n observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n }\n }\n }, {\n key: 'remuxVideo',\n value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var offset = 8,\n pesTimeScale = this.PES_TIMESCALE,\n pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.units.units;\n // let unitsString = '';\n // for (let j = 0; j < units.length ; j++) {\n // unitsString += units[j].type + ',';\n // if (units[j].data.length < 500) {\n // unitsString += Hex.hexDump(units[j].data);\n // }\n // }\n // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n // }\n\n // sort video samples by DTS then PTS order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n return deltadts ? deltadts : a.pts - b.pts;\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n }, 0);\n if (PTSDTSshift < 0) {\n _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n for (var i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n var nextAvcDts = void 0;\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n nextAvcDts = this.nextAvcDts;\n } else {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * pesTimeScale;\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n firstPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = Math.round((firstDTS - nextAvcDts) / 90);\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n if (delta) {\n if (delta > 1) {\n _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n } else if (delta < -1) {\n _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n }\n // remove hole/gap : set DTS to next expected DTS\n firstDTS = nextAvcDts;\n inputSamples[0].dts = firstDTS + initDTS;\n // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n inputSamples[0].pts = firstPTS + initDTS;\n _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n }\n }\n nextDTS = firstDTS;\n\n // compute lastPTS/lastDTS\n sample = inputSamples[inputSamples.length - 1];\n lastDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(lastPTS, lastDTS);\n\n var vendor = navigator.vendor,\n userAgent = navigator.userAgent,\n isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\n // on Safari let's signal the same sample duration for all samples\n // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n if (isSafari) {\n mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n }\n\n // normalize all PTS/DTS now ...\n for (var _i = 0; _i < nbSamples; _i++) {\n var _sample = inputSamples[_i];\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(ptsNormalize(_sample.dts - initDTS, nextAvcDts), firstDTS);\n // ensure dts is a multiple of scale factor to avoid rounding issues\n _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n // and we ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(ptsNormalize(_sample.pts - initDTS, nextAvcDts), _sample.dts);\n // ensure pts is a multiple of scale factor to avoid rounding issues\n _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n var mdatSize = track.len + 4 * track.nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var j = 0, nbUnits = avcSampleUnits.length; j < nbUnits; j++) {\n var unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n } else {\n var config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n if (config.stretchShortVideoTrack) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAudioPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n }\n _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n mp4SampleDuration /= pes2mp4ScaleFactor;\n compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n outputSamples.push({\n size: mp4SampleLength,\n // constant duration\n duration: mp4SampleDuration,\n cts: compositionTimeOffset,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: avcSample.key ? 2 : 1,\n isNonSync: avcSample.key ? 0 : 1\n }\n });\n }\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n var dropped = track.dropped;\n track.len = 0;\n track.nbNalu = 0;\n track.dropped = 0;\n if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var flags = outputSamples[0].flags;\n // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n track.samples = outputSamples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n\n var data = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: this.nextAvcDts / pesTimeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped: dropped\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n return data;\n }\n }, {\n key: 'remuxAudio',\n value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n expectedSampleDuration = track.timescale * (track.isAAC ? 1024 : 1152) / track.audiosamplerate,\n pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var view,\n offset = rawMPEG ? 0 : 8,\n audioSample,\n mp4Sample,\n unit,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n lastDTS,\n pts,\n dts,\n ptsnorm,\n dtsnorm,\n outputSamples = [],\n inputSamples = [],\n fillFrame,\n newStamp,\n nextAudioPts;\n\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n inputSamples = track.samples;\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset and next expected PTS OR\n // - less than 20 audio frames distance\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\n nextAudioPts = this.nextAudioPts;\n contiguous |= inputSamples.length && nextAudioPts && (Math.abs(timeOffset - nextAudioPts / pesTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - this._initDTS) < 20 * pesFrameDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * pesTimeScale;\n }\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPtsNorm = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n ptsNorm = ptsNormalize(sample.pts - initDTS, nextAudioPts),\n delta = ptsNorm - nextPtsNorm;\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -pesFrameDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n // also only inject silent audio frames if currentTime !== 0 (nextPtsNorm !== 0)\n else if (delta >= pesFrameDuration && nextPtsNorm) {\n var missing = Math.round(delta / pesFrameDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n newStamp = nextPtsNorm + initDTS;\n newStamp = Math.max(newStamp, initDTS);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPtsNorm + initDTS;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n // Otherwise, we're within half a frame duration, so just adjust pts\n else {\n if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n }\n nextPtsNorm += pesFrameDuration;\n if (i === 0) {\n sample.pts = sample.dts = initDTS + nextAudioPts;\n } else {\n sample.pts = sample.dts = inputSamples[i - 1].pts + pesFrameDuration;\n }\n i += 1;\n }\n }\n }\n\n for (var _j = 0, _nbSamples = inputSamples.length; _j < _nbSamples; _j++) {\n audioSample = inputSamples[_j];\n unit = audioSample.unit;\n pts = audioSample.pts - initDTS;\n dts = audioSample.dts - initDTS;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastDTS !== undefined) {\n ptsnorm = ptsNormalize(pts, lastDTS);\n dtsnorm = ptsNormalize(dts, lastDTS);\n mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n } else {\n ptsnorm = ptsNormalize(pts, nextAudioPts);\n dtsnorm = ptsNormalize(dts, nextAudioPts);\n var _delta = Math.round(1000 * (ptsnorm - nextAudioPts) / pesTimeScale),\n numMissingFrames = 0;\n // if fragment are contiguous, detect hole/overlapping between fragments\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0) {\n numMissingFrames = Math.round((ptsnorm - nextAudioPts) / pesFrameDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\n }\n track.len += numMissingFrames * fillFrame.length;\n }\n // if we have frame overlap, overlapping for more than half a frame duraion\n } else if (_delta < -12) {\n // drop overlapping audio frames... browser will deal with it\n _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n ptsnorm = dtsnorm = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, ptsnorm);\n firstDTS = Math.max(0, dtsnorm);\n if (track.len > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n\n var mdatSize = rawMPEG ? track.len : track.len + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });\n return;\n }\n if (!rawMPEG) {\n view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\n }\n mdat.set(fillFrame, offset);\n offset += fillFrame.byteLength;\n mp4Sample = {\n size: fillFrame.byteLength,\n cts: 0,\n duration: 1024,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\n cts: 0,\n duration: 0,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n lastDTS = dtsnorm;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n }\n track.samples = [];\n var audioData = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: this.nextAudioPts / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n }, {\n key: 'remuxEmptyAudio',\n value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * pesTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n\n // silent frame\n silentFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({ unit: silentFrame, pts: stamp, dts: stamp });\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n }, {\n key: 'remuxID3',\n value: function remuxID3(track, timeOffset) {\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: 'remuxText',\n value: function remuxText(track, timeOffset) {\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: '_PTSNormalize',\n value: function _PTSNormalize(value, reference) {\n var offset;\n if (reference === undefined) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return false;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"26\":26,\"28\":28,\"29\":29,\"37\":37,\"45\":45}],39:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * passthrough remuxer\n */\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PassThroughRemuxer = function () {\n function PassThroughRemuxer(observer, id) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n this.id = id;\n this.ISGenerated = false;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {}\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n var observer = this.observer;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n var tracks = {},\n data = { id: this.id, tracks: tracks, unique: true },\n track = videoTrack,\n codec = track.codec;\n\n if (codec) {\n data.tracks.video = {\n container: track.container,\n codec: codec,\n metadata: {\n width: track.width,\n height: track.height\n }\n };\n }\n\n track = audioTrack;\n codec = track.codec;\n if (codec) {\n data.tracks.audio = {\n container: track.container,\n codec: codec,\n metadata: {\n channelCount: track.channelCount\n }\n };\n }\n this.ISGenerated = true;\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n id: this.id,\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: 'audiovideo',\n nb: 1,\n dropped: 0\n });\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return true;\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"28\":28}],40:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\nvar AttrList = function () {\n function AttrList(attrs) {\n _classCallCheck(this, AttrList);\n\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n\n _createClass(AttrList, [{\n key: 'decimalInteger',\n value: function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'hexadecimalInteger',\n value: function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: 'hexadecimalIntegerAsNumber',\n value: function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'decimalFloatingPoint',\n value: function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n }, {\n key: 'enumeratedString',\n value: function enumeratedString(attrName) {\n return this[attrName];\n }\n }, {\n key: 'decimalResolution',\n value: function decimalResolution(attrName) {\n var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n }\n }], [{\n key: 'parseAttrList',\n value: function parseAttrList(input) {\n var match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2],\n quote = '\"';\n\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n }\n }]);\n\n return AttrList;\n}();\n\nexports.default = AttrList;\n\n},{}],41:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array} list The array to search.\n * @param {Function} comparisonFunction\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {*} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFunction) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n\n var comparisonResult = comparisonFunction(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n\n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n},{}],42:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n * This code was ported from the dash.js project at:\n * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n *\n * The original copyright appears below:\n *\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2015-2016, DASH Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * 2. Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n */\n\nvar specialCea608CharsCodes = {\n 0x2a: 0xe1, // lowercase a, acute accent\n 0x5c: 0xe9, // lowercase e, acute accent\n 0x5e: 0xed, // lowercase i, acute accent\n 0x5f: 0xf3, // lowercase o, acute accent\n 0x60: 0xfa, // lowercase u, acute accent\n 0x7b: 0xe7, // lowercase c with cedilla\n 0x7c: 0xf7, // division symbol\n 0x7d: 0xd1, // uppercase N tilde\n 0x7e: 0xf1, // lowercase n tilde\n 0x7f: 0x2588, // Full block\n // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n 0x80: 0xae, // Registered symbol (R)\n 0x81: 0xb0, // degree sign\n 0x82: 0xbd, // 1/2 symbol\n 0x83: 0xbf, // Inverted (open) question mark\n 0x84: 0x2122, // Trademark symbol (TM)\n 0x85: 0xa2, // Cents symbol\n 0x86: 0xa3, // Pounds sterling\n 0x87: 0x266a, // Music 8'th note\n 0x88: 0xe0, // lowercase a, grave accent\n 0x89: 0x20, // transparent space (regular)\n 0x8a: 0xe8, // lowercase e, grave accent\n 0x8b: 0xe2, // lowercase a, circumflex accent\n 0x8c: 0xea, // lowercase e, circumflex accent\n 0x8d: 0xee, // lowercase i, circumflex accent\n 0x8e: 0xf4, // lowercase o, circumflex accent\n 0x8f: 0xfb, // lowercase u, circumflex accent\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n 0x90: 0xc1, // capital letter A with acute\n 0x91: 0xc9, // capital letter E with acute\n 0x92: 0xd3, // capital letter O with acute\n 0x93: 0xda, // capital letter U with acute\n 0x94: 0xdc, // capital letter U with diaresis\n 0x95: 0xfc, // lowercase letter U with diaeresis\n 0x96: 0x2018, // opening single quote\n 0x97: 0xa1, // inverted exclamation mark\n 0x98: 0x2a, // asterisk\n 0x99: 0x2019, // closing single quote\n 0x9a: 0x2501, // box drawings heavy horizontal\n 0x9b: 0xa9, // copyright sign\n 0x9c: 0x2120, // Service mark\n 0x9d: 0x2022, // (round) bullet\n 0x9e: 0x201c, // Left double quotation mark\n 0x9f: 0x201d, // Right double quotation mark\n 0xa0: 0xc0, // uppercase A, grave accent\n 0xa1: 0xc2, // uppercase A, circumflex\n 0xa2: 0xc7, // uppercase C with cedilla\n 0xa3: 0xc8, // uppercase E, grave accent\n 0xa4: 0xca, // uppercase E, circumflex\n 0xa5: 0xcb, // capital letter E with diaresis\n 0xa6: 0xeb, // lowercase letter e with diaresis\n 0xa7: 0xce, // uppercase I, circumflex\n 0xa8: 0xcf, // uppercase I, with diaresis\n 0xa9: 0xef, // lowercase i, with diaresis\n 0xaa: 0xd4, // uppercase O, circumflex\n 0xab: 0xd9, // uppercase U, grave accent\n 0xac: 0xf9, // lowercase u, grave accent\n 0xad: 0xdb, // uppercase U, circumflex\n 0xae: 0xab, // left-pointing double angle quotation mark\n 0xaf: 0xbb, // right-pointing double angle quotation mark\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n 0xb0: 0xc3, // Uppercase A, tilde\n 0xb1: 0xe3, // Lowercase a, tilde\n 0xb2: 0xcd, // Uppercase I, acute accent\n 0xb3: 0xcc, // Uppercase I, grave accent\n 0xb4: 0xec, // Lowercase i, grave accent\n 0xb5: 0xd2, // Uppercase O, grave accent\n 0xb6: 0xf2, // Lowercase o, grave accent\n 0xb7: 0xd5, // Uppercase O, tilde\n 0xb8: 0xf5, // Lowercase o, tilde\n 0xb9: 0x7b, // Open curly brace\n 0xba: 0x7d, // Closing curly brace\n 0xbb: 0x5c, // Backslash\n 0xbc: 0x5e, // Caret\n 0xbd: 0x5f, // Underscore\n 0xbe: 0x7c, // Pipe (vertical line)\n 0xbf: 0x223c, // Tilde operator\n 0xc0: 0xc4, // Uppercase A, umlaut\n 0xc1: 0xe4, // Lowercase A, umlaut\n 0xc2: 0xd6, // Uppercase O, umlaut\n 0xc3: 0xf6, // Lowercase o, umlaut\n 0xc4: 0xdf, // Esszett (sharp S)\n 0xc5: 0xa5, // Yen symbol\n 0xc6: 0xa4, // Generic currency sign\n 0xc7: 0x2503, // Box drawings heavy vertical\n 0xc8: 0xc5, // Uppercase A, ring\n 0xc9: 0xe5, // Lowercase A, ring\n 0xca: 0xd8, // Uppercase O, stroke\n 0xcb: 0xf8, // Lowercase o, strok\n 0xcc: 0x250f, // Box drawings heavy down and right\n 0xcd: 0x2513, // Box drawings heavy down and left\n 0xce: 0x2517, // Box drawings heavy up and right\n 0xcf: 0x251b // Box drawings heavy up and left\n};\n\n/**\n * Utils\n */\nvar getCharForByte = function getCharForByte(byte) {\n var charCode = byte;\n if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n charCode = specialCea608CharsCodes[byte];\n }\n return String.fromCharCode(charCode);\n};\n\nvar NR_ROWS = 15,\n NR_COLS = 32;\n// Tables to look up row from PAC data\nvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\nvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\nvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\nvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\nvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\n/**\n * Simple logger class to be able to write with time-stamps and filter on level.\n */\nvar logger = {\n verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n time: null,\n verboseLevel: 0, // Only write errors\n setTime: function setTime(newTime) {\n this.time = newTime;\n },\n log: function log(severity, msg) {\n var minLevel = this.verboseFilter[severity];\n if (this.verboseLevel >= minLevel) {\n console.log(this.time + ' [' + severity + '] ' + msg);\n }\n }\n};\n\nvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n var hexArray = [];\n for (var j = 0; j < numArray.length; j++) {\n hexArray.push(numArray[j].toString(16));\n }\n return hexArray;\n};\n\nvar PenState = function () {\n function PenState(foreground, underline, italics, background, flash) {\n _classCallCheck(this, PenState);\n\n this.foreground = foreground || 'white';\n this.underline = underline || false;\n this.italics = italics || false;\n this.background = background || 'black';\n this.flash = flash || false;\n }\n\n _createClass(PenState, [{\n key: 'reset',\n value: function reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n }, {\n key: 'setStyles',\n value: function setStyles(styles) {\n var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n for (var i = 0; i < attribs.length; i++) {\n var style = attribs[i];\n if (styles.hasOwnProperty(style)) {\n this[style] = styles[style];\n }\n }\n }\n }, {\n key: 'isDefault',\n value: function isDefault() {\n return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n }\n }, {\n key: 'copy',\n value: function copy(newPenState) {\n this.foreground = newPenState.foreground;\n this.underline = newPenState.underline;\n this.italics = newPenState.italics;\n this.background = newPenState.background;\n this.flash = newPenState.flash;\n }\n }, {\n key: 'toString',\n value: function toString() {\n return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n }\n }]);\n\n return PenState;\n}();\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\n\n\nvar StyledUnicodeChar = function () {\n function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n _classCallCheck(this, StyledUnicodeChar);\n\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline, italics, background, flash);\n }\n\n _createClass(StyledUnicodeChar, [{\n key: 'reset',\n value: function reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n }, {\n key: 'setChar',\n value: function setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n }, {\n key: 'setPenState',\n value: function setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n }, {\n key: 'copy',\n value: function copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n }]);\n\n return StyledUnicodeChar;\n}();\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\n\n\nvar Row = function () {\n function Row() {\n _classCallCheck(this, Row);\n\n this.chars = [];\n for (var i = 0; i < NR_COLS; i++) {\n this.chars.push(new StyledUnicodeChar());\n }\n this.pos = 0;\n this.currPenState = new PenState();\n }\n\n _createClass(Row, [{\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].equals(other.chars[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_COLS; i++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n\n /**\n * Set the cursor to a valid column.\n */\n\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n if (this.pos !== absPos) {\n this.pos = absPos;\n }\n if (this.pos < 0) {\n logger.log('ERROR', 'Negative cursor position ' + this.pos);\n this.pos = 0;\n } else if (this.pos > NR_COLS) {\n logger.log('ERROR', 'Too large cursor position ' + this.pos);\n this.pos = NR_COLS;\n }\n }\n\n /**\n * Move the cursor relative to current position.\n */\n\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var newPos = this.pos + relPos;\n if (relPos > 1) {\n for (var i = this.pos + 1; i < newPos + 1; i++) {\n this.chars[i].setPenState(this.currPenState);\n }\n }\n this.setCursor(newPos);\n }\n\n /**\n * Backspace, move one step back and clear character.\n */\n\n }, {\n key: 'backSpace',\n value: function backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n }, {\n key: 'insertChar',\n value: function insertChar(byte) {\n if (byte >= 0x90) {\n //Extended char\n this.backSpace();\n }\n var char = getCharForByte(byte);\n if (this.pos >= NR_COLS) {\n logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n return;\n }\n this.chars[this.pos].setChar(char, this.currPenState);\n this.moveCursor(1);\n }\n }, {\n key: 'clearFromPos',\n value: function clearFromPos(startPos) {\n var i;\n for (i = startPos; i < NR_COLS; i++) {\n this.chars[i].reset();\n }\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n }, {\n key: 'getTextString',\n value: function getTextString() {\n var chars = [];\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n var char = this.chars[i].uchar;\n if (char !== ' ') {\n empty = false;\n }\n chars.push(char);\n }\n if (empty) {\n return '';\n } else {\n return chars.join('');\n }\n }\n }, {\n key: 'setPenStyles',\n value: function setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n }]);\n\n return Row;\n}();\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\n\n\nvar CaptionScreen = function () {\n function CaptionScreen() {\n _classCallCheck(this, CaptionScreen);\n\n this.rows = [];\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n }\n this.currRow = NR_ROWS - 1;\n this.nrRollUpRows = null;\n this.reset();\n }\n\n _createClass(CaptionScreen, [{\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n this.currRow = NR_ROWS - 1;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].equals(other.rows[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: 'backSpace',\n value: function backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n var row = this.rows[this.currRow];\n row.clearToEndOfRow();\n }\n\n /**\n * Insert a character (without styling) in the current row.\n */\n\n }, {\n key: 'insertChar',\n value: function insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n }, {\n key: 'setPen',\n value: function setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData, lastOutputScreen) {\n logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n var newRow = pacData.row - 1;\n if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n newRow = this.nrRollUpRows - 1;\n }\n\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow - this.nrRollUpRows + i + 1].copy(lastOutputScreen.rows[topRowIndex + i]);\n }\n }\n }\n\n this.currRow = newRow;\n var row = this.rows[this.currRow];\n if (pacData.indent !== null) {\n var indent = pacData.indent;\n var prevPos = Math.max(indent - 1, 0);\n row.setCursor(pacData.indent);\n pacData.color = row.chars[prevPos].penState.foreground;\n }\n var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n this.setPen(styles);\n }\n\n /**\n * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n */\n\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n\n logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n this.backSpace();\n this.setPen(bkgData);\n this.insertChar(0x20); //Space\n }\n }, {\n key: 'setRollUpRows',\n value: function setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n }, {\n key: 'rollUp',\n value: function rollUp() {\n if (this.nrRollUpRows === null) {\n logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n return; //Not properly setup\n }\n logger.log('TEXT', this.getDisplayText());\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n var topRow = this.rows.splice(topRowIndex, 1)[0];\n topRow.clear();\n this.rows.splice(this.currRow, 0, topRow);\n logger.log('INFO', 'Rolling up');\n //logger.log('TEXT', this.get_display_text())\n }\n\n /**\n * Get all non-empty rows with as unicode text.\n */\n\n }, {\n key: 'getDisplayText',\n value: function getDisplayText(asOneRow) {\n asOneRow = asOneRow || false;\n var displayText = [];\n var text = '';\n var rowNr = -1;\n for (var i = 0; i < NR_ROWS; i++) {\n var rowText = this.rows[i].getTextString();\n if (rowText) {\n rowNr = i + 1;\n if (asOneRow) {\n displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n } else {\n displayText.push(rowText.trim());\n }\n }\n }\n if (displayText.length > 0) {\n if (asOneRow) {\n text = '[' + displayText.join(' | ') + ']';\n } else {\n text = displayText.join('\\n');\n }\n }\n return text;\n }\n }, {\n key: 'getTextAndFormat',\n value: function getTextAndFormat() {\n return this.rows;\n }\n }]);\n\n return CaptionScreen;\n}();\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nvar Cea608Channel = function () {\n function Cea608Channel(channelNumber, outputFilter) {\n _classCallCheck(this, Cea608Channel);\n\n this.chNr = channelNumber;\n this.outputFilter = outputFilter;\n this.mode = null;\n this.verbose = 0;\n this.displayedMemory = new CaptionScreen();\n this.nonDisplayedMemory = new CaptionScreen();\n this.lastOutputScreen = new CaptionScreen();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null; // Keeps track of where a cue started.\n }\n\n _createClass(Cea608Channel, [{\n key: 'reset',\n value: function reset() {\n this.mode = null;\n this.displayedMemory.reset();\n this.nonDisplayedMemory.reset();\n this.lastOutputScreen.reset();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null;\n this.lastCueEndTime = null;\n }\n }, {\n key: 'getHandler',\n value: function getHandler() {\n return this.outputFilter;\n }\n }, {\n key: 'setHandler',\n value: function setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n this.writeScreen.setPAC(pacData, this.lastOutputScreen);\n }\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n }, {\n key: 'setMode',\n value: function setMode(newMode) {\n if (newMode === this.mode) {\n return;\n }\n this.mode = newMode;\n logger.log('INFO', 'MODE=' + newMode);\n if (this.mode === 'MODE_POP-ON') {\n this.writeScreen = this.nonDisplayedMemory;\n } else {\n this.writeScreen = this.displayedMemory;\n this.writeScreen.reset();\n this.lastOutputScreen.reset();\n }\n if (this.mode !== 'MODE_ROLL-UP') {\n this.displayedMemory.nrRollUpRows = null;\n this.nonDisplayedMemory.nrRollUpRows = null;\n }\n this.mode = newMode;\n }\n }, {\n key: 'insertChars',\n value: function insertChars(chars) {\n for (var i = 0; i < chars.length; i++) {\n this.writeScreen.insertChar(chars[i]);\n }\n var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccRCL',\n value: function ccRCL() {\n // Resume Caption Loading (switch mode to Pop On)\n logger.log('INFO', 'RCL - Resume Caption Loading');\n this.setMode('MODE_POP-ON');\n }\n }, {\n key: 'ccBS',\n value: function ccBS() {\n // BackSpace\n logger.log('INFO', 'BS - BackSpace');\n if (this.mode === 'MODE_TEXT') {\n return;\n }\n this.writeScreen.backSpace();\n if (this.writeScreen === this.displayedMemory) {\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccAOF',\n value: function ccAOF() {\n // Reserved (formerly Alarm Off)\n return;\n }\n }, {\n key: 'ccAON',\n value: function ccAON() {\n // Reserved (formerly Alarm On)\n return;\n }\n }, {\n key: 'ccDER',\n value: function ccDER() {\n // Delete to End of Row\n logger.log('INFO', 'DER- Delete to End of Row');\n this.writeScreen.clearToEndOfRow();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccRU',\n value: function ccRU(nrRows) {\n //Roll-Up Captions-2,3,or 4 Rows\n logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n this.writeScreen = this.displayedMemory;\n this.setMode('MODE_ROLL-UP');\n this.writeScreen.setRollUpRows(nrRows);\n }\n }, {\n key: 'ccFON',\n value: function ccFON() {\n //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({ flash: true });\n }\n }, {\n key: 'ccRDC',\n value: function ccRDC() {\n // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n }, {\n key: 'ccTR',\n value: function ccTR() {\n // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccRTD',\n value: function ccRTD() {\n // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccEDM',\n value: function ccEDM() {\n // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccCR',\n value: function ccCR() {\n // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccENM',\n value: function ccENM() {\n //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n }, {\n key: 'ccEOC',\n value: function ccEOC() {\n //End of Caption (Flip Memories)\n logger.log('INFO', 'EOC - End Of Caption');\n if (this.mode === 'MODE_POP-ON') {\n var tmp = this.displayedMemory;\n this.displayedMemory = this.nonDisplayedMemory;\n this.nonDisplayedMemory = tmp;\n this.writeScreen = this.nonDisplayedMemory;\n logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n }\n this.outputDataUpdate();\n }\n }, {\n key: 'ccTO',\n value: function ccTO(nrCols) {\n // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n }, {\n key: 'ccMIDROW',\n value: function ccMIDROW(secondByte) {\n // Parse MIDROW command\n var styles = { flash: false };\n styles.underline = secondByte % 2 === 1;\n styles.italics = secondByte >= 0x2e;\n if (!styles.italics) {\n var colorIndex = Math.floor(secondByte / 2) - 0x10;\n var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n styles.foreground = colors[colorIndex];\n } else {\n styles.foreground = 'white';\n }\n logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n this.writeScreen.setPen(styles);\n }\n }, {\n key: 'outputDataUpdate',\n value: function outputDataUpdate() {\n var t = logger.time;\n if (t === null) {\n return;\n }\n if (this.outputFilter) {\n if (this.outputFilter.updateData) {\n this.outputFilter.updateData(t, this.displayedMemory);\n }\n if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n // Start of a new cue\n this.cueStartTime = t;\n } else {\n if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n }\n this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n }\n }\n this.lastOutputScreen.copy(this.displayedMemory);\n }\n }\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n if (this.outputFilter) {\n if (!this.displayedMemory.isEmpty()) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n }\n this.cueStartTime = t;\n }\n }\n }\n }]);\n\n return Cea608Channel;\n}();\n\nvar Cea608Parser = function () {\n function Cea608Parser(field, out1, out2) {\n _classCallCheck(this, Cea608Parser);\n\n this.field = field || 1;\n this.outputs = [out1, out2];\n this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n this.currChNr = -1; // Will be 1 or 2\n this.lastCmdA = null; // First byte of last command\n this.lastCmdB = null; // Second byte of last command\n this.bufferedData = [];\n this.startTime = null;\n this.lastTime = null;\n this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n }\n\n _createClass(Cea608Parser, [{\n key: 'getHandler',\n value: function getHandler(index) {\n return this.channels[index].getHandler();\n }\n }, {\n key: 'setHandler',\n value: function setHandler(index, newHandler) {\n this.channels[index].setHandler(newHandler);\n }\n\n /**\n * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n */\n\n }, {\n key: 'addData',\n value: function addData(t, byteList) {\n var cmdFound,\n a,\n b,\n charsFound = false;\n\n this.lastTime = t;\n logger.setTime(t);\n\n for (var i = 0; i < byteList.length; i += 2) {\n a = byteList[i] & 0x7f;\n b = byteList[i + 1] & 0x7f;\n if (a === 0 && b === 0) {\n this.dataCounters.padding += 2;\n continue;\n } else {\n logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n }\n cmdFound = this.parseCmd(a, b);\n if (!cmdFound) {\n cmdFound = this.parseMidrow(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parsePAC(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parseBackgroundAttributes(a, b);\n }\n if (!cmdFound) {\n charsFound = this.parseChars(a, b);\n if (charsFound) {\n if (this.currChNr && this.currChNr >= 0) {\n var channel = this.channels[this.currChNr - 1];\n channel.insertChars(charsFound);\n } else {\n logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n }\n }\n }\n if (cmdFound) {\n this.dataCounters.cmd += 2;\n } else if (charsFound) {\n this.dataCounters.char += 2;\n } else {\n this.dataCounters.other += 2;\n logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n }\n }\n }\n\n /**\n * Parse Command.\n * @returns {Boolean} Tells if a command was found\n */\n\n }, {\n key: 'parseCmd',\n value: function parseCmd(a, b) {\n var chNr = null;\n\n var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n if (!(cond1 || cond2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null; // Repeated commands are dropped (once)\n logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n return true;\n }\n\n if (a === 0x14 || a === 0x17) {\n chNr = 1;\n } else {\n chNr = 2; // (a === 0x1C || a=== 0x1f)\n }\n\n var channel = this.channels[chNr - 1];\n\n if (a === 0x14 || a === 0x1C) {\n if (b === 0x20) {\n channel.ccRCL();\n } else if (b === 0x21) {\n channel.ccBS();\n } else if (b === 0x22) {\n channel.ccAOF();\n } else if (b === 0x23) {\n channel.ccAON();\n } else if (b === 0x24) {\n channel.ccDER();\n } else if (b === 0x25) {\n channel.ccRU(2);\n } else if (b === 0x26) {\n channel.ccRU(3);\n } else if (b === 0x27) {\n channel.ccRU(4);\n } else if (b === 0x28) {\n channel.ccFON();\n } else if (b === 0x29) {\n channel.ccRDC();\n } else if (b === 0x2A) {\n channel.ccTR();\n } else if (b === 0x2B) {\n channel.ccRTD();\n } else if (b === 0x2C) {\n channel.ccEDM();\n } else if (b === 0x2D) {\n channel.ccCR();\n } else if (b === 0x2E) {\n channel.ccENM();\n } else if (b === 0x2F) {\n channel.ccEOC();\n }\n } else {\n //a == 0x17 || a == 0x1F\n channel.ccTO(b - 0x20);\n }\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Parse midrow styling command\n * @returns {Boolean}\n */\n\n }, {\n key: 'parseMidrow',\n value: function parseMidrow(a, b) {\n var chNr = null;\n\n if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n if (a === 0x11) {\n chNr = 1;\n } else {\n chNr = 2;\n }\n if (chNr !== this.currChNr) {\n logger.log('ERROR', 'Mismatch channel in midrow parsing');\n return false;\n }\n var channel = this.channels[chNr - 1];\n channel.ccMIDROW(b);\n logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n return true;\n }\n return false;\n }\n /**\n * Parse Preable Access Codes (Table 53).\n * @returns {Boolean} Tells if PAC found\n */\n\n }, {\n key: 'parsePAC',\n value: function parsePAC(a, b) {\n\n var chNr = null;\n var row = null;\n\n var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n if (!(case1 || case2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true; // Repeated commands are dropped (once)\n }\n\n chNr = a <= 0x17 ? 1 : 2;\n\n if (0x40 <= b && b <= 0x5F) {\n row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n } else {\n // 0x60 <= b <= 0x7F\n row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n }\n var pacData = this.interpretPAC(row, b);\n var channel = this.channels[chNr - 1];\n channel.setPAC(pacData);\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Interpret the second byte of the pac, and return the information.\n * @returns {Object} pacData with style parameters.\n */\n\n }, {\n key: 'interpretPAC',\n value: function interpretPAC(row, byte) {\n var pacIndex = byte;\n var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\n if (byte > 0x5F) {\n pacIndex = byte - 0x60;\n } else {\n pacIndex = byte - 0x40;\n }\n pacData.underline = (pacIndex & 1) === 1;\n if (pacIndex <= 0xd) {\n pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n } else if (pacIndex <= 0xf) {\n pacData.italics = true;\n pacData.color = 'white';\n } else {\n pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n }\n return pacData; // Note that row has zero offset. The spec uses 1.\n }\n\n /**\n * Parse characters.\n * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n */\n\n }, {\n key: 'parseChars',\n value: function parseChars(a, b) {\n\n var channelNr = null,\n charCodes = null,\n charCode1 = null;\n\n if (a >= 0x19) {\n channelNr = 2;\n charCode1 = a - 8;\n } else {\n channelNr = 1;\n charCode1 = a;\n }\n if (0x11 <= charCode1 && charCode1 <= 0x13) {\n // Special character\n var oneCode = b;\n if (charCode1 === 0x11) {\n oneCode = b + 0x50;\n } else if (charCode1 === 0x12) {\n oneCode = b + 0x70;\n } else {\n oneCode = b + 0x90;\n }\n logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n charCodes = [oneCode];\n } else if (0x20 <= a && a <= 0x7f) {\n charCodes = b === 0 ? [a] : [a, b];\n }\n if (charCodes) {\n var hexCodes = numArrayToHexArray(charCodes);\n logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n return charCodes;\n }\n\n /**\n * Parse extended background attributes as well as new foreground color black.\n * @returns{Boolean} Tells if background attributes are found\n */\n\n }, {\n key: 'parseBackgroundAttributes',\n value: function parseBackgroundAttributes(a, b) {\n var bkgData, index, chNr, channel;\n\n var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n if (!(case1 || case2)) {\n return false;\n }\n bkgData = {};\n if (a === 0x10 || a === 0x18) {\n index = Math.floor((b - 0x20) / 2);\n bkgData.background = backgroundColors[index];\n if (b % 2 === 1) {\n bkgData.background = bkgData.background + '_semi';\n }\n } else if (b === 0x2d) {\n bkgData.background = 'transparent';\n } else {\n bkgData.foreground = 'black';\n if (b === 0x2f) {\n bkgData.underline = true;\n }\n }\n chNr = a < 0x18 ? 1 : 2;\n channel = this.channels[chNr - 1];\n channel.setBkgData(bkgData);\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true;\n }\n\n /**\n * Reset state of parser and its channels.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].reset();\n }\n }\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n\n /**\n * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n */\n\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].cueSplitAtTime(t);\n }\n }\n }\n }]);\n\n return Cea608Parser;\n}();\n\nexports.default = Cea608Parser;\n\n},{}],43:[function(_dereq_,module,exports){\n'use strict';\n\nvar Cues = {\n\n newCue: function newCue(track, startTime, endTime, captionScreen) {\n var row;\n var cue;\n var indenting;\n var indent;\n var text;\n var VTTCue = window.VTTCue || window.TextTrackCue;\n\n for (var r = 0; r < captionScreen.rows.length; r++) {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty()) {\n for (var c = 0; c < row.chars.length; c++) {\n if (row.chars[c].uchar.match(/\\s/) && indenting) {\n indent++;\n } else {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n cue = new VTTCue(startTime, endTime, text.trim());\n\n if (indent >= 16) {\n indent--;\n } else {\n indent++;\n }\n\n // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n // also, drop line 1 since it's to close to the top\n if (navigator.userAgent.match(/Firefox\\//)) {\n cue.line = r + 1;\n } else {\n cue.line = r > 7 ? r - 2 : r + 1;\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{}],44:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\n\nvar EWMA = function () {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n function EWMA(halfLife) {\n _classCallCheck(this, EWMA);\n\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = 0;\n this.totalWeight_ = 0;\n }\n\n _createClass(EWMA, [{\n key: \"sample\",\n value: function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n }\n }, {\n key: \"getTotalWeight\",\n value: function getTotalWeight() {\n return this.totalWeight_;\n }\n }, {\n key: \"getEstimate\",\n value: function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n } else {\n return this.estimate_;\n }\n }\n }]);\n\n return EWMA;\n}();\n\nexports.default = EWMA;\n\n},{}],45:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction noop() {}\n\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nvar exportedLogger = fakeLogger;\n\n/*globals self: false */\n\n//let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction formatMsg(type, msg) {\n msg = '[' + type + '] > ' + msg;\n return msg;\n}\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args[0]) {\n args[0] = formatMsg(type, args[0]);\n }\n func.apply(self.console, args);\n };\n }\n return noop;\n}\n\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n functions[_key2 - 1] = arguments[_key2];\n }\n\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log();\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n};\n\nvar logger = exports.logger = exportedLogger;\n\n},{}],46:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = function () {\n function TimeRanges() {\n _classCallCheck(this, TimeRanges);\n }\n\n _createClass(TimeRanges, null, [{\n key: 'toString',\n value: function toString(r) {\n var log = '',\n len = r.length;\n for (var i = 0; i < len; i++) {\n log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n }\n return log;\n }\n }]);\n\n return TimeRanges;\n}();\n\nexports.default = TimeRanges;\n\n},{}],47:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * XHR based logger\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar XhrLoader = function () {\n function XhrLoader(config) {\n _classCallCheck(this, XhrLoader);\n\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n _createClass(XhrLoader, [{\n key: 'destroy',\n value: function destroy() {\n this.abort();\n this.loader = null;\n }\n }, {\n key: 'abort',\n value: function abort() {\n var loader = this.loader;\n if (loader && loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n\n window.clearTimeout(this.requestTimeout);\n this.requestTimeout = null;\n window.clearTimeout(this.retryTimeout);\n this.retryTimeout = null;\n }\n }, {\n key: 'load',\n value: function load(context, config, callbacks) {\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.stats = { trequest: performance.now(), retry: 0 };\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n }\n }, {\n key: 'loadInternal',\n value: function loadInternal() {\n var xhr,\n context = this.context;\n\n if (typeof XDomainRequest !== 'undefined') {\n xhr = this.loader = new XDomainRequest();\n } else {\n xhr = this.loader = new XMLHttpRequest();\n }\n\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n\n xhr.open('GET', context.url, true);\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.responseType = context.responseType;\n var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n if (this.xhrSetup) {\n this.xhrSetup(xhr, context.url);\n }\n // setup timeout before we perform request\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n xhr.send();\n }\n }, {\n key: 'readystatechange',\n value: function readystatechange(event) {\n var xhr = event.currentTarget,\n readyState = xhr.readyState,\n stats = this.stats,\n context = this.context,\n config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n if (status >= 200 && status < 300) {\n stats.tload = Math.max(stats.tfirst, performance.now());\n var data = void 0,\n len = void 0;\n if (context.responseType === 'arraybuffer') {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n var response = { url: xhr.responseURL, data: data };\n this.callbacks.onSuccess(response, stats, context);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _logger.logger.error(status + ' while loading ' + context.url);\n this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n } else {\n // retry\n _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n // aborts and resets internal state\n this.destroy();\n // schedule retry\n this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout() {\n _logger.logger.warn('timeout while loading ' + this.context.url);\n this.callbacks.onTimeout(this.stats, this.context);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // last args is to provide on progress data\n onProgress(stats, this.context, null);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"45\":45}]},{},[33])(33)\n});\n//# sourceMappingURL=hls.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hls.js/dist/hls.js\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"video.js\",\"commonjs2\":\"video.js\",\"amd\":\"video.js\",\"root\":\"videojs\"}\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar Hls = require('hls.js');\n\n/**\n * hls.js source handler\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = new Hls(options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n\n return function() {\n var now = Date.now();\n\n if (!_recoverDecodingErrorDate || (now - _recoverDecodingErrorDate) > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n }\n else if (!_recoverAudioCodecErrorDate || (now - _recoverAudioCodecErrorDate) > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function(e) {\n var mediaError = e.currentTarget.error;\n\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n *\n */\n this.dispose = function() {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function() {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(Hls.Events.LEVEL_LOADED, function(event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(Hls.Events.ERROR, function(event, data) {\n if (data.fatal) {\n switch (data.type) {\n case Hls.ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case Hls.ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n\n Object.keys(Hls.Events).forEach(function(key) {\n var eventName = Hls.Events[key];\n hls.on(eventName, function(event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\n\nvar HlsSourceHandler = {\n canHandleSource: function(source) {\n var hlsTypeRE = /^application\\/x-mpegURL$/i;\n var hlsExtRE = /\\.m3u8/i;\n\n if (source.skipContribHlsJs) {\n return '';\n }\n else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n }\n else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n }\n else {\n return '';\n }\n },\n handleSource: function(source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function(type) {\n var hlsTypeRE = /^application\\/x-mpegURL$/i;\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n }\n};\n\nif (Hls.isSupported()) {\n var videojs = require('video.js'); // resolved UMD-wise through webpack\n\n if (videojs) {\n videojs.getComponent('Html5').registerSourceHandler(HlsSourceHandler, 0);\n }\n else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/videojs5.hlsjs.js\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///videojs-contrib-hlsjs.min.js","webpack:///webpack/bootstrap 40673ba98f65560086ba","webpack:///./~/hls.js/dist/hls.js","webpack:///external {\"commonjs\":\"video.js\",\"commonjs2\":\"video.js\",\"amd\":\"video.js\",\"root\":\"videojs\"}","webpack:///./src/videojs5.hlsjs.js"],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","f","e","t","r","u","Error","code","length","1","_dereq_","EventEmitter","_events","_maxListeners","undefined","isFunction","arg","isNumber","isObject","isUndefined","defaultMaxListeners","setMaxListeners","isNaN","TypeError","emit","type","er","handler","len","args","listeners","error","arguments","err","context","Array","slice","apply","addListener","listener","newListener","push","warned","console","trace","on","once","g","removeListener","fired","list","position","splice","removeAllListeners","key","listenerCount","evlistener","emitter","2","HASH_SPLIT","QUERY_SPLIT","DOMAIN_SPLIT","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","trim","test","relativeURLQuery","relativeURLHash","relativeURLHashSplit","exec","relativeURLQuerySplit","baseURLHashSplit","baseURLQuerySplit","baseURLDomainSplit","baseURLProtocol","baseURLProtocolDomain","baseURLPath","indexOf","builtURL","buildAbsolutePath","substring","basePath","relativePath","nUpLn","nEnd","sRelPath","sDir","sPath","replace","nStart","RegExp","substr","3","bundleFn","sources","cache","stringify","JSON","fn","options","resolveSources","workerSources","depPath","depKey","wkey","cacheKeys","keys","exp","default","Math","floor","pow","random","toString","wcache","Function","skey","scache","src","map","join","URL","window","webkitURL","mozURL","msURL","blob","Blob","bare","workerUrl","createObjectURL","worker","Worker","objectURL","4","_interopRequireDefault","obj","_classCallCheck","instance","Constructor","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","writable","setPrototypeOf","__proto__","_createClass","defineProperties","target","props","descriptor","protoProps","staticProps","_events2","_eventHandler","_eventHandler2","_bufferHelper","_bufferHelper2","_errors","_logger","_ewmaBandwidthEstimator","_ewmaBandwidthEstimator2","AbrController","_EventHandler","hls","_this","getPrototypeOf","FRAG_LOADING","FRAG_LOADED","FRAG_BUFFERED","ERROR","lastLoadedFragLevel","_autoLevelCapping","_nextAutoLevel","onCheck","abandonRulesCheck","bind","clearTimer","destroy","data","frag","timer","setInterval","bwEstimator","level","isLive","levels","details","live","config","ewmaFast","ewmaSlow","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","fragCurrent","v","media","loader","minAutoLevel","stats","aborted","logger","warn","paused","playbackRate","readyState","autoLevel","requestDelay","performance","now","trequest","abs","duration","loadRate","max","bw","loaded","levelBitrate","realBitrate","bitrate","expectedLen","total","round","pos","currentTime","fragLoadedDelay","bufferStarvationDelay","bufferInfo","maxBufferHole","end","fragLevelNextLoadedDelay","nextLoadLevel","levelNextBitrate","toFixed","sample","abort","trigger","FRAG_LOAD_EMERGENCY_ABORTED","loadedBytes","bytes","loadedDuration","bitrateTest","tparsed","tbuffered","tload","onFragBuffered","loadCounter","fragLoadingProcessingMs","log","tfirst","bitrateTestDelay","ErrorDetails","FRAG_LOAD_ERROR","FRAG_LOAD_TIMEOUT","clearInterval","currentLevel","currentFragDuration","currentBw","maxAutoLevel","maxFetchDuration","bwFactor","bwUpFactor","levelInfo","levelDetails","avgDuration","totalduration","fragments","adjustedbw","fetchDuration","set","newLevel","nextAutoLevel","minAutoBitrate","canEstimate","min","nextABRAutoLevel","nextLevel","autoLevelCapping","avgbw","getEstimate","bestLevel","findBestLevel","abrBandWidthFactor","abrBandWidthUpFactor","maxStarvationDelay","maxLoadingDelay","26","27","28","30","45","9","5","_typeof","Symbol","iterator","_binarySearch","_binarySearch2","_demuxer","_demuxer2","_levelHelper","_levelHelper2","_timeRanges","_timeRanges2","State","STOPPED","STARTING","IDLE","PAUSED","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","BUFFER_FLUSHING","ENDED","WAITING_INIT_PTS","AudioStreamController","MEDIA_ATTACHED","MEDIA_DETACHING","AUDIO_TRACKS_UPDATED","AUDIO_TRACK_SWITCHING","AUDIO_TRACK_LOADED","KEY_LOADED","FRAG_PARSING_INIT_SEGMENT","FRAG_PARSING_DATA","FRAG_PARSED","BUFFER_CREATED","BUFFER_APPENDED","BUFFER_FLUSHED","INIT_PTS_FOUND","audioCodecSwap","ticks","_state","ontick","tick","initPTS","waitingFragment","stopLoad","state","demuxerId","id","cc","onFragLoaded","startPosition","tracks","lastCurrentTime","fragLoadError","nextLoadPosition","fragPrevious","demuxer","doTick","setTimeout","track","trackDetails","retryDate","isSeeking","_this2","_ret","loadedmetadata","startFragRequested","startFragPrefetch","mediaBuffer","bufferLen","bufferEnd","maxBufLen","maxMaxBufferLength","audioSwitch","trackId","sn","endSN","seeking","BUFFER_EOS","fragLen","start","PTSKnown","nextStart","loadIdx","fragLoadIdx","nextBuffered","foundFrag","maxFragLookUpTolerance","search","candidate","startSN","decryptdata","uri","maxThreshold","fragLoadingLoopThreshold","ErrorTypes","MEDIA_ERROR","FRAG_LOOP_LOADING_ERROR","fatal","onvseeking","onMediaSeeking","onvended","onMediaEnded","addEventListener","autoStartLoad","startLoad","ended","forEach","fragment","removeEventListener","onvseeked","audioTracks","altAudio","url","newDetails","sliding","curDetails","mergeDetails","startTimeOffset","audioCodec","defaultAudioCodec","appended","pendingBuffering","payload","video","audio","levelCodec","BUFFER_CODECS","container","codec","initSegment","appendObj","parent","content","pendingData","BUFFER_APPENDING","_this3","startPTS","endPTS","startDTS","endDTS","nb","updateFragPTSDTS","appendOnBufferFlush","startOffset","endOffset","Number","POSITIVE_INFINITY","AUDIO_TRACK_SWITCHED","data1","data2","buffer","_checkAppendedParsed","audioTrack","pending","buffered","loadError","fragLoadingMaxRetry","delay","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","AUDIO_TRACK_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","_this4","nextState","previousState","22","31","41","46","6","AudioTrackController","MANIFEST_LOADING","MANIFEST_LOADED","updateTrack","defaultFound","targetduration","newId","eventObj","AUDIO_TRACK_SWITCH","AUDIO_TRACK_LOADING","audioTrackId","setAudioTrackInternal","7","BufferController","MEDIA_ATTACHING","MANIFEST_PARSED","BUFFER_RESET","LEVEL_PTS_UPDATED","LEVEL_UPDATED","_msDuration","_levelDuration","onsbue","onSBUpdateEnd","onsbe","onSBUpdateError","pendingTracks","audioBuffer","sourceBuffer","timestampOffset","updating","audioTimestampOffset","audioExpected","videoExpected","sourceBufferNb","ms","mediaSource","MediaSource","onmso","onMediaSourceOpen","onmse","onMediaSourceEnded","onmsc","onMediaSourceClose","endOfStream","message","revokeObjectURL","removeAttribute","load","flushRange","segments","MEDIA_DETACHED","checkPendingTracks","pendingTracksNb","createSourceBuffers","doAppending","_needsFlush","doFlush","_needsEos","checkEos","appending","reduce","counter","segment","updateMediaElementDuration","event","BUFFER_APPENDING_ERROR","sb","removeSourceBuffer","trackName","mimeType","addSourceBuffer","BUFFER_ADD_CODEC_ERROR","dataType","sbobj","flushBufferCounter","levelDuration","Infinity","range","flushBuffer","shift","unshift","appendBuffer","appendError","BUFFER_FULL_ERROR","BUFFER_APPEND_ERROR","appendErrorMaxRetry","typeIn","bufStart","bufEnd","flushStart","flushEnd","navigator","userAgent","toLowerCase","remove","8","CapLevelController","FPS_DROP_LEVEL_CAPPING","capLevelToPlayerSize","restrictedLevels","isLevelRestricted","droppedLevel","HTMLVideoElement","firstLevel","getMaxLevel","detectPlayerSize","levelsLength","streamController","nextLevelSwitch","capLevelIndex","result","mWidth","mediaWidth","mHeight","mediaHeight","lWidth","lHeight","width","height","pixelRatio","devicePixelRatio","clientWidth","offsetWidth","contentScaleFactor","clientHeight","offsetHeight","_ewma","_ewma2","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","durationMs","numBytes","bandwidth","weight","getTotalWeight","44","10","FPSController","isVideoPlaybackQualityAvailable","capLevelOnFPSDrop","getVideoPlaybackQuality","checkFPSInterval","fpsDroppedMonitoringPeriod","decodedFrames","droppedFrames","lastTime","currentPeriod","currentDropped","lastDroppedFrames","currentDecoded","lastDecodedFrames","droppedFPS","FPS_DROP","totalDroppedFrames","fpsDroppedMonitoringThreshold","videoPlaybackQuality","checkFPS","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","11","LevelController","LEVEL_LOADED","_manualLevel","clearTimeout","canload","_levels","bitrateStart","levels0","bitrateSet","videoCodecFound","audioCodecFound","brokenmp4inmp3","checkSupported","isTypeSupported","videoCodec","attrs","AUDIO","redundantLevelId","urlId","filter","sort","b","_firstLevel","MANIFEST_INCOMPATIBLE_CODECS_ERROR","reason","_level","LEVEL_SWITCH","LEVEL_LOADING","OTHER_ERROR","LEVEL_SWITCH_ERROR","levelId","levelError","abrController","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","REMUX_ALLOC_ERROR","nbRedundantLevel","mediaBuffered","isBuffered","retryDelay","levelLoadingRetryDelay","fragLoaded","curLevel","reloadInterval","averagetargetduration","setLevelInternal","_startLevel","configStartLevel","startLevel","12","WAITING_LEVEL","StreamController","_doTickIdle","_checkBuffer","_checkFragmentChanged","levelLastLoaded","maxBufferSize","maxBufferLength","_fetchPayloadOrEos","initialLiveManifestSize","_ensureFragmentAtLivePoint","_findFragment","_loadFragmentOrKey","maxLatency","liveMaxLatencyDuration","liveMaxLatencyDurationCount","liveSyncPosition","computeLivePosition","targetSN","deltaPTS","curSNIdx","dropped","autoLevelEnabled","bufferRange","getBufferRange","rangeCurrent","fragPlaying","FRAG_CHANGED","immediateSwitch","previouslyPaused","pause","flushMainBuffer","play","fetchdelay","currentRange","nextRange","nextLevelId","fragLastKbps","followingBufferRange","flushScope","onMediaSeeked","tolerance","fragStartOffset","fragEndOffset","stalled","aac","heaac","audioCodecSwitch","startLevelLoaded","newLevelId","lastAudioCodec","mediaSeeking","accurateTimeOffset","ua","metadata","channelCount","unique","mergedTrack","audiovideo","drift","videoBuffer","mediaTrack","alternate","_reduceMaxBufferLength","minLength","immediateLevelSwitchEnd","expectedPlaying","playheadMoving","stallReported","nudgeRetry","tnow","stalledDuration","lowBufferWatchdogPeriod","BUFFER_STALLED_ERROR","nextBufferStart","delta","maxSeekHole","nudgeOffset","BUFFER_SEEK_OVER_HOLE","hole","highBufferWatchdogPeriod","nudgeMaxRetry","_currentTime","targetTime","BUFFER_NUDGE_ON_STALL","startPositionBuffered","targetLatency","liveSyncDuration","liveSyncDurationCount","STREAM_STATE_TRANSITION","nextBufferRange","_liveSyncPosition","13","_cea608Parser","_cea608Parser2","TimelineController","FRAG_PARSING_USERDATA","enabled","Cues","cueHandler","enableCEA708Captions","sendAddTrackEvent","Event","document","createEvent","initEvent","dispatchEvent","channel1","newCue","startTime","endTime","screen","textTrack1","existingTrack1","getExistingTrack","clearCurrentCues","createTextTrack","channel2","textTrack2","existingTrack2","cea608Parser","cues","removeCue","channelNumber","textTracks","textTrack","propName","kind","label","lang","addTextTrack","lastPts","NEGATIVE_INFINITY","closedCaptions","pts","samples","ccdatas","extractCea608Data","addData","byteArray","tmpByte","ccbyte1","ccbyte2","ccValid","ccType","count","actualCCBytes","j","42","14","AESCrypto","subtle","iv","aesIV","decrypt","15","AESDecryptor","rcon","subMix","Uint32Array","invSubMix","sBox","invSBox","initTable","arrayBuffer","view","DataView","newArray","getUint32","subMix0","subMix1","subMix2","subMix3","invSubMix0","invSubMix1","invSubMix2","invSubMix3","x","xi","sx","x2","x4","x8","keyBuffer","uint8ArrayToUint32Array_","sameKey","offset","keySize","ksRows","ksRow","invKsRow","keySchedule","invKeySchedule","sbox","prev","word","inputArrayBuffer","nRounds","invSBOX","initVector","initVector0","initVector1","initVector2","initVector3","inputInt32","Int32Array","outputInt32","t0","t1","t2","t3","s0","s1","s2","s3","inputWords0","inputWords1","inputWords2","inputWords3","networkToHostOrderSwap","16","_aesCrypto","_aesCrypto2","_fastAesKey","_fastAesKey2","_aesDecryptor","_aesDecryptor2","Decrypter","observer","browserCrypto","crypto","webkitSubtle","disableWebCrypto","callback","enableSoftwareAES","decryptor","expandKey","fastAesKey","then","aesKey","catch","onWebCryptoError","FRAG_DECRYPT_ERROR","17","FastAESKey","importKey","18","_adts","_adts2","_id","_id2","AACDemuxer","remuxerClass","typeSupported","remuxer","insertDiscontinuity","_aacTrack","sequenceNumber","isAAC","timeOffset","defaultInitPTS","frameLength","frameDuration","frameIndex","headerLength","stamp","aacSample","id3","timeStamp","contiguous","lastCC","switchLevel","lastLevel","lastSN","audiosamplerate","getAudioConfig","samplerate","manifestCodec","unit","subarray","dts","remux","hasTimeStamp","19","24","ADTS","adtsObjectType","adtsSampleingIndex","adtsExtensionSampleingIndex","adtsChanelConfig","adtsSampleingRates","FRAG_PARSING_ERROR","20","_decrypter","_decrypter2","_aacdemuxer","_aacdemuxer2","_tsdemuxer","_tsdemuxer2","_mp4Remuxer","_mp4Remuxer2","_passthroughRemuxer","_passthroughRemuxer2","DemuxerInline","byteLength","method","decrypter","localthis","Date","decryptedData","FRAG_DECRYPTED","tstart","tdecrypt","pushDecrypted","Uint8Array","probe","mp2t","25","38","39","21","_demuxerInline","_demuxerInline2","_events3","_events4","DemuxerWorker","_len","_key","concat","off","_len2","_key2","forwardMessage","ev","postMessage","cmd","parse","enableLogs","debug","FRAG_PARSING_METADATA","_demuxerWorker","_demuxerWorker2","Demuxer","mp4","enableMP2TPassThrough","mpeg","mp3","enableWorker","w","work","onwmsg","onWorkerMessage","onerror","INTERNAL_EXCEPTION","filename","lineno","demuxInitialized","terminate","23","ExpGolomb","bytesAvailable","bitsAvailable","workingBytes","availableBytes","skipBytes","loadWord","size","bits","valu","readBits","leadingZeroCount","skipLZ","skipBits","clz","readUEG","deltaScale","lastScale","nextScale","readEG","profileIdc","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","readUByte","readBoolean","skipEG","skipUEG","skipScalingList","chromaFormatIdc","picOrderCntType","ceil","ID3","_hasTimeStamp","byte1","byte2","byte3","byte4","tagSize","endPos","header","readUTF","_parseID3Frames","_length","_payload","String","fromCharCode","tagId","timestamp","pts33Bit","_timeStamp","_expGolomb","_expGolomb2","TSDemuxer","pmtParsed","_pmtId","_avcTrack","_audioTrack","_id3Track","_txtTrack","aacOverFlow","aacLastPTS","avcSample","stt","pid","pes","codecsOnly","passthrough","unknownPIDs","_duration","avcTrack","id3Track","avcId","audioId","id3Id","pmtId","avcData","pesData","audioData","id3Data","parsePAT","_parsePAT","parsePMT","_parsePMT","parsePES","_parsePES","parseAVCPES","_parseAVCPES","parseAACPES","_parseAACPES","parseMPEGPES","_parseMPEGPES","parseID3PES","_parseID3PES","parsedPIDs","avc","nbNalu","naluLen","units","nbUnits","sampleLen","_initPTS","_initDTS","mpegSupported","sectionLength","tableEnd","programInfoLength","stream","pesFlags","pesLen","pesHdrLen","pesPts","pesDts","payloadStartOffset","newData","dataLen","frame","forceKeyFrameOnDiscontinuity","sps","last","expGolombDecoder","_parseAVCNALu","sliceType","readSliceType","_createAVCSample","discardEPB","payloadType","payloadSize","endOfCaptions","readUShort","readUInt","firstByte","secondByte","totalCCs","_insertSampleInOrder","readSPS","codecarray","codecstring","h","pps","pushAccesUnit","arr","lastUnit","array","overflow","unitType","lastUnitType","naluState","lastState","lastUnitStart","_getLastNalUnit","tmp","_lastUnit","_tmp","newLength","EPBPositions","sourceIndex","newPTS","parsed","_parseMpeg","bitRate","sampleRate","BitratesMap","SamplingRateMap","headerB","headerC","headerE","headerF","headerG","columnInBitrates","columnInSampleRates","padding","_onMpegFrame","_onMpegNoise","NETWORK_ERROR","MUX_ERROR","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","EventHandler","onEvent","events","handledEvents","useGenericHandler","registerListeners","unregisterListeners","isEventHandler","onEventGeneric","eventToFunction","funcName","FRAG_LOAD_PROGRESS","DESTROYING","29","AAC","BufferHelper","maxHoleDuration","vbuffered","bufferedInfo","bufferStart","bufferStartNext","buffered2","diff","buf2len","buf2end","LevelHelper","oldDetails","PTSFrag","oldfragments","newfragments","ccOffset","oldFrag","newFrag","fragIdx","updatePTS","fromIdx","toIdx","fragFrom","fragTo","fragToPTS","32","_playlistLoader","_playlistLoader2","_fragmentLoader","_fragmentLoader2","_abrController","_abrController2","_bufferController","_bufferController2","_capLevelController","_capLevelController2","_audioStreamController","_audioStreamController2","_streamController","_streamController2","_levelController","_levelController2","_timelineController","_timelineController2","_fpsController","_fpsController2","_audioTrackController","_audioTrackController2","_xhrLoader","_xhrLoader2","_keyLoader","_keyLoader2","_cues","_cues2","Hls","defaultConfig","DefaultConfig","prop","playlistLoader","fragmentLoader","levelController","bufferController","capLevelController","fpsController","audioStreamController","timelineController","audioTrackController","keyLoader","WebKitMediaSource","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fLoader","pLoader","xhrSetup","fetchSetup","stretchShortVideoTrack","detachMedia","swapAudioCodec","attachMedia","loadLevel","immediateLevelSwitch","manualLevel","34","35","36","43","47","33","FragmentLoader","loaders","loaderName","loaderContext","loaderConfig","loaderCallbacks","responseType","progressData","byteRangeStartOffset","byteRangeEndOffset","rangeStart","rangeEnd","timeout","maxRetry","maxRetryDelay","onSuccess","loadsuccess","onError","loaderror","onTimeout","loadtimeout","onProgress","loadprogress","response","KeyLoader","decryptkey","decrypturl","_urlToolkit","_urlToolkit2","_attrList","_attrList2","MASTER_PLAYLIST_REGEX","MASTER_PLAYLIST_MEDIA_REGEX","LEVEL_PLAYLIST_REGEX_FAST","LevelKey","_uri","reluri","baseuri","Fragment","_url","_byteRange","_decryptdata","tagList","segmentNumber","uint8View","levelkey","createInitializationVector","relurl","baseurl","_programDateTime","rawProgramDateTime","byteRange","rawByteRange","params","split","lastByteRangeEndOffset","parseInt","fragmentDecryptdataFromLevelkey","PlaylistLoader","retry","baseUrl","string","lastIndex","resolve","resolution","decimalResolution","decimalInteger","NAME","codecs","CODECS","avc1toavcoti","medias","TYPE","groupId","DEFAULT","autoselect","AUTOSELECT","forced","FORCED","URI","LANGUAGE","avcdata","currentSN","version","prevFrag","parseFloat","title","match","value1","value2","toUpperCase","decryptparams","keyAttrs","decryptmethod","enumeratedString","decrypturi","decryptiv","hexadecimalInteger","startParams","startAttrs","decimalFloatingPoint","mapAttrs","BYTERANGE","pop","isLevel","parseLevelPlaylist","parseMasterPlaylist","audiotracks","parseMasterPlaylistMedia","embeddedAudioFound","40","37","MP4","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","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","box","DINF","timescale","baseMediaDecodeTime","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","hSpacing","vSpacing","configlen","sampleDependencyTable","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","init","movie","_aac","_aac2","_mp4Generator","_mp4Generator2","MP4Remuxer","ISGenerated","PES2MP4SCALEFACTOR","PES_TIMESCALE","MP4_TIMESCALE","videoTrack","generateIS","remuxAudio","audioTrackLength","remuxVideo","videoData","remuxEmptyAudio","remuxID3","remuxText","initDTS","audioSamples","videoSamples","pesTimeScale","computePTSDTS","greatestCommonDivisor","mp4SampleDuration","firstPTS","firstDTS","lastPTS","lastDTS","pes2mp4ScaleFactor","inputSamples","outputSamples","nbSamples","ptsNormalize","_PTSNormalize","deltadts","PTSDTSshift","curr","nextAvcDts","vendor","isSafari","_i","_sample","mdatSize","setUint32","_i2","avcSampleUnits","mp4SampleLength","compositionTimeOffset","unitData","unitDataLen","lastFrameDuration","gapTolerance","deltaToFrameEnd","nextAudioPts","audioSample","mp4Sample","ptsnorm","dtsnorm","fillFrame","newStamp","mp4timeScale","expectedSampleDuration","pesFrameDuration","rawMPEG","nextPtsNorm","ptsNorm","missing","getSilentFrame","_j","_nbSamples","_delta","numMissingFrames","_i3","unitLen","lastSampleDuration","silentFrame","index","reference","PassThroughRemuxer","rawData","DECIMAL_RESOLUTION_REGEX","ATTR_LIST_REGEX","AttrList","parseAttrList","attr","attrName","intValue","MAX_SAFE_INTEGER","stringValue","res","input","lastIndexOf","BinarySearch","comparisonFunction","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","specialCea608CharsCodes","92","94","95","96","123","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200","201","202","203","204","205","206","207","getCharForByte","byte","charCode","NR_ROWS","NR_COLS","rowsLowCh1","rowsHighCh1","rowsLowCh2","rowsHighCh2","backgroundColors","verboseFilter","DATA","DEBUG","INFO","WARNING","TEXT","time","verboseLevel","setTime","newTime","severity","msg","minLevel","numArrayToHexArray","numArray","hexArray","PenState","foreground","underline","italics","background","flash","styles","attribs","style","other","newPenState","StyledUnicodeChar","uchar","penState","reset","copy","equals","newChar","isDefault","Row","chars","currPenState","equal","empty","isEmpty","absPos","relPos","newPos","setPenState","setCursor","moveCursor","setChar","backSpace","char","startPos","clearFromPos","setStyles","CaptionScreen","rows","currRow","nrRollUpRows","clear","clearToEndOfRow","insertChar","setPenStyles","pacData","lastOutputScreen","newRow","row","topRowIndex","prevLineTime","cueStartTime","indent","prevPos","color","setPen","bkgData","nrRows","getDisplayText","topRow","asOneRow","displayText","text","rowNr","rowText","getTextString","Cea608Channel","outputFilter","chNr","mode","verbose","displayedMemory","nonDisplayedMemory","currRollUpRow","writeScreen","lastCueEndTime","newHandler","setPAC","setBkgData","newMode","outputDataUpdate","setMode","setRollUpRows","rollUp","nrCols","colorIndex","colors","updateData","Cea608Parser","field","out1","out2","outputs","channels","currChNr","lastCmdA","lastCmdB","bufferedData","dataCounters","getHandler","setHandler","byteList","cmdFound","charsFound","parseCmd","parseMidrow","parsePAC","parseBackgroundAttributes","parseChars","channel","insertChars","cond1","cond2","ccRCL","ccBS","ccAOF","ccAON","ccDER","ccRU","ccFON","ccRDC","ccTR","ccRTD","ccEDM","ccCR","ccENM","ccEOC","ccTO","ccMIDROW","case1","case2","interpretPAC","pacIndex","channelNr","charCodes","charCode1","oneCode","hexCodes","cueSplitAtTime","captionScreen","cue","indenting","VTTCue","TextTrackCue","line","align","addCue","EWMA","halfLife","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","noop","formatMsg","consolePrintFn","func","exportLoggerFunctions","debugConfig","functions","exportedLogger","fakeLogger","info","TimeRanges","XhrLoader","requestTimeout","retryTimeout","callbacks","loadInternal","xhr","XDomainRequest","XMLHttpRequest","onreadystatechange","readystatechange","onprogress","open","setRequestHeader","send","currentTarget","status","responseText","responseURL","statusText","lengthComputable","Html5HlsJS","source","tech","errorHandlerFactory","_recoverDecodingErrorDate","_recoverAudioCodecErrorDate","recoverMediaError","options_","el","hlsjsConfig","hlsjsErrorHandler","videoTagErrorHandler","mediaError","MEDIA_ERR_DECODE","dispose","Events","eventName","loadSource","hlsTypeRE","hlsExtRE","HlsSourceHandler","canHandleSource","skipContribHlsJs","handleSource","canPlayType","isSupported","videojs","getComponent","registerSourceHandler"],"mappings":"CAAA,SAAAA,EAAAC,GACA,mBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,iBACA,sBAAAC,gBAAAC,IACAD,QAAA,YAAAJ,OACA,CACA,GAAAM,GAAAN,EAAA,gBAAAC,SAAAE,QAAA,YAAAJ,EAAA,QACA,QAAAQ,KAAAD,IAAA,gBAAAL,iBAAAF,GAAAQ,GAAAD,EAAAC,KAECC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAX,OAGA,IAAAC,GAAAW,EAAAD,IACAL,EAAAK,EACAE,GAAA,EACAb,WAUA,OANAS,GAAAE,GAAAG,KAAAb,EAAAD,QAAAC,IAAAD,QAAAU,GAGAT,EAAAY,GAAA,EAGAZ,EAAAD,QA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A2gD,GACA,MACA,SACAh3D,QAAAZ,MAAA,oDAMA3C,OAAAwH,KAAAirC,EAAAmoB,QAAArgD,QAAA,SAAArW,GACA,GAAA22D,GAAApoB,EAAAmoB,OAAA12D,EACAqH,GAAA9H,GAAAo3D,EAAA,SAAAp4C,EAAAnW,GACAytD,EAAA7pD,QAAA2qD,EAAAvuD,OAKAf,EAAAgpC,YAAA8lB,GACA9uD,EAAAuvD,WAAAhB,EAAA1xD,KAtGA,GAAAqqC,GAAArzC,EAAA,GAyGA27D,EAAA,kDACAC,EAAA,UAEAC,GACAC,gBAAA,SAAApB,GACA,MAAAA,GAAAqB,iBACA,GAEAJ,EAAAh2D,KAAA+0D,EAAAz3D,MACA,WAEA24D,EAAAj2D,KAAA+0D,EAAA1xD,KACA,QAGA,IAGAgzD,aAAA,SAAAtB,EAAAC,GACA,UAAAF,GAAAC,EAAAC,IAEAsB,YAAA,SAAAh5D,GACA,MAAA04D,GAAAh2D,KAAA1C,GACA,WAGA,IAIA,IAAAowC,EAAA6oB,cAAA,CACA,GAAAC,GAAAn8D,EAAA,EAEAm8D,GACAA,EAAAC,aAAA,SAAAC,sBAAAR,EAAA,GAGA13D,QAAAyK,KAAA","file":"videojs-contrib-hlsjs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"video.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"video.js\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"video.js\")) : factory(root[\"videojs\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"video.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"video.js\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"video.js\")) : factory(root[\"videojs\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar require;var require;(function(f){if(true){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return require(o,!0);if(i)return require(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],2:[function(_dereq_,module,exports){\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var HASH_SPLIT = /^([^#]*)(.*)$/;\r\n var QUERY_SPLIT = /^([^\\?]*)(.*)$/;\r\n var DOMAIN_SPLIT = /^(([a-z]+:\\/\\/)?[^:\\/]+(?::[0-9]+)?)?(\\/?.*)$/i;\r\n\r\n var URLToolkit = {\r\n // build an absolute URL from a relative one using the provided baseURL\r\n // if relativeURL is an absolute URL it will be returned as is.\r\n buildAbsoluteURL: function(baseURL, relativeURL) {\r\n // remove any remaining space and CRLF\r\n relativeURL = relativeURL.trim();\r\n if (/^[a-z]+:/i.test(relativeURL)) {\r\n // complete url, not relative\r\n return relativeURL;\r\n }\r\n\r\n var relativeURLQuery = null;\r\n var relativeURLHash = null;\r\n\r\n var relativeURLHashSplit = HASH_SPLIT.exec(relativeURL);\r\n if (relativeURLHashSplit) {\r\n relativeURLHash = relativeURLHashSplit[2];\r\n relativeURL = relativeURLHashSplit[1];\r\n }\r\n var relativeURLQuerySplit = QUERY_SPLIT.exec(relativeURL);\r\n if (relativeURLQuerySplit) {\r\n relativeURLQuery = relativeURLQuerySplit[2];\r\n relativeURL = relativeURLQuerySplit[1];\r\n }\r\n\r\n var baseURLHashSplit = HASH_SPLIT.exec(baseURL);\r\n if (baseURLHashSplit) {\r\n baseURL = baseURLHashSplit[1];\r\n }\r\n var baseURLQuerySplit = QUERY_SPLIT.exec(baseURL);\r\n if (baseURLQuerySplit) {\r\n baseURL = baseURLQuerySplit[1];\r\n }\r\n\r\n var baseURLDomainSplit = DOMAIN_SPLIT.exec(baseURL);\r\n if (!baseURLDomainSplit) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n \r\n // e.g. 'http://', 'https://', ''\r\n var baseURLProtocol = baseURLDomainSplit[2] || '';\r\n // e.g. 'http://example.com', '//example.com', 'example.com', ''\r\n var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\r\n // e.g. '/a/b/c/playlist.m3u8', 'a/b/c/playlist.m3u8'\r\n var baseURLPath = baseURLDomainSplit[3];\r\n if (baseURLPath.indexOf('/') !== 0 && baseURLProtocolDomain !== '') {\r\n // this handles a base url of http://example.com (missing last slash)\r\n baseURLPath = '/'+baseURLPath;\r\n }\r\n\r\n var builtURL = null;\r\n if (/^\\/\\//.test(relativeURL)) {\r\n // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\r\n builtURL = baseURLProtocol+URLToolkit.buildAbsolutePath('', relativeURL.substring(2));\r\n }\r\n else if (/^\\//.test(relativeURL)) {\r\n // relative url starts with '/' so start from root of domain\r\n builtURL = baseURLProtocolDomain+'/'+URLToolkit.buildAbsolutePath('', relativeURL.substring(1));\r\n }\r\n else {\r\n builtURL = URLToolkit.buildAbsolutePath(baseURLProtocolDomain+baseURLPath, relativeURL);\r\n }\r\n\r\n // put the query and hash parts back\r\n if (relativeURLQuery) {\r\n builtURL += relativeURLQuery;\r\n }\r\n if (relativeURLHash) {\r\n builtURL += relativeURLHash;\r\n }\r\n return builtURL;\r\n },\r\n\r\n // build an absolute path using the provided basePath\r\n // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\r\n // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\r\n buildAbsolutePath: function(basePath, relativePath) {\r\n var sRelPath = relativePath;\r\n var nUpLn, sDir = '', sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\r\n for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\r\n nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\r\n sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + ((nUpLn - 1) / 3) + '}$'), '/');\r\n }\r\n return sDir + sPath.substr(nStart);\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[function(_dereq_,module,exports){\nvar bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn, options) {\n var wkey;\n var cacheKeys = Object.keys(cache);\n\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n var exp = cache[key].exports;\n // Using babel as a transpiler to use esmodule, the export will always\n // be an object with the default export as a property of it. To ensure\n // the existing api and babel esmodule exports are both supported we\n // check for both\n if (exp === fn || exp && exp.default === fn) {\n wkey = key;\n break;\n }\n }\n\n if (!wkey) {\n wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n var wcache = {};\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n wcache[key] = key;\n }\n sources[wkey] = [\n Function(['require','module','exports'], '(' + fn + ')(self)'),\n wcache\n ];\n }\n var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\n var scache = {}; scache[wkey] = wkey;\n sources[skey] = [\n Function(['require'], (\n // try to call default if defined to also support babel esmodule\n // exports\n 'var f = require(' + stringify(wkey) + ');' +\n '(f.default ? f.default : f)(self);'\n )),\n scache\n ];\n\n var workerSources = {};\n resolveSources(skey);\n\n function resolveSources(key) {\n workerSources[key] = true;\n\n for (var depPath in sources[key][1]) {\n var depKey = sources[key][1][depPath];\n if (!workerSources[depKey]) {\n resolveSources(depKey);\n }\n }\n }\n\n var src = '(' + bundleFn + ')({'\n + Object.keys(workerSources).map(function (key) {\n return stringify(key) + ':['\n + sources[key][0]\n + ',' + stringify(sources[key][1]) + ']'\n ;\n }).join(',')\n + '},{},[' + stringify(skey) + '])'\n ;\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n var blob = new Blob([src], { type: 'text/javascript' });\n if (options && options.bare) { return blob; }\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n};\n\n},{}],4:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nvar _ewmaBandwidthEstimator = _dereq_(9);\n\nvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * simple ABR Controller\n * - compute next level based on last fragment bw heuristics\n * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n */\n\nvar AbrController = function (_EventHandler) {\n _inherits(AbrController, _EventHandler);\n\n function AbrController(hls) {\n _classCallCheck(this, AbrController);\n\n var _this = _possibleConstructorReturn(this, (AbrController.__proto__ || Object.getPrototypeOf(AbrController)).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\n _this.lastLoadedFragLevel = 0;\n _this._autoLevelCapping = -1;\n _this._nextAutoLevel = -1;\n _this.hls = hls;\n _this.onCheck = _this.abandonRulesCheck.bind(_this);\n return _this;\n }\n\n _createClass(AbrController, [{\n key: 'destroy',\n value: function destroy() {\n this.clearTimer();\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n if (!this.timer) {\n this.timer = setInterval(this.onCheck, 100);\n }\n // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n // so we need to wait for stream manifest / playlist type to instantiate it.\n if (!this.bwEstimator) {\n var hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast = void 0,\n ewmaSlow = void 0;\n\n if (isLive) {\n ewmaFast = config.abrEwmaFastLive;\n ewmaSlow = config.abrEwmaSlowLive;\n } else {\n ewmaFast = config.abrEwmaFastVoD;\n ewmaSlow = config.abrEwmaSlowVoD;\n }\n this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n }, {\n key: 'abandonRulesCheck',\n value: function abandonRulesCheck() {\n /*\n monitor fragment retrieval time...\n we compute expected time of arrival of the complete fragment.\n we compare it to expected time of buffer starvation\n */\n var hls = this.hls,\n v = hls.media,\n frag = this.fragCurrent,\n loader = frag.loader,\n minAutoLevel = this.minAutoLevel;\n\n // if loader has been destroyed or loading has been aborted, stop timer and return\n if (!loader || loader.stats && loader.stats.aborted) {\n _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n var stats = loader.stats;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n var requestDelay = performance.now() - stats.trequest,\n playbackRate = Math.abs(v.playbackRate);\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > 500 * frag.duration / playbackRate) {\n var levels = hls.levels,\n loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n // byte/s; at least 1 byte/s to avoid division by zero\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n // consider emergency switch down only if we have less than 2 frag buffered AND\n // time to finish loading current fragment is bigger than buffer starvation delay\n // ie if we risk buffer starvation if bw does not increase quickly\n if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n var fragLevelNextLoadedDelay = void 0,\n nextLoadLevel = void 0;\n // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n // we start from current level - 1 and we step down , until we find a matching level\n for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n // we found a lower level that be rebuffering free with current estimated bw !\n break;\n }\n }\n // only emergency switch down if it takes less time to load new fragment at lowest level instead\n // of finishing loading current one ...\n if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']= minAutoLevel; i--) {\n var levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...\n !fetchDuration || live || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var nextAutoLevel = this._nextAutoLevel,\n bwEstimator = this.bwEstimator,\n hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n // in case next auto level has been forced, and bw not available or not reliable\n if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n // cap next auto level by max auto level\n return Math.min(nextAutoLevel, this.maxAutoLevel);\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this.nextABRAutoLevel;\n if (nextAutoLevel !== -1) {\n // nextAutoLevel is defined, use it to cap ABR computed quality level\n nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n }\n if (minAutoBitrate !== undefined) {\n var levelNextBitrate = levels[nextABRAutoLevel].realBitrate ? Math.max(levels[nextABRAutoLevel].realBitrate, levels[nextABRAutoLevel].bitrate) : levels[nextABRAutoLevel].bitrate;\n while (levelNextBitrate < minAutoBitrate) {\n nextABRAutoLevel++;\n }\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var levels = this.hls.levels,\n autoLevelCapping = this._autoLevelCapping,\n maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n }, {\n key: 'nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = this.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = this.minAutoLevel;\n var v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = v ? v.currentTime : 0,\n\n // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n if (bestLevel >= 0) {\n return bestLevel;\n } else {\n _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,\n bwFactor = config.abrBandWidthFactor,\n bwUpFactor = config.abrBandWidthUpFactor;\n if (bufferStarvationDelay === 0) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n return Math.max(bestLevel, 0);\n }\n }\n }]);\n\n return AbrController;\n}(_eventHandler2.default);\n\nexports.default = AbrController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45,\"9\":9}],5:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Audio Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n STARTING: 'STARTING',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\n};\n\nvar AudioStreamController = function (_EventHandler) {\n _inherits(AudioStreamController, _EventHandler);\n\n function AudioStreamController(hls) {\n _classCallCheck(this, AudioStreamController);\n\n var _this = _possibleConstructorReturn(this, (AudioStreamController.__proto__ || Object.getPrototypeOf(AudioStreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED, _events2.default.INIT_PTS_FOUND));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\n return _this;\n }\n\n _createClass(AudioStreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n _logger.logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n this.startPosition = startPosition;\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n var _this2 = this;\n\n var pos,\n track,\n trackDetails,\n hls = this.hls,\n config = hls.config;\n //logger.log('audioStream:' + this.state);\n var now;\n var retryDate;\n var isSeeking;\n\n var _ret = function () {\n switch (_this2.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n _this2.state = State.WAITING_TRACK;\n _this2.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = _this2.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\n }\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!_this2.media && (_this2.startFragRequested || !config.startFragPrefetch)) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // if we have not yet loaded any fragment, start loading from start position\n if (_this2.loadedmetadata) {\n pos = _this2.media.currentTime;\n } else {\n pos = _this2.nextLoadPosition;\n }\n var media = _this2.mediaBuffer ? _this2.mediaBuffer : _this2.media,\n bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = _this2.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = _this2.audioSwitch,\n trackId = _this2.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen && trackId < tracks.length) {\n trackDetails = tracks[trackId].details;\n // if track info not retrieved yet, switch state and wait for track retrieval\n if (typeof trackDetails === 'undefined') {\n _this2.state = State.WAITING_TRACK;\n break;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!_this2.media.seeking || _this2.media.duration - bufferEnd < fragPrevious.duration / 2) {\n // Finalize the media stream\n _this2.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n _this2.state = State.ENDED;\n break;\n }\n }\n\n // find fragment index, contiguous with end of buffer position\n var fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n frag = void 0;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n _this2.media.currentTime = start + 0.05;\n } else {\n return {\n v: void 0\n };\n }\n }\n }\n }\n\n // if bufferEnd before start of playlist, load first fragment\n if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === _this2.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + _this2.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n _this2.media.currentTime = nextBuffered + 0.05;\n return {\n v: void 0\n };\n }\n } else {\n (function () {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n return -1;\n }\n return 0;\n });\n if (!foundFrag) {\n _logger.logger.log('frag not found @bufferEnd/start:' + bufferEnd + '/' + start);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < trackDetails.endSN) {\n frag = fragments[frag.sn + 1 - trackDetails.startSN];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n } else {\n frag = null;\n }\n }\n }\n })();\n }\n if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);\n _this2.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (_this2.fragLoadIdx !== undefined) {\n _this2.fragLoadIdx++;\n } else {\n _this2.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(_this2.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return {\n v: void 0\n };\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = _this2.fragLoadIdx;\n _this2.fragCurrent = frag;\n _this2.startFragRequested = true;\n _this2.nextLoadPosition = frag.start + frag.duration;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n _this2.state = State.FRAG_LOADING;\n }\n }\n }\n break;\n case State.WAITING_TRACK:\n track = _this2.tracks[_this2.trackId];\n // check if playlist is already loaded\n if (track && track.details) {\n _this2.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n now = performance.now();\n retryDate = _this2.retryDate;\n\n media = _this2.media;\n isSeeking = media && media.seeking;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\n if (!retryDate || now >= retryDate || isSeeking) {\n _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n _this2.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var tracks = this.tracks;\n if (tracks) {\n // reset fragment load counter\n tracks.forEach(function (track) {\n if (track.details) {\n track.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (this.media) {\n this.lastCurrentTime = this.media.currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onAudioTracksUpdated',\n value: function onAudioTracksUpdated(data) {\n _logger.logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n this.trackId = data.id;\n this.state = State.IDLE;\n\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment = null;\n // destroy useless demuxer when switching audio to main\n if (!altAudio) {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n } else {\n // switching to audio track, start timer if not already started\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n }\n\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\n\n // compute start position\n if (!this.startFragRequested) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n this.startPosition = 0;\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n if (this.state === State.WAITING_TRACK) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n if (initPTS !== undefined) {\n this.pendingBuffering = true;\n _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, audioCodec, null, start, cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, initPTS);\n } else {\n _logger.logger.log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = 'mp4a.40.2';\n track.id = data.id;\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this3 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n (function () {\n var trackId = _this3.trackId,\n track = _this3.tracks[trackId],\n frag = _this3.fragCurrent,\n hls = _this3.hls;\n\n _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\n var audioSwitch = _this3.audioSwitch,\n media = _this3.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n _this3.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = _this3.pendingData;\n if (!_this3.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // arm pending Buffering flag before appending a segment\n _this3.pendingBuffering = true;\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n _this3.pendingData = [];\n _this3.appended = true;\n }\n }\n //trigger handler right now\n _this3.tick();\n })();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'audio') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to audio fragment\n if (frag && frag.type !== 'audio') {\n return;\n }\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n if (loadError <= config.fragLoadingMaxRetry) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this4 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this4.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n this.tick();\n }\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],6:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * audio track controller\n */\n\nvar AudioTrackController = function (_EventHandler) {\n _inherits(AudioTrackController, _EventHandler);\n\n function AudioTrackController(hls) {\n _classCallCheck(this, AudioTrackController);\n\n var _this = _possibleConstructorReturn(this, (AudioTrackController.__proto__ || Object.getPrototypeOf(AudioTrackController)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n this.updateTrack(this.trackId);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.audioTracks || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n // loop through available audio tracks and autoselect default if needed\n var id = 0;\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n _logger.logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n _logger.logger.log('audioTrack ' + data.id + ' loaded');\n this.tracks[data.id].details = data.details;\n // check if current playlist is a live playlist\n if (data.details.live && !this.timer) {\n // if live playlist we will have to reload it periodically\n // set reload period to playlist target duration\n this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n }\n if (!data.details.live && this.timer) {\n // playlist is not live and timer is armed : stopping it\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'setAudioTrackInternal',\n value: function setAudioTrackInternal(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('switching to audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n }]);\n\n return AudioTrackController;\n}(_eventHandler2.default);\n\nexports.default = AudioTrackController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],7:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Buffer Controller\n */\n\nvar BufferController = function (_EventHandler) {\n _inherits(BufferController, _EventHandler);\n\n function BufferController(hls) {\n _classCallCheck(this, BufferController);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\n var _this = _possibleConstructorReturn(this, (BufferController.__proto__ || Object.getPrototypeOf(BufferController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_PTS_UPDATED, _events2.default.LEVEL_UPDATED));\n\n _this._msDuration = null;\n // the value that we want to set mediaSource.duration to\n _this._levelDuration = null;\n\n // Source Buffer listeners\n _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n _this.onsbe = _this.onSBUpdateError.bind(_this);\n _this.pendingTracks = {};\n _this.tracks = {};\n return _this;\n }\n\n _createClass(BufferController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/dailymotion/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var audioExpected = data.audio,\n videoExpected = data.video,\n sourceBufferNb = 0;\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n if (data.altAudio && (audioExpected || videoExpected)) {\n sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var media = this.media = data.media;\n if (media) {\n // setup the media source\n var ms = this.mediaSource = new MediaSource();\n //Media Source listeners\n this.onmso = this.onMediaSourceOpen.bind(this);\n this.onmse = this.onMediaSourceEnded.bind(this);\n this.onmsc = this.onMediaSourceClose.bind(this);\n ms.addEventListener('sourceopen', this.onmso);\n ms.addEventListener('sourceended', this.onmse);\n ms.addEventListener('sourceclose', this.onmsc);\n // link video and media Source\n media.src = URL.createObjectURL(ms);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n _logger.logger.log('media source detaching');\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n ms.endOfStream();\n } catch (err) {\n _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n }\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (this.media) {\n URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n this.onmso = this.onmse = this.onmsc = null;\n this.hls.trigger(_events2.default.MEDIA_DETACHED);\n }\n }, {\n key: 'onMediaSourceOpen',\n value: function onMediaSourceOpen() {\n _logger.logger.log('media source opened');\n this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n var mediaSource = this.mediaSource;\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n this.checkPendingTracks();\n }\n }, {\n key: 'checkPendingTracks',\n value: function checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n var pendingTracks = this.pendingTracks,\n pendingTracksNb = Object.keys(pendingTracks).length;\n // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n this.doAppending();\n }\n }\n }, {\n key: 'onMediaSourceClose',\n value: function onMediaSourceClose() {\n _logger.logger.log('media source closed');\n }\n }, {\n key: 'onMediaSourceEnded',\n value: function onMediaSourceEnded() {\n _logger.logger.log('media source ended');\n }\n }, {\n key: 'onSBUpdateEnd',\n value: function onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n }, {\n key: 'onSBUpdateError',\n value: function onSBUpdateError(event) {\n _logger.logger.error('sourceBuffer error:' + event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n }\n }, {\n key: 'onBufferReset',\n value: function onBufferReset() {\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n var sb = sourceBuffer[type];\n try {\n this.mediaSource.removeSourceBuffer(sb);\n sb.removeEventListener('updateend', this.onsbue);\n sb.removeEventListener('error', this.onsbe);\n } catch (err) {}\n }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n }, {\n key: 'onBufferCodecs',\n value: function onBufferCodecs(tracks) {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n // if sourcebuffers already created, do nothing ...\n if (Object.keys(this.sourceBuffer).length === 0) {\n for (var trackName in tracks) {\n this.pendingTracks[trackName] = tracks[trackName];\n }\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n // try to create sourcebuffers if mediasource opened\n this.checkPendingTracks();\n }\n }\n }\n }, {\n key: 'createSourceBuffers',\n value: function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + ';codecs=' + codec;\n _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = { codec: codec, container: track.container };\n track.buffer = sb;\n } catch (err) {\n _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n }\n }\n }\n this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n }\n }, {\n key: 'onBufferAppending',\n value: function onBufferAppending(data) {\n if (!this._needsFlush) {\n if (!this.segments) {\n this.segments = [data];\n } else {\n this.segments.push(data);\n }\n this.doAppending();\n }\n }\n }, {\n key: 'onBufferAppendFail',\n value: function onBufferAppendFail(data) {\n _logger.logger.error('sourceBuffer error:', data.event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\n }, {\n key: 'onBufferEos',\n value: function onBufferEos(data) {\n var sb = this.sourceBuffer;\n var dataType = data.type;\n for (var type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n _logger.logger.log(type + ' sourceBuffer now EOS');\n }\n }\n }\n this.checkEos();\n }\n\n // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\n }, {\n key: 'checkEos',\n value: function checkEos() {\n var sb = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for (var type in sb) {\n var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n //Notify the media element that it now has all of the media data\n try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n }, {\n key: 'onBufferFlushing',\n value: function onBufferFlushing(data) {\n this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n // attempt flush immediatly\n this.flushBufferCounter = 0;\n this.doFlush();\n }\n }, {\n key: 'onLevelUpdated',\n value: function onLevelUpdated(event) {\n var details = event.details;\n if (details.fragments.length === 0) {\n return;\n }\n this._levelDuration = details.totalduration + details.fragments[0].start;\n this.updateMediaElementDuration();\n }\n\n // https://github.com/dailymotion/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (var type in sourceBuffer) {\n if (sourceBuffer[type].updating) {\n // can't set duration whilst a buffer is updating\n return;\n }\n }\n if (this._msDuration === null) {\n // initialise to the value that the media source is reporting\n this._msDuration = mediaSource.duration;\n }\n var duration = media.duration;\n // levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update mediasource duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n }, {\n key: 'doFlush',\n value: function doFlush() {\n // loop through all buffer ranges to flush\n while (this.flushRange.length) {\n var range = this.flushRange[0];\n // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n if (this.flushBuffer(range.start, range.end, range.type)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n this.flushBufferCounter = 0;\n } else {\n this._needsFlush = true;\n // avoid looping, wait for SB update end to retrigger a flush\n return;\n }\n }\n if (this.flushRange.length === 0) {\n // everything flushed\n this._needsFlush = false;\n\n // let's recompute this.appended, which is used to avoid flush looping\n var appended = 0;\n var sourceBuffer = this.sourceBuffer;\n try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n }\n }\n }, {\n key: 'doAppending',\n value: function doAppending() {\n var hls = this.hls,\n sourceBuffer = this.sourceBuffer,\n segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n return;\n }\n if (this.appending) {\n //logger.log(`sb appending in progress`);\n return;\n }\n if (segments && segments.length) {\n var segment = segments.shift();\n try {\n var type = segment.type,\n sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\n } else {\n // in case we don't have any source buffer matching with this segment type,\n // it means that Mediasource fails to create sourcebuffer\n // discard this segment, and trigger update end\n this.onSBUpdateEnd();\n }\n } catch (err) {\n // in case any error occured while appending, put back segment in segments table\n _logger.logger.error('error while trying to append buffer:' + err.message);\n segments.unshift(segment);\n var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n if (err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n event.frag = this.fragCurrent;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. retrying help recovering this\n */\n if (this.appendError > hls.config.appendErrorMaxRetry) {\n _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n segments = [];\n event.fatal = true;\n hls.trigger(_events2.default.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n }\n } else {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n this.segments = [];\n event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n return;\n }\n }\n }\n }\n }\n\n /*\n flush specified buffered range,\n return true once range has been flushed.\n as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n */\n\n }, {\n key: 'flushBuffer',\n value: function flushBuffer(startOffset, endOffset, typeIn) {\n var sb,\n i,\n bufStart,\n bufEnd,\n flushStart,\n flushEnd,\n sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n if (this.flushBufferCounter < this.appended) {\n for (var type in sourceBuffer) {\n // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n // if no, let's flush all sourcebuffers\n if (typeIn && type !== typeIn) {\n continue;\n }\n sb = sourceBuffer[type];\n // we are going to flush buffer, mark source buffer as 'not ended'\n sb.ended = false;\n if (!sb.updating) {\n try {\n for (i = 0; i < sb.buffered.length; i++) {\n bufStart = sb.buffered.start(i);\n bufEnd = sb.buffered.end(i);\n // workaround firefox not able to properly flush multiple buffered range.\n if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n flushStart = startOffset;\n flushEnd = endOffset;\n } else {\n flushStart = Math.max(bufStart, startOffset);\n flushEnd = Math.min(bufEnd, endOffset);\n }\n /* sometimes sourcebuffer.remove() does not flush\n the exact expected time range.\n to avoid rounding issues/infinite loop,\n only flush buffer range of length greater than 500ms.\n */\n if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n this.flushBufferCounter++;\n _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n _logger.logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n _logger.logger.warn('abort flushing too many retries');\n }\n _logger.logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n }]);\n\n return BufferController;\n}(_eventHandler2.default);\n\nexports.default = BufferController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],8:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * cap stream level to media size dimension controller\n */\n\nvar CapLevelController = function (_EventHandler) {\n _inherits(CapLevelController, _EventHandler);\n\n function CapLevelController(hls) {\n _classCallCheck(this, CapLevelController);\n\n return _possibleConstructorReturn(this, (CapLevelController.__proto__ || Object.getPrototypeOf(CapLevelController)).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n }\n\n _createClass(CapLevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.hls.config.capLevelToPlayerSize) {\n this.media = this.restrictedLevels = null;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n this.timer = clearInterval(this.timer);\n }\n }\n }\n }, {\n key: 'onFpsDropLevelCapping',\n value: function onFpsDropLevelCapping(data) {\n if (!this.restrictedLevels) {\n this.restrictedLevels = [];\n }\n if (!this.isLevelRestricted(data.droppedLevel)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n hls.firstLevel = this.getMaxLevel(data.firstLevel);\n clearInterval(this.timer);\n this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n }\n }\n }, {\n key: 'detectPlayerSize',\n value: function detectPlayerSize() {\n if (this.media) {\n var levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (hls.autoLevelCapping > this.autoLevelCapping) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */\n\n }, {\n key: 'getMaxLevel',\n value: function getMaxLevel(capLevelIndex) {\n var result = 0,\n i = void 0,\n level = void 0,\n mWidth = this.mediaWidth,\n mHeight = this.mediaHeight,\n lWidth = 0,\n lHeight = 0;\n\n for (i = 0; i <= capLevelIndex; i++) {\n level = this.levels[i];\n if (this.isLevelRestricted(i)) {\n break;\n }\n result = i;\n lWidth = level.width;\n lHeight = level.height;\n if (mWidth <= lWidth || mHeight <= lHeight) {\n break;\n }\n }\n return result;\n }\n }, {\n key: 'isLevelRestricted',\n value: function isLevelRestricted(level) {\n return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n }\n }, {\n key: 'contentScaleFactor',\n get: function get() {\n var pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch (e) {}\n return pixelRatio;\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n }]);\n\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"27\":27,\"28\":28}],9:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\nvar _ewma = _dereq_(44);\n\nvar _ewma2 = _interopRequireDefault(_ewma);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EwmaBandWidthEstimator = function () {\n function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n _classCallCheck(this, EwmaBandWidthEstimator);\n\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _ewma2.default(slow);\n this.fast_ = new _ewma2.default(fast);\n }\n\n _createClass(EwmaBandWidthEstimator, [{\n key: 'sample',\n value: function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000 * numBytes / durationMs,\n\n //console.log('instant bw:'+ Math.round(bandwidth));\n // we weight sample using loading duration....\n weight = durationMs / 1000;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n }\n }, {\n key: 'canEstimate',\n value: function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n }\n }, {\n key: 'getEstimate',\n value: function getEstimate() {\n if (this.canEstimate()) {\n //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }]);\n\n return EwmaBandWidthEstimator;\n}();\n\nexports.default = EwmaBandWidthEstimator;\n\n},{\"44\":44}],10:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * FPS Controller\n */\n\nvar FPSController = function (_EventHandler) {\n _inherits(FPSController, _EventHandler);\n\n function FPSController(hls) {\n _classCallCheck(this, FPSController);\n\n return _possibleConstructorReturn(this, (FPSController.__proto__ || Object.getPrototypeOf(FPSController)).call(this, hls, _events2.default.MEDIA_ATTACHING));\n }\n\n _createClass(FPSController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n }, {\n key: 'checkFPS',\n value: function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n if (droppedFPS > 0) {\n //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n }, {\n key: 'checkFPSInterval',\n value: function checkFPSInterval() {\n var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],11:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Level Controller\n */\n\nvar LevelController = function (_EventHandler) {\n _inherits(LevelController, _EventHandler);\n\n function LevelController(hls) {\n _classCallCheck(this, LevelController);\n\n var _this = _possibleConstructorReturn(this, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = _this._autoLevelCapping = -1;\n return _this;\n }\n\n _createClass(LevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n this.canload = true;\n var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n this.canload = false;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels0.length;\n level.url = [level.url];\n level.urlId = 0;\n levels0.push(level);\n } else {\n levels0[redundantLevelId].url.push(level.url);\n }\n });\n\n // remove audio-only level if we also have levels with audio+video codecs signalled\n if (videoCodecFound && audioCodecFound) {\n levels0.forEach(function (level) {\n if (level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', videoCodec));\n });\n\n if (levels.length) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort level on bitrate\n levels.sort(function (a, b) {\n return a.bitrate - b.bitrate;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n break;\n }\n }\n hls.trigger(_events2.default.MANIFEST_PARSED, { levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n }\n return;\n }\n }, {\n key: 'setLevelInternal',\n value: function setLevelInternal(newLevel) {\n var levels = this._levels;\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (this._level !== newLevel) {\n _logger.logger.log('switching to level ' + newLevel);\n this._level = newLevel;\n this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n }\n var level = levels[newLevel],\n levelDetails = level.details;\n // check if we need to load playlist for this level\n if (!levelDetails || levelDetails.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n if (data.fatal) {\n return;\n }\n\n var details = data.details,\n hls = this.hls,\n levelId = void 0,\n level = void 0,\n levelError = false,\n abrController = hls.abrController,\n minAutoLevel = abrController.minAutoLevel;\n // try to recover not fatal errors\n switch (details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\n break;\n default:\n break;\n }\n /* try to switch to a redundant stream if any available.\n * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n * otherwise, we cannot recover this network error ...\n */\n if (levelId !== undefined) {\n level = this._levels[levelId];\n if (!level.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n } else {\n // we could try to recover if in auto mode and current level not lowest level (0)\n var recoverable = this._manualLevel === -1 && levelId;\n if (recoverable) {\n _logger.logger.warn('level controller,' + details + ': switch-down for next fragment');\n abrController.nextAutoLevel = Math.max(minAutoLevel, levelId - 1);\n } else if (level && level.details && level.details.live) {\n _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n if (levelError) {\n // reset this._level so that another call to set level() will retrigger a frag load\n this._level = undefined;\n }\n // other errors are handled by stream controller\n } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n var media = hls.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n if (mediaBuffered) {\n var retryDelay = hls.config.levelLoadingRetryDelay;\n _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n this.timer = setTimeout(this.ontick, retryDelay);\n } else {\n _logger.logger.error('cannot recover ' + details + ' error');\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n hls.trigger(_events2.default.ERROR, data);\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n var newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n curDetails = curLevel.details;\n if (curDetails && newDetails.endSN === curDetails.endSN) {\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n _logger.logger.log('same live playlist, reload twice faster');\n }\n // decrement reloadInterval with level loading delay\n reloadInterval -= performance.now() - data.stats.trequest;\n // in any case, don't reload more than every second\n reloadInterval = Math.max(1000, Math.round(reloadInterval));\n _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n this.timer = setTimeout(this.ontick, reloadInterval);\n } else {\n this.timer = null;\n }\n }\n }\n }, {\n key: 'tick',\n value: function tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId],\n urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\n }\n }, {\n key: 'levels',\n get: function get() {\n return this._levels;\n }\n }, {\n key: 'level',\n get: function get() {\n return this._level;\n },\n set: function set(newLevel) {\n var levels = this._levels;\n if (levels && levels.length > newLevel) {\n if (this._level !== newLevel || levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n }\n }, {\n key: 'manualLevel',\n get: function get() {\n return this._manualLevel;\n },\n set: function set(newLevel) {\n this._manualLevel = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: 'firstLevel',\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: 'startLevel',\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n // if not in autostart level, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, this.hls.abrController.minAutoLevel);\n }\n this._startLevel = newLevel;\n }\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.abrController.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45}],12:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_LEVEL: 'WAITING_LEVEL',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar StreamController = function (_EventHandler) {\n _inherits(StreamController, _EventHandler);\n\n function StreamController(hls) {\n _classCallCheck(this, StreamController);\n\n var _this = _possibleConstructorReturn(this, (StreamController.__proto__ || Object.getPrototypeOf(StreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_SWITCHED, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(StreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.levels) {\n var lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.level = -1;\n this.fragLoadError = 0;\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n _logger.logger.warn('cannot start loading as manifest not parsed yet');\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n // when this returns false there was an error and we shall return immediatly\n // from current tick\n if (!this._doTickIdle()) {\n return;\n }\n break;\n case State.WAITING_LEVEL:\n var level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n // check buffer\n this._checkBuffer();\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\n }, {\n key: '_doTickIdle',\n value: function _doTickIdle() {\n var hls = this.hls,\n config = hls.config,\n media = this.media;\n\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return true;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n var pos = void 0;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n var level = hls.nextLoadLevel,\n levelInfo = this.levels[level],\n levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\n // determine next candidate fragment to be loaded, based on current position and end of buffer position\n // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\n var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len;\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return true;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\n // set next load level : this will trigger a playlist load if needed\n this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n this.state = State.WAITING_LEVEL;\n return true;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // if everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference\n // using half frag duration should help cope with these cases.\n // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/dailymotion/hls.js/pull/657\n if (media.duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration / 2)) {\n // Finalize the media stream\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_EOS, data);\n this.state = State.ENDED;\n return true;\n }\n }\n\n // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n return this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n var fragPrevious = this.fragPrevious,\n level = this.level,\n fragments = levelDetails.fragments,\n fragLen = fragments.length;\n\n // empty playlist\n if (fragLen === 0) {\n return false;\n }\n\n // find fragment index, contiguous with end of buffer position\n var start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n bufferEnd = bufferInfo.end,\n frag = void 0;\n\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return false;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return false;\n }\n } else {\n // VoD playlist: if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n }\n }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n return this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return true;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n var config = this.hls.config,\n media = this.media;\n\n var frag = void 0;\n\n // check if requested position is within seekable boundaries :\n //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {\n var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n bufferEnd = liveSyncPosition;\n if (media && media.readyState && media.duration > liveSyncPosition) {\n media.currentTime = liveSyncPosition;\n }\n }\n\n // if end of buffer greater than live edge, don't load any fragment\n // this could happen if live playlist intermittently slides in the past.\n // level 1 loaded [182580161,182580167]\n // level 1 loaded [182580162,182580169]\n // Loading 182580168 of [182580162 ,182580169],level 1 ..\n // Loading 182580169 of [182580162 ,182580169],level 1 ..\n // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n // level 1 loaded [182580164,182580171]\n //\n // don't return null in case media not loaded yet (readystate === 0)\n if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n return null;\n }\n\n if (this.startFragRequested && !levelDetails.PTSKnown) {\n /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n try to load frag matching with next SN.\n even if SN are not synchronized between playlists, loading this frag will help us\n compute playlist sliding and find the right one after in case it was not the right consecutive one */\n if (fragPrevious) {\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n }\n }\n if (!frag) {\n /* we have no idea about which fragment should be loaded.\n so let's load mid fragment. it will help computing playlist sliding and find the right one\n */\n frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n }\n }\n return frag;\n }\n }, {\n key: '_findFragment',\n value: function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n\n var frag = void 0,\n foundFrag = void 0,\n maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS,\n curSNIdx = frag.sn - levelDetails.startSN;\n // if there is a significant delta between audio and video, larger than max allowed hole,\n // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n // let's try to load previous fragment again to get last keyframe\n // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n frag = fragments[curSNIdx - 1];\n _logger.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');\n // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n fragPrevious.loadCounter--;\n } else {\n frag = fragments[curSNIdx + 1];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n var hls = this.hls,\n config = hls.config;\n\n //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return false;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n this.nextLoadPosition = frag.start + frag.duration;\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return true;\n }\n }\n }, {\n key: 'getBufferRange',\n value: function getBufferRange(position) {\n return _binarySearch2.default.search(this.bufferRange, function (range) {\n if (position < range.start) {\n return -1;\n } else if (position > range.end) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferRange',\n value: function followingBufferRange(range) {\n if (range) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferRange(range.end + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var rangeCurrent,\n currentTime,\n video = this.media;\n if (video && video.readyState && video.seeking === false) {\n currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n if (currentTime > video.playbackRate * this.lastCurrentTime) {\n this.lastCurrentTime = currentTime;\n }\n if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n rangeCurrent = this.getBufferRange(currentTime + 0.1);\n }\n if (rangeCurrent) {\n var fragPlaying = rangeCurrent.frag;\n if (fragPlaying !== this.fragPlaying) {\n this.fragPlaying = fragPlaying;\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n }\n }\n }\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */\n\n }, {\n key: 'immediateLevelSwitch',\n value: function immediateLevelSwitch() {\n _logger.logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n var media = this.media,\n previouslyPaused = void 0;\n if (media) {\n previouslyPaused = media.paused;\n media.pause();\n } else {\n // don't restart playback after instant level switch in case media not attached\n previouslyPaused = true;\n }\n this.previouslyPaused = previouslyPaused;\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n - resume the playback if needed\n */\n\n }, {\n key: 'immediateLevelSwitchEnd',\n value: function immediateLevelSwitchEnd() {\n var media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n // only nudge if currentTime is buffered\n media.currentTime -= 0.0001;\n }\n if (!this.previouslyPaused) {\n media.play();\n }\n }\n }\n }, {\n key: 'nextLevelSwitch',\n value: function nextLevelSwitch() {\n /* try to switch ASAP without breaking video playback :\n in order to ensure smooth but quick level switching,\n we need to find the next flushable buffer range\n we should take into account new segment fetch time\n */\n var media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n var fetchdelay = void 0,\n currentRange = void 0,\n nextRange = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n currentRange = this.getBufferRange(media.currentTime);\n if (currentRange && currentRange.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.flushMainBuffer(0, currentRange.start - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,\n nextLevel = this.levels[nextLevelId],\n fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n //logger.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n if (nextRange) {\n // we can flush buffer range following this one without stalling playback\n nextRange = this.followingBufferRange(nextRange);\n if (nextRange) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush position is the start position of this new buffer\n this.flushMainBuffer(nextRange.start, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('seeked', this.onvseeked);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var levels = this.levels;\n if (levels) {\n // reset fragment load counter\n levels.forEach(function (level) {\n if (level.details) {\n level.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('seeked', this.onvseeked);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined,\n config = this.config;\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n if (this.state === State.FRAG_LOADING) {\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole),\n fragCurrent = this.fragCurrent;\n // check if we are seeking to a unbuffered area AND if frag loading is in progress\n if (bufferInfo.len === 0 && fragCurrent) {\n var tolerance = config.maxFragLookUpTolerance,\n fragStartOffset = fragCurrent.start - tolerance,\n fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n if (fragCurrent.loader) {\n _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n } else {\n _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n _logger.logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset buffer on manifest loading\n _logger.logger.log('trigger BUFFER_RESET');\n this.hls.trigger(_events2.default.BUFFER_RESET);\n this.bufferRange = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var aac = false,\n heaac = false,\n codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac;\n if (this.audioCodecSwitch) {\n _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragRequested = false;\n var config = this.config;\n if (config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n this.levelLastLoaded = newLevelId;\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n // override level info\n curLevel.details = newDetails;\n this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n if (this.startFragRequested === false) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = this.computeLivePosition(sliding, newDetails);\n _logger.logger.log('configure startPosition to ' + this.startPosition);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n // reset frag bitrate test in any case after frag loaded event\n this.bitrateTest = false;\n // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n // then this means that we should be able to load a fragment at a higher quality level\n if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = State.IDLE;\n this.startFragRequested = false;\n stats.tparsed = stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = stats;\n var duration = details.totalduration,\n start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec === undefined) {\n audioCodec = this.lastAudioCodec;\n }\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n }\n this.pendingBuffering = true;\n this.appended = false;\n _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n var demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n }\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, null);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n trackName,\n track;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (tracks.audio && this.altAudio) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n var audioCodec = this.levels[this.level].audioCodec,\n ua = navigator.userAgent.toLowerCase();\n if (audioCodec && this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // in case AAC and HE-AAC audio codecs are signalled in manifest\n // force HE-AAC , as it seems that most browsers prefers that way,\n // except for mono streams OR on FF\n // these conditions might need to be reviewed ...\n if (this.audioCodecSwitch) {\n // don't force HE-AAC if mono stream\n if (track.metadata.channelCount !== 1 &&\n // don't force HE-AAC if firefox\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n _logger.logger.log('Android: force audio codec to ' + audioCodec);\n }\n track.levelCodec = audioCodec;\n track.id = data.id;\n }\n track = tracks.video;\n if (track) {\n track.levelCodec = this.levels[this.level].videoCodec;\n track.id = data.id;\n }\n\n // if remuxer specify that a unique track needs to generated,\n // let's merge all tracks together\n if (data.unique) {\n var mergedTrack = {\n codec: '',\n levelCodec: ''\n };\n for (trackName in data.tracks) {\n track = tracks[trackName];\n mergedTrack.container = track.container;\n if (mergedTrack.codec) {\n mergedTrack.codec += ',';\n mergedTrack.levelCodec += ',';\n }\n if (track.codec) {\n mergedTrack.codec += track.codec;\n }\n if (track.levelCodec) {\n mergedTrack.levelCodec += track.levelCodec;\n }\n }\n tracks = { audiovideo: mergedTrack };\n }\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n for (trackName in tracks) {\n track = tracks[trackName];\n _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n\n _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n hls = this.hls;\n hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n }\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent.loader) {\n _logger.logger.log('switching to main audio track, cancel main fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // destroy demuxer to force init segment generation (following audio switch)\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var tracks = data.tracks,\n mediaTrack = void 0,\n name = void 0,\n alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n this.videoBuffer = tracks[type].buffer;\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'main') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n var _this3 = this;\n\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n (function () {\n var media = _this3.mediaBuffer ? _this3.mediaBuffer : _this3.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter potentially evicted bufferRange. this is to avoid memleak on live streams\n var bufferRange = _this3.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n // push new range\n bufferRange.push({ type: frag.type, start: frag.startPTS, end: frag.endPTS, frag: frag });\n // sort, as we use BinarySearch for lookup in getBufferRange ...\n _this3.bufferRange = bufferRange.sort(function (a, b) {\n return a.start - b.start;\n });\n _this3.fragPrevious = frag;\n var stats = _this3.stats;\n stats.tbuffered = performance.now();\n // we should get rid of this.fragLastKbps\n _this3.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n _this3.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n _this3.state = State.IDLE;\n })();\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag || this.fragCurrent;\n // don't handle frag error not related to main fragment\n if (frag && frag.type !== 'main') {\n return;\n }\n var media = this.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n if (!data.fatal) {\n // if buffer is not empty\n if (mediaBuffered) {\n // try to reduce max buffer length : rationale is that we could get\n // frag loop loading error because of buffer eviction\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // buffer empty. report as fatal if in manual mode or if lowest level.\n // level controller takes care of emergency switch down logic\n if (!frag.autoLevel || frag.level === 0) {\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n }\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in cas of non fatal error while waiting level load to be completed, switch back to IDLE\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (this.state === State.PARSING || this.state === State.PARSED) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n // in that case flush the whole buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: '_reduceMaxBufferLength',\n value: function _reduceMaxBufferLength(minLength) {\n var config = this.config;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n }, {\n key: '_checkBuffer',\n value: function _checkBuffer() {\n var media = this.media;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if (media && media.readyState) {\n var currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.buffered;\n // adjust currentTime to start position on loaded metadata\n if (!this.loadedmetadata && buffered.length && !media.seeking) {\n this.loadedmetadata = true;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n var startPosition = this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n _logger.logger.log('target start position:' + startPosition);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if (!startPositionBuffered) {\n startPosition = buffered.start(0);\n _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n }\n _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n expectedPlaying = !(media.paused || // not playing when media is paused\n media.ended || // not playing when media is ended\n media.buffered.length === 0),\n // not playing if nothing buffered\n jumpThreshold = 0.5,\n // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart,\n delta = nextBufferStart - currentTime;\n if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\n }\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoadEmergencyAborted',\n value: function onFragLoadEmergencyAborted() {\n this.state = State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferRange\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this.bufferRange = this.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n }, {\n key: 'computeLivePosition',\n value: function computeLivePosition(sliding, levelDetails) {\n var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('main stream:' + previousState + '->' + nextState);\n this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n }\n },\n get: function get() {\n return this._state;\n }\n }, {\n key: 'currentLevel',\n get: function get() {\n var media = this.media;\n if (media) {\n var range = this.getBufferRange(media.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferRange',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this._liveSyncPosition;\n },\n set: function set(value) {\n this._liveSyncPosition = value;\n }\n }]);\n\n return StreamController;\n}(_eventHandler2.default);\n\nexports.default = StreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],13:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(42);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Timeline Controller\n */\n\nvar TimelineController = function (_EventHandler) {\n _inherits(TimelineController, _EventHandler);\n\n function TimelineController(hls) {\n _classCallCheck(this, TimelineController);\n\n var _this = _possibleConstructorReturn(this, (TimelineController.__proto__ || Object.getPrototypeOf(TimelineController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack1) {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1) {\n self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n self.textTrack1.textTrack1 = true;\n } else {\n self.textTrack1 = existingTrack1;\n self.clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n }\n };\n\n var channel2 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack2) {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2) {\n self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n self.textTrack2.textTrack2 = true;\n } else {\n self.textTrack2 = existingTrack2;\n self.clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n }\n };\n\n _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n }\n return _this;\n }\n\n _createClass(TimelineController, [{\n key: 'clearCurrentCues',\n value: function clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n }\n }, {\n key: 'getExistingTrack',\n value: function getExistingTrack(channelNumber) {\n var media = this.media;\n if (media) {\n for (var i = 0; i < media.textTracks.length; i++) {\n var textTrack = media.textTracks[i];\n var propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n }, {\n key: 'createTextTrack',\n value: function createTextTrack(kind, label, lang) {\n if (this.media) {\n return this.media.addTextTrack(kind, label, lang);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media;\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastPts = Number.NEGATIVE_INFINITY;\n }\n }, {\n key: 'onLevelSwitch',\n value: function onLevelSwitch() {\n if (this.hls.currentLevel.closedCaptions === 'NONE') {\n this.enabled = false;\n } else {\n this.enabled = true;\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n if (data.frag.type === 'main') {\n var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n // if this is a frag for a previously loaded timerange, remove all captions\n // TODO: consider just removing captions for the timerange\n if (pts <= this.lastPts) {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n this.lastPts = pts;\n }\n }\n }, {\n key: 'onFragParsingUserdata',\n value: function onFragParsingUserdata(data) {\n // push all of the CEA-708 messages into the interpreter\n // immediately. It will create the proper timestamps based on our PTS value\n if (this.enabled && this.config.enableCEA708Captions) {\n for (var i = 0; i < data.samples.length; i++) {\n var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n }\n }\n }\n }, {\n key: 'extractCea608Data',\n value: function extractCea608Data(byteArray) {\n var count = byteArray[0] & 31;\n var position = 2;\n var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n var actualCCBytes = [];\n\n for (var j = 0; j < count; j++) {\n tmpByte = byteArray[position++];\n ccbyte1 = 0x7F & byteArray[position++];\n ccbyte2 = 0x7F & byteArray[position++];\n ccValid = (4 & tmpByte) === 0 ? false : true;\n ccType = 3 & tmpByte;\n\n if (ccbyte1 === 0 && ccbyte2 === 0) {\n continue;\n }\n\n if (ccValid) {\n if (ccType === 0) // || ccType === 1\n {\n actualCCBytes.push(ccbyte1);\n actualCCBytes.push(ccbyte2);\n }\n }\n }\n return actualCCBytes;\n }\n }]);\n\n return TimelineController;\n}(_eventHandler2.default);\n\nexports.default = TimelineController;\n\n},{\"27\":27,\"28\":28,\"42\":42}],14:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],15:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n this.subMix = [];\n this.subMix[0] = new Uint32Array(256);\n this.subMix[1] = new Uint32Array(256);\n this.subMix[2] = new Uint32Array(256);\n this.subMix[3] = new Uint32Array(256);\n\n this.invSubMix = [];\n this.invSubMix[0] = new Uint32Array(256);\n this.invSubMix[1] = new Uint32Array(256);\n this.invSubMix[2] = new Uint32Array(256);\n this.invSubMix[3] = new Uint32Array(256);\n\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix0 = this.subMix[0];\n var subMix1 = this.subMix[1];\n var subMix2 = this.subMix[2];\n var subMix3 = this.subMix[3];\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(this.ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(this.ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n\n while (offset < inputInt32.length) {\n inputWords0 = this.networkToHostOrderSwap(inputInt32[offset]);\n inputWords1 = this.networkToHostOrderSwap(inputInt32[offset + 1]);\n inputWords2 = this.networkToHostOrderSwap(inputInt32[offset + 2]);\n inputWords3 = this.networkToHostOrderSwap(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = this.networkToHostOrderSwap(t0 ^ initVector0);\n outputInt32[offset + 1] = this.networkToHostOrderSwap(t3 ^ initVector1);\n outputInt32[offset + 2] = this.networkToHostOrderSwap(t2 ^ initVector2);\n outputInt32[offset + 3] = this.networkToHostOrderSwap(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],16:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _aesCrypto = _dereq_(14);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(17);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(15);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n _logger.logger.log('JS AES decrypt');\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n (function () {\n _logger.logger.log('WebCrypto AES decrypt');\n var subtle = _this.subtle;\n if (_this.key !== key) {\n _this.key = key;\n _this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n _this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n })();\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"14\":14,\"15\":15,\"17\":17,\"26\":26,\"45\":45}],17:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],18:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * AAC demuxer\n */\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(45);\n\nvar _id = _dereq_(24);\n\nvar _id2 = _interopRequireDefault(_id);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AACDemuxer = function () {\n function AACDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n this.insertDiscontinuity();\n }\n\n _createClass(AACDemuxer, [{\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0 };\n }\n }, {\n key: 'push',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var track,\n id3 = new _id2.default(data),\n pts = 90 * id3.timeStamp,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n\n var contiguous = false;\n if (cc !== this.lastCC) {\n _logger.logger.log(this.id + ' discontinuity detected');\n this.lastCC = cc;\n this.insertDiscontinuity();\n this.remuxer.switchLevel();\n this.remuxer.insertDiscontinuity();\n } else if (level !== this.lastLevel) {\n _logger.logger.log('audio track switch detected');\n this.lastLevel = level;\n this.remuxer.switchLevel();\n this.insertDiscontinuity();\n } else if (sn === this.lastSN + 1) {\n contiguous = true;\n }\n track = this._aacTrack;\n this.lastSN = sn;\n this.lastLevel = level;\n\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(level, sn, cc, track, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n // check if data contains ID3 timestamp and ADTS sync worc\n var id3 = new _id2.default(data),\n offset,\n len;\n if (id3.hasTimeStamp) {\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return AACDemuxer;\n}();\n\nexports.default = AACDemuxer;\n\n},{\"19\":19,\"24\":24,\"45\":45}],19:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ADTS parser helper\n */\n\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ADTS = function () {\n function ADTS() {\n _classCallCheck(this, ADTS);\n }\n\n _createClass(ADTS, null, [{\n key: 'getAudioConfig',\n value: function getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType,\n // :int\n adtsSampleingIndex,\n // :int\n adtsExtensionSampleingIndex,\n // :int\n adtsChanelConfig,\n // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n return;\n }\n adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/i.test(userAgent)) {\n if (adtsSampleingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi/Opera ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n config[1] |= (adtsSampleingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChanelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSampleingIndex\n config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };\n }\n }]);\n\n return ADTS;\n}();\n\nexports.default = ADTS;\n\n},{\"26\":26,\"45\":45}],20:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _decrypter = _dereq_(16);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(18);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _tsdemuxer = _dereq_(25);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp4Remuxer = _dereq_(38);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(39);\n\nvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DemuxerInline = function () {\n function DemuxerInline(hls, id, typeSupported) {\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, DemuxerInline);\n\n this.hls = hls;\n this.id = id;\n this.config = this.hls.config || config;\n this.typeSupported = typeSupported;\n }\n\n _createClass(DemuxerInline, [{\n key: 'destroy',\n value: function destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n if (this.decrypter == null) {\n this.decrypter = new _decrypter2.default(this.hls, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n this.decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.hls.trigger(_events2.default.FRAG_DECRYPTED, { level: level, sn: sn, stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n cc !== this.cc && !demuxer.probe(data)) {\n var hls = this.hls,\n id = this.id,\n config = this.config,\n typeSupported = this.typeSupported;\n // probe for content type\n if (_tsdemuxer2.default.probe(data)) {\n if (this.typeSupported.mp2t === true) {\n demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, config, typeSupported);\n } else {\n demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n }\n demuxer.probe = _tsdemuxer2.default.probe;\n } else if (_aacdemuxer2.default.probe(data)) {\n demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n demuxer.probe = _aacdemuxer2.default.probe;\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n this.cc = cc;\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"16\":16,\"18\":18,\"25\":25,\"26\":26,\"28\":28,\"38\":38,\"39\":39}],21:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* demuxer web worker.\n * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n */\n\nvar DemuxerWorker = function DemuxerWorker(self) {\n // observer setup\n var observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({ event: ev, data: data });\n };\n\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n //console.log('demuxer cmd:' + data.cmd);\n switch (data.cmd) {\n case 'init':\n var config = JSON.parse(data.config);\n self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n try {\n (0, _logger.enableLogs)(config.debug === true);\n } catch (err) {\n console.warn('demuxerWorker: unable to enable logs');\n }\n // signal end of worker init\n forwardMessage('init', null);\n break;\n case 'demux':\n self.demuxer.push(data.data, data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.decryptdata, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n observer.on(_events2.default.ERROR, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n var data1 = data.data1.buffer,\n data2 = data.data2.buffer;\n // remove data1 and data2 reference from data to avoid copying them ...\n delete data.data1;\n delete data.data2;\n self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"20\":20,\"28\":28,\"45\":45}],22:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(21);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Demuxer = function () {\n function Demuxer(hls, id) {\n _classCallCheck(this, Demuxer);\n\n this.hls = hls;\n this.id = id;\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\n w = this.w = work(_demuxerWorker2.default);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function (event) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n };\n w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n } catch (err) {\n _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n if (w) {\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(w.objectURL);\n }\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n this.demuxInitialized = true;\n }\n\n _createClass(Demuxer, [{\n key: 'destroy',\n value: function destroy() {\n var w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, decryptdata: decryptdata, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, [data]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS);\n }\n }\n }\n }, {\n key: 'onWorkerMessage',\n value: function onWorkerMessage(ev) {\n var data = ev.data,\n hls = this.hls;\n //console.log('onWorkerMessage:' + data.event);\n switch (data.event) {\n case 'init':\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(this.w.objectURL);\n break;\n // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n case _events2.default.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n data.data.data2 = new Uint8Array(data.data2);\n /* falls through */\n default:\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"20\":20,\"21\":21,\"26\":26,\"28\":28,\"3\":3,\"45\":45}],23:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ExpGolomb = function () {\n function ExpGolomb(data) {\n _classCallCheck(this, ExpGolomb);\n\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n\n\n _createClass(ExpGolomb, [{\n key: 'loadWord',\n value: function loadWord() {\n var data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n\n }, {\n key: 'skipBits',\n value: function skipBits(count) {\n var skipBytes; // :int\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes >> 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n\n }, {\n key: 'readBits',\n value: function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size),\n // :uint\n valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _logger.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n\n }, {\n key: 'skipLZ',\n value: function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n\n }, {\n key: 'skipUEG',\n value: function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n\n }, {\n key: 'skipEG',\n value: function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n\n }, {\n key: 'readUEG',\n value: function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n\n }, {\n key: 'readEG',\n value: function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n\n }, {\n key: 'readBoolean',\n value: function readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n\n }, {\n key: 'readUByte',\n value: function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n\n }, {\n key: 'readUShort',\n value: function readUShort() {\n return this.readBits(16);\n }\n // ():int\n\n }, {\n key: 'readUInt',\n value: function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n }, {\n key: 'skipScalingList',\n value: function skipScalingList(count) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n }, {\n key: 'readSPS',\n value: function readSPS() {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\n };\n }\n }, {\n key: 'readSliceType',\n value: function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;\n\n},{\"45\":45}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ID3 parser\n */\n\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n//import Hex from '../utils/hex';\n\nvar ID3 = function () {\n function ID3(data) {\n _classCallCheck(this, ID3);\n\n this._hasTimeStamp = false;\n var offset = 0,\n byte1,\n byte2,\n byte3,\n byte4,\n tagSize,\n endPos,\n header,\n len;\n do {\n header = this.readUTF(data, offset, 3);\n offset += 3;\n // first check for ID3 header\n if (header === 'ID3') {\n // skip 24 bits\n offset += 3;\n // retrieve tag(s) length\n byte1 = data[offset++] & 0x7f;\n byte2 = data[offset++] & 0x7f;\n byte3 = data[offset++] & 0x7f;\n byte4 = data[offset++] & 0x7f;\n tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n endPos = offset + tagSize;\n //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\n // read ID3 tags\n this._parseID3Frames(data, offset, endPos);\n offset = endPos;\n } else if (header === '3DI') {\n // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n offset += 7;\n _logger.logger.log('3DI footer found, end: ' + offset);\n } else {\n offset -= 3;\n len = offset;\n if (len) {\n //logger.log(`ID3 len: ${len}`);\n if (!this.hasTimeStamp) {\n _logger.logger.warn('ID3 tag found, but no timestamp');\n }\n this._length = len;\n this._payload = data.subarray(0, len);\n }\n return;\n }\n } while (true);\n }\n\n _createClass(ID3, [{\n key: 'readUTF',\n value: function readUTF(data, start, len) {\n\n var result = '',\n offset = start,\n end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while (offset < end);\n return result;\n }\n }, {\n key: '_parseID3Frames',\n value: function _parseID3Frames(data, offset, endPos) {\n var tagId, tagLen, tagStart, tagFlags, timestamp;\n while (offset + 8 <= endPos) {\n tagId = this.readUTF(data, offset, 4);\n offset += 4;\n\n tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\n tagFlags = data[offset++] << 8 + data[offset++];\n\n tagStart = offset;\n //logger.log(\"ID3 tag id:\" + tagId);\n switch (tagId) {\n case 'PRIV':\n //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n offset += 44;\n // smelling even better ! we found the right descriptor\n // skip null character (string end) + 3 first bytes\n offset += 4;\n\n // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n var pts33Bit = data[offset++] & 0x1;\n this._hasTimeStamp = true;\n\n timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: 'hasTimeStamp',\n get: function get() {\n return this._hasTimeStamp;\n }\n }, {\n key: 'timeStamp',\n get: function get() {\n return this._timeStamp;\n }\n }, {\n key: 'length',\n get: function get() {\n return this._length;\n }\n }, {\n key: 'payload',\n get: function get() {\n return this._payload;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\n\n},{\"45\":45}],25:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n// import Hex from '../utils/hex';\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(23);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TSDemuxer = function () {\n function TSDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.typeSupported = typeSupported;\n this.lastCC = 0;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n }\n\n _createClass(TSDemuxer, [{\n key: 'switchLevel',\n value: function switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.remuxer.switchLevel();\n }\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n codecsOnly = this.remuxer.passthrough,\n unknownPIDs = false;\n\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n this.contiguous = false;\n this.accurateTimeOffset = accurateTimeOffset;\n if (cc !== this.lastCC) {\n _logger.logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n }\n if (level !== this.lastLevel) {\n _logger.logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n } else if (sn === this.lastSN + 1) {\n this.contiguous = true;\n }\n this.lastSN = sn;\n\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.pesData,\n id3Data = id3Track.pesData,\n parsePAT = this._parsePAT,\n parsePMT = this._parsePMT,\n parsePES = this._parsePES,\n parseAVCPES = this._parseAVCPES.bind(this),\n parseAACPES = this._parseAACPES.bind(this),\n parseMPEGPES = this._parseMPEGPES.bind(this),\n parseID3PES = this._parseID3PES.bind(this);\n\n // don't parse last TS packet if incomplete\n len -= len % 188;\n // loop through TS packets\n for (start = 0; start < len; start += 188) {\n if (data[start] === 0x47) {\n stt = !!(data[start + 1] & 0x40);\n // pid is a 13-bit field starting at the last bit of TS[1]\n pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n atf = (data[start + 3] & 0x30) >> 4;\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + 188) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, false);\n if (codecsOnly) {\n // if we have video codec info AND\n // if audio PID is undefined OR if we have audio codec info,\n // we have all codec info !\n if (avcTrack.codec && (audioId === -1 || audioTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n avcData = { data: [], size: 0 };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + 188));\n avcData.size += start + 188 - offset;\n }\n break;\n case audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n if (codecsOnly) {\n // here we now that we have audio codec info\n // if video PID is undefined OR if we have video codec info,\n // we have all codec infos !\n if (audioTrack.codec && (avcId === -1 || avcTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.size += start + 188 - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n }\n id3Data = { data: [], size: 0 };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + 188));\n id3Data.size += start + 188 - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n break;\n case pmtId:\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n _logger.logger.log('reparse from beginning');\n unknownPIDs = false;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = -188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n case 17:\n case 0x1fff:\n break;\n default:\n unknownPIDs = true;\n break;\n }\n } else {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n }\n }\n // try to parse last PES packets\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, true);\n avcTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n avcTrack.pesData = avcData;\n }\n\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\n }\n\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n this.remux(level, sn, cc, null, timeOffset, defaultInitPTS);\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, data, timeOffset, defaultInitPTS) {\n var avcTrack = this._avcTrack,\n samples = avcTrack.samples,\n nbNalu = 0,\n naluLen = 0;\n\n // compute total/avc sample length and nb of NAL units\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i],\n units = sample.units.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n }\n avcTrack.len = naluLen;\n avcTrack.nbNalu = nbNalu;\n this.remuxer.remux(level, sn, cc, this._audioTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, defaultInitPTS, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n }, {\n key: '_parsePAT',\n value: function _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n }, {\n key: '_parsePMT',\n value: function _parsePMT(data, offset, mpegSupported) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\n sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n switch (data[offset]) {\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n case 0x0f:\n //logger.log('AAC PID:' + pid);\n if (result.audio === -1) {\n result.audio = pid;\n }\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n case 0x1b:\n //logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n default:\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n }\n return result;\n }\n }, {\n key: '_parsePES',\n value: function _parsePES(stream) {\n var i = 0,\n frag,\n pesFlags,\n pesPrefix,\n pesLen,\n pesHdrLen,\n pesData,\n pesPts,\n pesDts,\n payloadStartOffset,\n data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n //retrieve PTS/DTS from first fragment\n frag = data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen > stream.size - 6) {\n return null;\n }\n pesFlags = frag[7];\n if (pesFlags & 0xC0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n (frag[10] & 0xFF) * 4194304 + // 1 << 22\n (frag[11] & 0xFE) * 16384 + // 1 << 14\n (frag[12] & 0xFF) * 128 + // 1 << 7\n (frag[13] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesPts > 4294967295) {\n // decrement 2^33\n pesPts -= 8589934592;\n }\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n (frag[15] & 0xFF) * 4194304 + // 1 << 22\n (frag[16] & 0xFE) * 16384 + // 1 << 14\n (frag[17] & 0xFF) * 128 + // 1 << 7\n (frag[18] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesDts > 4294967295) {\n // decrement 2^33\n pesDts -= 8589934592;\n }\n if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n payloadStartOffset = pesHdrLen + 9;\n\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n } else {\n return null;\n }\n }\n }, {\n key: 'pushAccesUnit',\n value: function pushAccesUnit(avcSample, avcTrack) {\n if (avcSample.units.units.length && avcSample.frame) {\n // only push AVC sample if starting with a keyframe is not mandatory OR\n // if keyframe already found in this fragment OR\n // keyframe found in last fragment (track.sps) AND\n // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n avcTrack.samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if (avcSample.debug.length) {\n _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n }\n }\n }, {\n key: '_parseAVCPES',\n value: function _parseAVCPES(pes, last) {\n var _this = this;\n\n //logger.log('parse new PES');\n var track = this._avcTrack,\n units = this._parseAVCNALu(pes.data),\n debug = false,\n expGolombDecoder,\n avcSample = this.avcSample,\n push,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(function (unit) {\n switch (unit.type) {\n //NDR\n case 1:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var data = unit.data;\n if (data.length > 4) {\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\n }\n break;\n //IDR\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\n // skip frameType\n expGolombDecoder.readUByte();\n\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n\n while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n payloadType = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadType += b;\n } while (b === 0xFF);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadSize += b;\n } while (b === 0xFF);\n\n // TODO: there can be more than one payload in an SEI packet...\n // TODO: need to read type and size in a while loop to get them all\n if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\n endOfCaptions = true;\n\n var countryCode = expGolombDecoder.readUByte();\n\n if (countryCode === 181) {\n var providerCode = expGolombDecoder.readUShort();\n\n if (providerCode === 49) {\n var userStructure = expGolombDecoder.readUInt();\n\n if (userStructure === 0x47413934) {\n var userDataType = expGolombDecoder.readUByte();\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = expGolombDecoder.readUByte();\n var secondByte = expGolombDecoder.readUByte();\n\n var totalCCs = 31 & firstByte;\n var byteArray = [firstByte, secondByte];\n\n for (i = 0; i < totalCCs; i++) {\n // 3 bytes per CC\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n }\n\n _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n }\n }\n }\n }\n } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n for (i = 0; i < payloadSize; i++) {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n expGolombDecoder = new _expGolomb2.default(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n //PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n if (avcSample) {\n _this.pushAccesUnit(avcSample, track);\n }\n avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = false;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n this.pushAccesUnit(avcSample, track);\n this.avcSample = null;\n }\n }\n }, {\n key: '_createAVCSample',\n value: function _createAVCSample(key, pts, dts, debug) {\n return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n }\n }, {\n key: '_insertSampleInOrder',\n value: function _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len - 1].pts) {\n arr.push(data);\n } else {\n for (var pos = len - 1; pos >= 0; pos--) {\n if (data.pts < arr[pos].pts) {\n arr.splice(pos, 0, data);\n break;\n }\n }\n }\n } else {\n arr.push(data);\n }\n }\n }, {\n key: '_getLastNalUnit',\n value: function _getLastNalUnit() {\n var avcSample = this.avcSample,\n lastUnit = void 0;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.units.length === 0) {\n var track = this._avcTrack,\n samples = track.samples;\n avcSample = samples[samples.length - 1];\n }\n if (avcSample) {\n var units = avcSample.units.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n }, {\n key: '_parseAVCNALu',\n value: function _parseAVCNALu(array) {\n var i = 0,\n len = array.byteLength,\n value,\n overflow,\n track = this._avcTrack,\n state = track.naluState || 0,\n lastState = state;\n var units = [],\n unit,\n unitType,\n lastUnitStart = -1,\n lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -1) {\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n //logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n units.push(unit);\n //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this._getLastNalUnit();\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n }\n\n /**\n * remove Emulation Prevention bytes from a RBSP\n */\n\n }, {\n key: 'discardEPB',\n value: function discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength,\n newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - EPBPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }\n }, {\n key: '_parseAACPES',\n value: function _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n if (aacOverFlow) {\n var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n tmp.set(aacOverFlow, 0);\n tmp.set(data, aacOverFlow.byteLength);\n //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset) {\n var reason, fatal;\n if (offset < len - 1) {\n reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _logger.logger.warn('parsing error:' + reason);\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n var audioCodec = this.audioCodec;\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = this._duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n if (aacOverFlow && aacLastPTS) {\n var newPTS = aacLastPTS + frameDuration;\n if (Math.abs(newPTS - pts) > 1) {\n _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n pts = newPTS;\n }\n }\n\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n if (offset < len) {\n aacOverFlow = data.subarray(offset, len);\n //logger.log(`AAC: overflow detected:${len-offset}`);\n } else {\n aacOverFlow = null;\n }\n this.aacOverFlow = aacOverFlow;\n this.aacLastPTS = stamp;\n }\n }, {\n key: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n var data = pes.data;\n var pts = pes.pts;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var parsed;\n\n while (offset < length && (parsed = this._parseMpeg(data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n }, {\n key: '_onMpegFrame',\n value: function _onMpegFrame(data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 / sampleRate * 1000;\n var stamp = pts + frameIndex * frameDuration;\n var track = this._audioTrack;\n\n track.config = [];\n track.channelCount = channelCount;\n track.audiosamplerate = sampleRate;\n track.duration = this._duration;\n track.samples.push({ unit: data, pts: stamp, dts: stamp });\n track.len += data.length;\n }\n }, {\n key: '_onMpegNoise',\n value: function _onMpegNoise(data) {\n _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n }\n }, {\n key: '_parseMpeg',\n value: function _parseMpeg(data, start, end, frameIndex, pts) {\n var 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];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = data[start + 1] >> 3 & 3;\n var headerC = data[start + 1] >> 1 & 3;\n var headerE = data[start + 2] >> 4 & 15;\n var headerF = data[start + 2] >> 2 & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n if (start + frameLength > end) {\n return -1;\n }\n if (this._onMpegFrame) {\n this._onMpegFrame(data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n }\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n if (this._onMpegNoise) {\n this._onMpegNoise(data.subarray(start, offset - 1));\n }\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n }\n }, {\n key: '_parseID3PES',\n value: function _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n }], [{\n key: 'probe',\n value: function probe(data) {\n // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n return true;\n } else {\n return false;\n }\n }\n }]);\n\n return TSDemuxer;\n}();\n\nexports.default = TSDemuxer;\n\n},{\"19\":19,\"23\":23,\"26\":26,\"28\":28,\"45\":45}],26:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ErrorTypes = exports.ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'networkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'mediaError',\n // Identifier for a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nvar ErrorDetails = exports.ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n MANIFEST_PARSING_ERROR: 'manifestParsingError',\n // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n LEVEL_SWITCH_ERROR: 'levelSwitchError',\n // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n FRAG_LOAD_ERROR: 'fragLoadError',\n // Identifier for fragment loop loading error - data: { frag : fragment object}\n FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n // Identifier for fragment load timeout error - data: { frag : fragment object}\n FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n // Identifier for a fragment decryption error event - data: parsing error description\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a remux alloc error event - data: { id : demuxer Id, bytes : nb of bytes on which allocation failed , reason : error text }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\n // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n KEY_LOAD_ERROR: 'keyLoadError',\n // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n // Identifier for a buffer append error - data: append error description\n BUFFER_APPEND_ERROR: 'bufferAppendError',\n // Identifier for a buffer appending error event - data: appending error description\n BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n // Identifier for a buffer stalled error event\n BUFFER_STALLED_ERROR: 'bufferStalledError',\n // Identifier for a buffer full event\n BUFFER_FULL_ERROR: 'bufferFullError',\n // Identifier for a buffer seek over hole event\n BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException'\n};\n\n},{}],27:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * All objects in the event handling chain should inherit from this class\n *\n */\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventHandler = function () {\n function EventHandler(hls) {\n _classCallCheck(this, EventHandler);\n\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n\n for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n _createClass(EventHandler, [{\n key: 'destroy',\n value: function destroy() {\n this.unregisterListeners();\n }\n }, {\n key: 'isEventHandler',\n value: function isEventHandler() {\n return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n if (event === 'hlsEventGeneric') {\n throw new Error('Forbidden event name: ' + event);\n }\n this.hls.on(event, this.onEvent);\n }.bind(this));\n }\n }\n }, {\n key: 'unregisterListeners',\n value: function unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n this.hls.off(event, this.onEvent);\n }.bind(this));\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n\n }, {\n key: 'onEvent',\n value: function onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n }, {\n key: 'onEventGeneric',\n value: function onEventGeneric(event, data) {\n var eventToFunction = function eventToFunction(event, data) {\n var funcName = 'on' + event.replace('hls', '');\n if (typeof this[funcName] !== 'function') {\n throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n }\n return this[funcName].bind(this, data);\n };\n try {\n eventToFunction.call(this, event, data).call();\n } catch (err) {\n _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n }\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;\n\n},{\"26\":26,\"28\":28,\"45\":45}],28:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = {\n // fired before MediaSource is attaching to media element - data: { media }\n MEDIA_ATTACHING: 'hlsMediaAttaching',\n // fired when MediaSource has been succesfully attached to media element - data: { }\n MEDIA_ATTACHED: 'hlsMediaAttached',\n // fired before detaching MediaSource from media element - data: { }\n MEDIA_DETACHING: 'hlsMediaDetaching',\n // fired when MediaSource has been detached from media element - data: { }\n MEDIA_DETACHED: 'hlsMediaDetached',\n // fired when we buffer is going to be resetted\n BUFFER_RESET: 'hlsBufferReset',\n // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n BUFFER_CODECS: 'hlsBufferCodecs',\n // fired when sourcebuffers have been created data: { tracks : tracks}\n BUFFER_CREATED: 'hlsBufferCreated',\n // fired when we append a segment to the buffer - data: { segment: segment object }\n BUFFER_APPENDING: 'hlsBufferAppending',\n // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING , pending : nb of segments waiting for appending for this segment parent}\n BUFFER_APPENDED: 'hlsBufferAppended',\n // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n BUFFER_EOS: 'hlsBufferEos',\n // fired when the media buffer should be flushed - data {startOffset, endOffset}\n BUFFER_FLUSHING: 'hlsBufferFlushing',\n // fired when the media has been flushed\n BUFFER_FLUSHED: 'hlsBufferFlushed',\n // fired to signal that a manifest loading starts - data: { url : manifestURL}\n MANIFEST_LOADING: 'hlsManifestLoading',\n // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n MANIFEST_LOADED: 'hlsManifestLoaded',\n // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n MANIFEST_PARSED: 'hlsManifestParsed',\n // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n LEVEL_LOADING: 'hlsLevelLoading',\n // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n LEVEL_LOADED: 'hlsLevelLoaded',\n // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n LEVEL_UPDATED: 'hlsLevelUpdated',\n // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n // fired when an audio track switch occurs - data: { id : audio track id} // deprecated\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id}\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id}\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\n // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n // fired when the first timestamp is found. - data: { id : demuxer id, initPTS: initPTS }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\n // fired when a fragment loading starts - data: { frag : fragment object}\n FRAG_LOADING: 'hlsFragLoading',\n // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n FRAG_LOADED: 'hlsFragLoaded',\n // fired when a fragment has finished decrypting - data: { level : levelId, sn : sequence number }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFpsDrop',\n //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n ERROR: 'hlsError',\n // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n // fired when a decrypt key loading starts - data: { frag : fragment object}\n KEY_LOADING: 'hlsKeyLoading',\n // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n KEY_LOADED: 'hlsKeyLoaded',\n // fired upon stream controller state transitions - data: {previousState, nextState}\n STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n};\n\n},{}],29:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * AAC helper\n */\n\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: 'getSilentFrame',\n value: function getSilentFrame(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0:d=0.05\" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 2) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 3) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Buffer Helper class, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = function () {\n function BufferHelper() {\n _classCallCheck(this, BufferHelper);\n }\n\n _createClass(BufferHelper, null, [{\n key: \"isBuffered\",\n value: function isBuffered(media, position) {\n if (media) {\n var buffered = media.buffered;\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n return false;\n }\n }, {\n key: \"bufferInfo\",\n value: function bufferInfo(media, pos, maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered,\n buffered = [],\n i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n } else {\n return { len: 0, start: 0, end: 0, nextStart: undefined };\n }\n }\n }, {\n key: \"bufferedInfo\",\n value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n var buffered2 = [],\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,\n bufferStart,\n bufferEnd,\n bufferStartNext,\n i;\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n var start = buffered2[i].start,\n end = buffered2[i].end;\n //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n }\n }]);\n\n return BufferHelper;\n}();\n\nexports.default = BufferHelper;\n\n},{}],31:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LevelHelper = function () {\n function LevelHelper() {\n _classCallCheck(this, LevelHelper);\n }\n\n _createClass(LevelHelper, null, [{\n key: 'mergeDetails',\n value: function mergeDetails(oldDetails, newDetails) {\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n delta = newDetails.startSN - oldDetails.startSN,\n oldfragments = oldDetails.fragments,\n newfragments = newDetails.fragments,\n ccOffset = 0,\n PTSFrag;\n\n // check if old/new playlists have fragments in common\n if (end < start) {\n newDetails.PTSKnown = false;\n return;\n }\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n for (var i = start; i <= end; i++) {\n var oldFrag = oldfragments[delta + i],\n newFrag = newfragments[i];\n if (newFrag && oldFrag) {\n ccOffset = oldFrag.cc - newFrag.cc;\n if (!isNaN(oldFrag.startPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.duration = oldFrag.duration;\n PTSFrag = newFrag;\n }\n }\n }\n\n if (ccOffset) {\n _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].cc += ccOffset;\n }\n }\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldfragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n if (delta >= 0 && delta < oldfragments.length) {\n // adjust start by sliding offset\n var sliding = oldfragments[delta].start;\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].start += sliding;\n }\n }\n }\n // if we are here, it means we have fragments overlapping between\n // old and new level. reliable PTS info is thus relying on old level\n newDetails.PTSKnown = oldDetails.PTSKnown;\n return;\n }\n }, {\n key: 'updateFragPTSDTS',\n value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\n if (!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(frag.startPTS - startPTS);\n if (isNaN(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n startPTS = Math.min(startPTS, frag.startPTS);\n endPTS = Math.max(endPTS, frag.endPTS);\n startDTS = Math.min(startDTS, frag.startDTS);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n\n var drift = startPTS - frag.start;\n\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n LevelHelper.updatePTS(fragments, i, i - 1);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n LevelHelper.updatePTS(fragments, i, i + 1);\n }\n details.PTSKnown = true;\n //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\n return drift;\n }\n }, {\n key: 'updatePTS',\n value: function updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],\n fragTo = fragments[toIdx],\n fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if (!isNaN(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n if (toIdx > fromIdx) {\n fragFrom.duration = fragToPTS - fragFrom.start;\n if (fragFrom.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n }\n } else {\n fragTo.duration = fragFrom.start - fragToPTS;\n if (fragTo.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n }\n }\n } else {\n // we dont know startPTS[toIdx]\n if (toIdx > fromIdx) {\n fragTo.start = fragFrom.start + fragFrom.duration;\n } else {\n fragTo.start = fragFrom.start - fragTo.duration;\n }\n }\n }\n }]);\n\n return LevelHelper;\n}();\n\nexports.default = LevelHelper;\n\n},{\"45\":45}],32:[function(_dereq_,module,exports){\n/**\n * HLS interface\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n//import FetchLoader from './utils/fetch-loader';\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _playlistLoader = _dereq_(36);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(34);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _abrController = _dereq_(4);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(7);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(8);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _audioStreamController = _dereq_(5);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _streamController = _dereq_(12);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(11);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _timelineController = _dereq_(13);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _audioTrackController = _dereq_(6);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _logger = _dereq_(45);\n\nvar _xhrLoader = _dereq_(47);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _keyLoader = _dereq_(35);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _cues = _dereq_(43);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Hls = function () {\n _createClass(Hls, null, [{\n key: 'isSupported',\n value: function isSupported() {\n window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.6.21';\n }\n }, {\n key: 'Events',\n get: function get() {\n return _events2.default;\n }\n }, {\n key: 'ErrorTypes',\n get: function get() {\n return _errors.ErrorTypes;\n }\n }, {\n key: 'ErrorDetails',\n get: function get() {\n return _errors.ErrorDetails;\n }\n }, {\n key: 'DefaultConfig',\n get: function get() {\n if (!Hls.defaultConfig) {\n Hls.defaultConfig = {\n autoStartLoad: true,\n startPosition: -1,\n defaultAudioCodec: undefined,\n debug: false,\n capLevelOnFPSDrop: false,\n capLevelToPlayerSize: false,\n initialLiveManifestSize: 1,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n maxBufferHole: 0.5,\n maxMaxBufferLength: 600,\n maxSeekHole: 2,\n lowBufferWatchdogPeriod: 0.5,\n highBufferWatchdogPeriod: 3,\n nudgeOffset: 0.1,\n nudgeMaxRetry: 3,\n maxFragLookUpTolerance: 0.2,\n liveSyncDurationCount: 3,\n liveMaxLatencyDurationCount: Infinity,\n liveSyncDuration: undefined,\n liveMaxLatencyDuration: undefined,\n enableWorker: true,\n enableSoftwareAES: true,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n manifestLoadingMaxRetryTimeout: 64000,\n startLevel: undefined,\n levelLoadingTimeOut: 10000,\n levelLoadingMaxRetry: 4,\n levelLoadingRetryDelay: 1000,\n levelLoadingMaxRetryTimeout: 64000,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 1000,\n fragLoadingMaxRetryTimeout: 64000,\n fragLoadingLoopThreshold: 3,\n startFragPrefetch: false,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 3,\n loader: _xhrLoader2.default,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: _abrController2.default,\n bufferController: _bufferController2.default,\n capLevelController: _capLevelController2.default,\n fpsController: _fpsController2.default,\n streamController: _streamController2.default,\n audioStreamController: _audioStreamController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true,\n enableMP2TPassThrough: false,\n stretchShortVideoTrack: false,\n forceKeyFrameOnDiscontinuity: true,\n abrEwmaFastLive: 3,\n abrEwmaSlowLive: 9,\n abrEwmaFastVoD: 3,\n abrEwmaSlowVoD: 9,\n abrEwmaDefaultEstimate: 5e5, // 500 kbps\n abrBandWidthFactor: 0.95,\n abrBandWidthUpFactor: 0.7,\n maxStarvationDelay: 4,\n maxLoadingDelay: 4,\n minAutoBitrate: 0\n };\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Hls);\n\n var defaultConfig = Hls.DefaultConfig;\n\n if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n }\n\n for (var prop in defaultConfig) {\n if (prop in config) {\n continue;\n }\n config[prop] = defaultConfig[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n }\n\n if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n }\n\n (0, _logger.enableLogs)(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n this.playlistLoader = new _playlistLoader2.default(this);\n this.fragmentLoader = new _fragmentLoader2.default(this);\n this.levelController = new _levelController2.default(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new config.bufferController(this);\n this.capLevelController = new config.capLevelController(this);\n this.fpsController = new config.fpsController(this);\n this.streamController = new config.streamController(this);\n this.audioStreamController = new config.audioStreamController(this);\n this.timelineController = new config.timelineController(this);\n this.audioTrackController = new _audioTrackController2.default(this);\n this.keyLoader = new _keyLoader2.default(this);\n }\n\n _createClass(Hls, [{\n key: 'destroy',\n value: function destroy() {\n _logger.logger.log('destroy');\n this.trigger(_events2.default.DESTROYING);\n this.detachMedia();\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.abrController.destroy();\n this.bufferController.destroy();\n this.capLevelController.destroy();\n this.fpsController.destroy();\n this.streamController.destroy();\n this.audioStreamController.destroy();\n this.timelineController.destroy();\n this.audioTrackController.destroy();\n this.keyLoader.destroy();\n this.url = null;\n this.observer.removeAllListeners();\n }\n }, {\n key: 'attachMedia',\n value: function attachMedia(media) {\n _logger.logger.log('attachMedia');\n this.media = media;\n this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n }\n }, {\n key: 'detachMedia',\n value: function detachMedia() {\n _logger.logger.log('detachMedia');\n this.trigger(_events2.default.MEDIA_DETACHING);\n this.media = null;\n }\n }, {\n key: 'loadSource',\n value: function loadSource(url) {\n _logger.logger.log('loadSource:' + url);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.levelController.startLoad();\n this.streamController.startLoad(startPosition);\n this.audioStreamController.startLoad(startPosition);\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.levelController.stopLoad();\n this.streamController.stopLoad();\n this.audioStreamController.stopLoad();\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n _logger.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n }, {\n key: 'recoverMediaError',\n value: function recoverMediaError() {\n _logger.logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n\n }, {\n key: 'levels',\n get: function get() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n\n }, {\n key: 'currentLevel',\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set currentLevel:' + newLevel);\n this.loadLevel = newLevel;\n this.streamController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n\n }, {\n key: 'nextLevel',\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set nextLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n\n }, {\n key: 'loadLevel',\n get: function get() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set loadLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n ,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n\n }, {\n key: 'firstLevel',\n get: function get() {\n return Math.max(this.levelController.firstLevel, this.abrController.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set firstLevel:' + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /** Return start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n\n }, {\n key: 'startLevel',\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /** set start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set startLevel:' + newLevel);\n this.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set autoLevelCapping:' + newLevel);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n\n }, {\n key: 'autoLevelEnabled',\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /* return manual level */\n\n }, {\n key: 'manualLevel',\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.audioTrackController.audioTracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.audioTrackController.audioTrack;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n this.audioTrackController.audioTrack = audioTrackId;\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"26\":26,\"28\":28,\"34\":34,\"35\":35,\"36\":36,\"4\":4,\"43\":43,\"45\":45,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"8\":8}],33:[function(_dereq_,module,exports){\n'use strict';\n\n// This is mostly for support of the es6 module export\n// syntax with the babel compiler, it looks like it doesnt support\n// function exports like we are used to in node/commonjs\nmodule.exports = _dereq_(32).default;\n\n},{\"32\":32}],34:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Fragment Loader\n */\n\nvar FragmentLoader = function (_EventHandler) {\n _inherits(FragmentLoader, _EventHandler);\n\n function FragmentLoader(hls) {\n _classCallCheck(this, FragmentLoader);\n\n var _this = _possibleConstructorReturn(this, (FragmentLoader.__proto__ || Object.getPrototypeOf(FragmentLoader)).call(this, hls, _events2.default.FRAG_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(FragmentLoader, [{\n key: 'destroy',\n value: function destroy() {\n var loaders = this.loaders;\n for (var loaderName in loaders) {\n var loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n config = this.hls.config;\n\n frag.loaded = 0;\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n var start = frag.byteRangeStartOffset,\n end = frag.byteRangeEndOffset;\n if (!isNaN(start) && !isNaN(end)) {\n loaderContext.rangeStart = start;\n loaderContext.rangeEnd = end;\n }\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n loader.load(loaderContext, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var payload = response.data,\n frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n // jshint ignore:line\n var frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],35:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Decrypt key Loader\n */\n\nvar KeyLoader = function (_EventHandler) {\n _inherits(KeyLoader, _EventHandler);\n\n function KeyLoader(hls) {\n _classCallCheck(this, KeyLoader);\n\n var _this = _possibleConstructorReturn(this, (KeyLoader.__proto__ || Object.getPrototypeOf(KeyLoader)).call(this, hls, _events2.default.KEY_LOADING));\n\n _this.loaders = {};\n _this.decryptkey = null;\n _this.decrypturl = null;\n return _this;\n }\n\n _createClass(KeyLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onKeyLoading',\n value: function onKeyLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n decryptdata = frag.decryptdata,\n uri = decryptdata.uri;\n // if uri is different from previous one or if decrypt key not retrieved yet\n if (uri !== this.decrypturl || this.decryptkey === null) {\n var config = this.hls.config;\n\n if (loader) {\n _logger.logger.warn('abort previous key loader for type:' + type);\n loader.abort();\n }\n frag.loader = this.loaders[type] = new config.loader(config);\n this.decrypturl = uri;\n this.decryptkey = null;\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n } else if (this.decryptkey) {\n // we already loaded this key, return it\n decryptdata.key = this.decryptkey;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var frag = context.frag;\n this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n }\n }]);\n\n return KeyLoader;\n}(_eventHandler2.default);\n\nexports.default = KeyLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],36:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _attrList = _dereq_(40);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nvar LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri);\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n value: function createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n\n return uint8View;\n }\n\n /**\n * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n * @param levelkey - a playlist's encryption info\n * @param segmentNumber - the fragment's segment number\n * @returns {*} - an object to be applied as a fragment's decryptdata\n */\n\n }, {\n key: 'fragmentDecryptdataFromLevelkey',\n value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl);\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\n}();\n\nvar PlaylistLoader = function (_EventHandler) {\n _inherits(PlaylistLoader, _EventHandler);\n\n function PlaylistLoader(hls) {\n _classCallCheck(this, PlaylistLoader);\n\n var _this = _possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(PlaylistLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading(data) {\n this.load(data.url, { type: 'manifest' });\n }\n }, {\n key: 'onLevelLoading',\n value: function onLevelLoading(data) {\n this.load(data.url, { type: 'level', level: data.level, id: data.id });\n }\n }, {\n key: 'onAudioTrackLoading',\n value: function onAudioTrackLoading(data) {\n this.load(data.url, { type: 'audioTrack', id: data.id });\n }\n }, {\n key: 'load',\n value: function load(url, context) {\n var loader = this.loaders[context.type];\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n _logger.logger.trace('playlist request ongoing');\n return;\n } else {\n _logger.logger.warn('abort previous loader for type:' + context.type);\n loader.abort();\n }\n }\n var config = this.hls.config,\n retry = void 0,\n timeout = void 0,\n retryDelay = void 0,\n maxRetryDelay = void 0;\n if (context.type === 'manifest') {\n retry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeout;\n } else {\n retry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeout;\n _logger.logger.log('loading playlist for ' + context.type + ' ' + (context.level || context.id));\n }\n loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n context.url = url;\n context.responseType = '';\n\n var loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n loader.load(context, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'resolve',\n value: function resolve(url, baseUrl) {\n return _urlToolkit2.default.buildAbsoluteURL(baseUrl, url);\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {\n var level = {};\n\n var attrs = level.attrs = new _attrList2.default(result[1]);\n level.url = this.resolve(result[2], baseurl);\n\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n level.name = attrs.NAME;\n\n var codecs = attrs.CODECS;\n if (codecs) {\n codecs = codecs.split(/[ ,]+/);\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n }, {\n key: 'parseMasterPlaylistMedia',\n value: function parseMasterPlaylistMedia(string, baseurl, type) {\n var result = void 0,\n medias = [];\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null) {\n var media = {};\n var attrs = new _attrList2.default(result[1]);\n if (attrs.TYPE === type) {\n media.groupId = attrs['GROUP-ID'];\n media.name = attrs.NAME;\n media.type = type;\n media.default = attrs.DEFAULT === 'YES';\n media.autoselect = attrs.AUTOSELECT === 'YES';\n media.forced = attrs.FORCED === 'YES';\n if (attrs.URI) {\n media.url = this.resolve(attrs.URI, baseurl);\n }\n media.lang = attrs.LANGUAGE;\n if (!media.name) {\n media.name = media.lang;\n }\n medias.push(media);\n }\n }\n return medias;\n }\n }, {\n key: 'avc1toavcoti',\n value: function avc1toavcoti(codec) {\n var result,\n avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n }, {\n key: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new _attrList2.default(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if (decrypturi && decryptmethod === 'AES-128') {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\n var startAttrs = new _attrList2.default(startParams);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if (!isNaN(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\n level.fragments.pop();\n totalduration -= frag.duration;\n }\n level.totalduration = totalduration;\n level.averagetargetduration = totalduration / level.fragments.length;\n level.endSN = currentSN - 1;\n return level;\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var string = response.data,\n url = response.url,\n type = context.type,\n id = context.id,\n level = context.level,\n hls = this.hls;\n\n this.loaders[type] = undefined;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n stats.tload = performance.now();\n //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n var isLevel = type !== 'audioTrack',\n levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' });\n }\n } else {\n var levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n if (audiotracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = false;\n audiotracks.forEach(function (audioTrack) {\n if (!audioTrack.url) {\n embeddedAudioFound = true;\n }\n });\n // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audiotracks.unshift({ type: 'main', name: 'main' });\n }\n }\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n }\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"2\":2,\"26\":26,\"27\":27,\"28\":28,\"40\":40,\"45\":45}],37:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n var videoHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': videoHdlr,\n 'audio': audioHdlr\n };\n\n var dref = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\n MP4.STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00]);\n MP4.VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n }\n }, {\n key: 'box',\n value: function box(type) {\n var payload = Array.prototype.slice.call(arguments, 1),\n size = 8,\n i = payload.length,\n len = i,\n result;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n }, {\n key: 'hdlr',\n value: function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }, {\n key: 'mdhd',\n value: function mdhd(timescale, duration) {\n duration *= timescale;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]));\n }\n }, {\n key: 'mdia',\n value: function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n }\n }, {\n key: 'minf',\n value: function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n }\n }, {\n key: 'moof',\n value: function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */\n\n }, {\n key: 'moov',\n value: function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n }\n }, {\n key: 'mvex',\n value: function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n }\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n duration *= timescale;\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return MP4.box(MP4.types.mvhd, bytes);\n }\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n }, {\n key: 'stbl',\n value: function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n }\n }, {\n key: 'avc1',\n value: function avc1(track) {\n var sps = [],\n pps = [],\n i,\n data,\n len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xFF);\n sps.push(len & 0xFF);\n sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xFF);\n pps.push(len & 0xFF);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n sps[3], // profile\n sps[4], // profile compat\n sps[5], // level\n 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))),\n // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n width >> 8 & 0xFF, width & 0xff, // width\n height >> 8 & 0xFF, height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\n }\n }, {\n key: 'esds',\n value: function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17 + configlen, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f + configlen, // length\n 0x40, //codec : mpeg4_audio\n 0x15, // stream_type\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n }, {\n key: 'mp4a',\n value: function mp4a(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n }\n }, {\n key: 'tkhd',\n value: function tkhd(track) {\n var id = track.id,\n duration = track.duration * track.timescale,\n width = track.width,\n height = track.height;\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x00, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n ]));\n }\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id;\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n 16 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8), // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n }, {\n key: 'trak',\n value: function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n }, {\n key: 'trex',\n value: function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n }\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [],\n len = samples.length,\n arraylen = 12 + 16 * len,\n array = new Uint8Array(arraylen),\n i,\n sample,\n duration,\n size,\n flags,\n cts;\n offset += 8 + arraylen;\n array.set([0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n }, {\n key: 'initSegment',\n value: function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks),\n result;\n result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n }\n }]);\n\n return MP4;\n}();\n\nexports.default = MP4;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * fMP4 remuxer\n */\n\nvar _aac = _dereq_(29);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _mp4Generator = _dereq_(37);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, id, config, typeSupported) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.id = id;\n this.config = config;\n this.typeSupported = typeSupported;\n this.ISGenerated = false;\n this.PES2MP4SCALEFACTOR = 4;\n this.PES_TIMESCALE = 90000;\n this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._initPTS = this._initDTS = undefined;\n }\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS) {\n this.level = level;\n this.sn = sn;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset, cc);\n }\n\n if (defaultInitPTS !== null) {\n this._initPTS = this._initDTS = defaultInitPTS;\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n var audioTrackLength = void 0;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n }\n } else {\n var videoData = void 0;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n }\n if (videoData && audioTrack.codec) {\n this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n }\n }\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (id3Track.samples.length) {\n this.remuxID3(id3Track, timeOffset);\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (textTrack.samples.length) {\n this.remuxText(textTrack, timeOffset);\n }\n //notify end of parsing\n this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n }\n }, {\n key: 'generateIS',\n value: function generateIS(audioTrack, videoTrack, timeOffset, cc) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n pesTimeScale = this.PES_TIMESCALE,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n computePTSDTS = this._initPTS === undefined,\n initPTS,\n initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n audioTrack.timescale = audioTrack.audiosamplerate;\n // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n // we know that each AAC sample contains 1024 frames....\n // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n (function () {\n var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n if (!b) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n };\n audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, audioTrack.isAAC ? 1024 : 1152);\n })();\n }\n _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _mp4Generator2.default.initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n videoTrack.timescale = this.MP4_TIMESCALE;\n tracks.video = {\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { id: this.id, initPTS: initPTS, cc: cc });\n }\n }\n\n if (Object.keys(tracks).length) {\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n } else {\n observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n }\n }\n }, {\n key: 'remuxVideo',\n value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var offset = 8,\n pesTimeScale = this.PES_TIMESCALE,\n pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.units.units;\n // let unitsString = '';\n // for (let j = 0; j < units.length ; j++) {\n // unitsString += units[j].type + ',';\n // if (units[j].data.length < 500) {\n // unitsString += Hex.hexDump(units[j].data);\n // }\n // }\n // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n // }\n\n // sort video samples by DTS then PTS order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n return deltadts ? deltadts : a.pts - b.pts;\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n }, 0);\n if (PTSDTSshift < 0) {\n _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n for (var i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n var nextAvcDts = void 0;\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n nextAvcDts = this.nextAvcDts;\n } else {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * pesTimeScale;\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n firstPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = Math.round((firstDTS - nextAvcDts) / 90);\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n if (delta) {\n if (delta > 1) {\n _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n } else if (delta < -1) {\n _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n }\n // remove hole/gap : set DTS to next expected DTS\n firstDTS = nextAvcDts;\n inputSamples[0].dts = firstDTS + initDTS;\n // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n inputSamples[0].pts = firstPTS + initDTS;\n _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n }\n }\n nextDTS = firstDTS;\n\n // compute lastPTS/lastDTS\n sample = inputSamples[inputSamples.length - 1];\n lastDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(lastPTS, lastDTS);\n\n var vendor = navigator.vendor,\n userAgent = navigator.userAgent,\n isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\n // on Safari let's signal the same sample duration for all samples\n // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n if (isSafari) {\n mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n }\n\n // normalize all PTS/DTS now ...\n for (var _i = 0; _i < nbSamples; _i++) {\n var _sample = inputSamples[_i];\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(ptsNormalize(_sample.dts - initDTS, nextAvcDts), firstDTS);\n // ensure dts is a multiple of scale factor to avoid rounding issues\n _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n // and we ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(ptsNormalize(_sample.pts - initDTS, nextAvcDts), _sample.dts);\n // ensure pts is a multiple of scale factor to avoid rounding issues\n _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n var mdatSize = track.len + 4 * track.nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var j = 0, nbUnits = avcSampleUnits.length; j < nbUnits; j++) {\n var unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n } else {\n var config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n if (config.stretchShortVideoTrack) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAudioPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n }\n _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n mp4SampleDuration /= pes2mp4ScaleFactor;\n compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n outputSamples.push({\n size: mp4SampleLength,\n // constant duration\n duration: mp4SampleDuration,\n cts: compositionTimeOffset,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: avcSample.key ? 2 : 1,\n isNonSync: avcSample.key ? 0 : 1\n }\n });\n }\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n var dropped = track.dropped;\n track.len = 0;\n track.nbNalu = 0;\n track.dropped = 0;\n if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var flags = outputSamples[0].flags;\n // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n track.samples = outputSamples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n\n var data = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: this.nextAvcDts / pesTimeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped: dropped\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n return data;\n }\n }, {\n key: 'remuxAudio',\n value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n expectedSampleDuration = track.timescale * (track.isAAC ? 1024 : 1152) / track.audiosamplerate,\n pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var view,\n offset = rawMPEG ? 0 : 8,\n audioSample,\n mp4Sample,\n unit,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n lastDTS,\n pts,\n dts,\n ptsnorm,\n dtsnorm,\n outputSamples = [],\n inputSamples = [],\n fillFrame,\n newStamp,\n nextAudioPts;\n\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n inputSamples = track.samples;\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset and next expected PTS OR\n // - less than 20 audio frames distance\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\n nextAudioPts = this.nextAudioPts;\n contiguous |= inputSamples.length && nextAudioPts && (Math.abs(timeOffset - nextAudioPts / pesTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - this._initDTS) < 20 * pesFrameDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * pesTimeScale;\n }\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPtsNorm = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n ptsNorm = ptsNormalize(sample.pts - initDTS, nextAudioPts),\n delta = ptsNorm - nextPtsNorm;\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -pesFrameDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n // also only inject silent audio frames if currentTime !== 0 (nextPtsNorm !== 0)\n else if (delta >= pesFrameDuration && nextPtsNorm) {\n var missing = Math.round(delta / pesFrameDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n newStamp = nextPtsNorm + initDTS;\n newStamp = Math.max(newStamp, initDTS);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPtsNorm + initDTS;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n // Otherwise, we're within half a frame duration, so just adjust pts\n else {\n if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n }\n nextPtsNorm += pesFrameDuration;\n if (i === 0) {\n sample.pts = sample.dts = initDTS + nextAudioPts;\n } else {\n sample.pts = sample.dts = inputSamples[i - 1].pts + pesFrameDuration;\n }\n i += 1;\n }\n }\n }\n\n for (var _j = 0, _nbSamples = inputSamples.length; _j < _nbSamples; _j++) {\n audioSample = inputSamples[_j];\n unit = audioSample.unit;\n pts = audioSample.pts - initDTS;\n dts = audioSample.dts - initDTS;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastDTS !== undefined) {\n ptsnorm = ptsNormalize(pts, lastDTS);\n dtsnorm = ptsNormalize(dts, lastDTS);\n mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n } else {\n ptsnorm = ptsNormalize(pts, nextAudioPts);\n dtsnorm = ptsNormalize(dts, nextAudioPts);\n var _delta = Math.round(1000 * (ptsnorm - nextAudioPts) / pesTimeScale),\n numMissingFrames = 0;\n // if fragment are contiguous, detect hole/overlapping between fragments\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0) {\n numMissingFrames = Math.round((ptsnorm - nextAudioPts) / pesFrameDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\n }\n track.len += numMissingFrames * fillFrame.length;\n }\n // if we have frame overlap, overlapping for more than half a frame duraion\n } else if (_delta < -12) {\n // drop overlapping audio frames... browser will deal with it\n _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n ptsnorm = dtsnorm = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, ptsnorm);\n firstDTS = Math.max(0, dtsnorm);\n if (track.len > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n\n var mdatSize = rawMPEG ? track.len : track.len + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });\n return;\n }\n if (!rawMPEG) {\n view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\n }\n mdat.set(fillFrame, offset);\n offset += fillFrame.byteLength;\n mp4Sample = {\n size: fillFrame.byteLength,\n cts: 0,\n duration: 1024,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\n cts: 0,\n duration: 0,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n lastDTS = dtsnorm;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n }\n track.samples = [];\n var audioData = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: this.nextAudioPts / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n }, {\n key: 'remuxEmptyAudio',\n value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * pesTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n\n // silent frame\n silentFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({ unit: silentFrame, pts: stamp, dts: stamp });\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n }, {\n key: 'remuxID3',\n value: function remuxID3(track, timeOffset) {\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: 'remuxText',\n value: function remuxText(track, timeOffset) {\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: '_PTSNormalize',\n value: function _PTSNormalize(value, reference) {\n var offset;\n if (reference === undefined) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return false;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"26\":26,\"28\":28,\"29\":29,\"37\":37,\"45\":45}],39:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * passthrough remuxer\n */\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PassThroughRemuxer = function () {\n function PassThroughRemuxer(observer, id) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n this.id = id;\n this.ISGenerated = false;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {}\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n var observer = this.observer;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n var tracks = {},\n data = { id: this.id, tracks: tracks, unique: true },\n track = videoTrack,\n codec = track.codec;\n\n if (codec) {\n data.tracks.video = {\n container: track.container,\n codec: codec,\n metadata: {\n width: track.width,\n height: track.height\n }\n };\n }\n\n track = audioTrack;\n codec = track.codec;\n if (codec) {\n data.tracks.audio = {\n container: track.container,\n codec: codec,\n metadata: {\n channelCount: track.channelCount\n }\n };\n }\n this.ISGenerated = true;\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n id: this.id,\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: 'audiovideo',\n nb: 1,\n dropped: 0\n });\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return true;\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"28\":28}],40:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\nvar AttrList = function () {\n function AttrList(attrs) {\n _classCallCheck(this, AttrList);\n\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n\n _createClass(AttrList, [{\n key: 'decimalInteger',\n value: function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'hexadecimalInteger',\n value: function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: 'hexadecimalIntegerAsNumber',\n value: function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'decimalFloatingPoint',\n value: function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n }, {\n key: 'enumeratedString',\n value: function enumeratedString(attrName) {\n return this[attrName];\n }\n }, {\n key: 'decimalResolution',\n value: function decimalResolution(attrName) {\n var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n }\n }], [{\n key: 'parseAttrList',\n value: function parseAttrList(input) {\n var match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2],\n quote = '\"';\n\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n }\n }]);\n\n return AttrList;\n}();\n\nexports.default = AttrList;\n\n},{}],41:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array} list The array to search.\n * @param {Function} comparisonFunction\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {*} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFunction) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n\n var comparisonResult = comparisonFunction(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n\n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n},{}],42:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n * This code was ported from the dash.js project at:\n * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n *\n * The original copyright appears below:\n *\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2015-2016, DASH Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * 2. Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n */\n\nvar specialCea608CharsCodes = {\n 0x2a: 0xe1, // lowercase a, acute accent\n 0x5c: 0xe9, // lowercase e, acute accent\n 0x5e: 0xed, // lowercase i, acute accent\n 0x5f: 0xf3, // lowercase o, acute accent\n 0x60: 0xfa, // lowercase u, acute accent\n 0x7b: 0xe7, // lowercase c with cedilla\n 0x7c: 0xf7, // division symbol\n 0x7d: 0xd1, // uppercase N tilde\n 0x7e: 0xf1, // lowercase n tilde\n 0x7f: 0x2588, // Full block\n // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n 0x80: 0xae, // Registered symbol (R)\n 0x81: 0xb0, // degree sign\n 0x82: 0xbd, // 1/2 symbol\n 0x83: 0xbf, // Inverted (open) question mark\n 0x84: 0x2122, // Trademark symbol (TM)\n 0x85: 0xa2, // Cents symbol\n 0x86: 0xa3, // Pounds sterling\n 0x87: 0x266a, // Music 8'th note\n 0x88: 0xe0, // lowercase a, grave accent\n 0x89: 0x20, // transparent space (regular)\n 0x8a: 0xe8, // lowercase e, grave accent\n 0x8b: 0xe2, // lowercase a, circumflex accent\n 0x8c: 0xea, // lowercase e, circumflex accent\n 0x8d: 0xee, // lowercase i, circumflex accent\n 0x8e: 0xf4, // lowercase o, circumflex accent\n 0x8f: 0xfb, // lowercase u, circumflex accent\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n 0x90: 0xc1, // capital letter A with acute\n 0x91: 0xc9, // capital letter E with acute\n 0x92: 0xd3, // capital letter O with acute\n 0x93: 0xda, // capital letter U with acute\n 0x94: 0xdc, // capital letter U with diaresis\n 0x95: 0xfc, // lowercase letter U with diaeresis\n 0x96: 0x2018, // opening single quote\n 0x97: 0xa1, // inverted exclamation mark\n 0x98: 0x2a, // asterisk\n 0x99: 0x2019, // closing single quote\n 0x9a: 0x2501, // box drawings heavy horizontal\n 0x9b: 0xa9, // copyright sign\n 0x9c: 0x2120, // Service mark\n 0x9d: 0x2022, // (round) bullet\n 0x9e: 0x201c, // Left double quotation mark\n 0x9f: 0x201d, // Right double quotation mark\n 0xa0: 0xc0, // uppercase A, grave accent\n 0xa1: 0xc2, // uppercase A, circumflex\n 0xa2: 0xc7, // uppercase C with cedilla\n 0xa3: 0xc8, // uppercase E, grave accent\n 0xa4: 0xca, // uppercase E, circumflex\n 0xa5: 0xcb, // capital letter E with diaresis\n 0xa6: 0xeb, // lowercase letter e with diaresis\n 0xa7: 0xce, // uppercase I, circumflex\n 0xa8: 0xcf, // uppercase I, with diaresis\n 0xa9: 0xef, // lowercase i, with diaresis\n 0xaa: 0xd4, // uppercase O, circumflex\n 0xab: 0xd9, // uppercase U, grave accent\n 0xac: 0xf9, // lowercase u, grave accent\n 0xad: 0xdb, // uppercase U, circumflex\n 0xae: 0xab, // left-pointing double angle quotation mark\n 0xaf: 0xbb, // right-pointing double angle quotation mark\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n 0xb0: 0xc3, // Uppercase A, tilde\n 0xb1: 0xe3, // Lowercase a, tilde\n 0xb2: 0xcd, // Uppercase I, acute accent\n 0xb3: 0xcc, // Uppercase I, grave accent\n 0xb4: 0xec, // Lowercase i, grave accent\n 0xb5: 0xd2, // Uppercase O, grave accent\n 0xb6: 0xf2, // Lowercase o, grave accent\n 0xb7: 0xd5, // Uppercase O, tilde\n 0xb8: 0xf5, // Lowercase o, tilde\n 0xb9: 0x7b, // Open curly brace\n 0xba: 0x7d, // Closing curly brace\n 0xbb: 0x5c, // Backslash\n 0xbc: 0x5e, // Caret\n 0xbd: 0x5f, // Underscore\n 0xbe: 0x7c, // Pipe (vertical line)\n 0xbf: 0x223c, // Tilde operator\n 0xc0: 0xc4, // Uppercase A, umlaut\n 0xc1: 0xe4, // Lowercase A, umlaut\n 0xc2: 0xd6, // Uppercase O, umlaut\n 0xc3: 0xf6, // Lowercase o, umlaut\n 0xc4: 0xdf, // Esszett (sharp S)\n 0xc5: 0xa5, // Yen symbol\n 0xc6: 0xa4, // Generic currency sign\n 0xc7: 0x2503, // Box drawings heavy vertical\n 0xc8: 0xc5, // Uppercase A, ring\n 0xc9: 0xe5, // Lowercase A, ring\n 0xca: 0xd8, // Uppercase O, stroke\n 0xcb: 0xf8, // Lowercase o, strok\n 0xcc: 0x250f, // Box drawings heavy down and right\n 0xcd: 0x2513, // Box drawings heavy down and left\n 0xce: 0x2517, // Box drawings heavy up and right\n 0xcf: 0x251b // Box drawings heavy up and left\n};\n\n/**\n * Utils\n */\nvar getCharForByte = function getCharForByte(byte) {\n var charCode = byte;\n if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n charCode = specialCea608CharsCodes[byte];\n }\n return String.fromCharCode(charCode);\n};\n\nvar NR_ROWS = 15,\n NR_COLS = 32;\n// Tables to look up row from PAC data\nvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\nvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\nvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\nvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\nvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\n/**\n * Simple logger class to be able to write with time-stamps and filter on level.\n */\nvar logger = {\n verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n time: null,\n verboseLevel: 0, // Only write errors\n setTime: function setTime(newTime) {\n this.time = newTime;\n },\n log: function log(severity, msg) {\n var minLevel = this.verboseFilter[severity];\n if (this.verboseLevel >= minLevel) {\n console.log(this.time + ' [' + severity + '] ' + msg);\n }\n }\n};\n\nvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n var hexArray = [];\n for (var j = 0; j < numArray.length; j++) {\n hexArray.push(numArray[j].toString(16));\n }\n return hexArray;\n};\n\nvar PenState = function () {\n function PenState(foreground, underline, italics, background, flash) {\n _classCallCheck(this, PenState);\n\n this.foreground = foreground || 'white';\n this.underline = underline || false;\n this.italics = italics || false;\n this.background = background || 'black';\n this.flash = flash || false;\n }\n\n _createClass(PenState, [{\n key: 'reset',\n value: function reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n }, {\n key: 'setStyles',\n value: function setStyles(styles) {\n var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n for (var i = 0; i < attribs.length; i++) {\n var style = attribs[i];\n if (styles.hasOwnProperty(style)) {\n this[style] = styles[style];\n }\n }\n }\n }, {\n key: 'isDefault',\n value: function isDefault() {\n return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n }\n }, {\n key: 'copy',\n value: function copy(newPenState) {\n this.foreground = newPenState.foreground;\n this.underline = newPenState.underline;\n this.italics = newPenState.italics;\n this.background = newPenState.background;\n this.flash = newPenState.flash;\n }\n }, {\n key: 'toString',\n value: function toString() {\n return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n }\n }]);\n\n return PenState;\n}();\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\n\n\nvar StyledUnicodeChar = function () {\n function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n _classCallCheck(this, StyledUnicodeChar);\n\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline, italics, background, flash);\n }\n\n _createClass(StyledUnicodeChar, [{\n key: 'reset',\n value: function reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n }, {\n key: 'setChar',\n value: function setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n }, {\n key: 'setPenState',\n value: function setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n }, {\n key: 'copy',\n value: function copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n }]);\n\n return StyledUnicodeChar;\n}();\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\n\n\nvar Row = function () {\n function Row() {\n _classCallCheck(this, Row);\n\n this.chars = [];\n for (var i = 0; i < NR_COLS; i++) {\n this.chars.push(new StyledUnicodeChar());\n }\n this.pos = 0;\n this.currPenState = new PenState();\n }\n\n _createClass(Row, [{\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].equals(other.chars[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_COLS; i++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n\n /**\n * Set the cursor to a valid column.\n */\n\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n if (this.pos !== absPos) {\n this.pos = absPos;\n }\n if (this.pos < 0) {\n logger.log('ERROR', 'Negative cursor position ' + this.pos);\n this.pos = 0;\n } else if (this.pos > NR_COLS) {\n logger.log('ERROR', 'Too large cursor position ' + this.pos);\n this.pos = NR_COLS;\n }\n }\n\n /**\n * Move the cursor relative to current position.\n */\n\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var newPos = this.pos + relPos;\n if (relPos > 1) {\n for (var i = this.pos + 1; i < newPos + 1; i++) {\n this.chars[i].setPenState(this.currPenState);\n }\n }\n this.setCursor(newPos);\n }\n\n /**\n * Backspace, move one step back and clear character.\n */\n\n }, {\n key: 'backSpace',\n value: function backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n }, {\n key: 'insertChar',\n value: function insertChar(byte) {\n if (byte >= 0x90) {\n //Extended char\n this.backSpace();\n }\n var char = getCharForByte(byte);\n if (this.pos >= NR_COLS) {\n logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n return;\n }\n this.chars[this.pos].setChar(char, this.currPenState);\n this.moveCursor(1);\n }\n }, {\n key: 'clearFromPos',\n value: function clearFromPos(startPos) {\n var i;\n for (i = startPos; i < NR_COLS; i++) {\n this.chars[i].reset();\n }\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n }, {\n key: 'getTextString',\n value: function getTextString() {\n var chars = [];\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n var char = this.chars[i].uchar;\n if (char !== ' ') {\n empty = false;\n }\n chars.push(char);\n }\n if (empty) {\n return '';\n } else {\n return chars.join('');\n }\n }\n }, {\n key: 'setPenStyles',\n value: function setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n }]);\n\n return Row;\n}();\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\n\n\nvar CaptionScreen = function () {\n function CaptionScreen() {\n _classCallCheck(this, CaptionScreen);\n\n this.rows = [];\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n }\n this.currRow = NR_ROWS - 1;\n this.nrRollUpRows = null;\n this.reset();\n }\n\n _createClass(CaptionScreen, [{\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n this.currRow = NR_ROWS - 1;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].equals(other.rows[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: 'backSpace',\n value: function backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n var row = this.rows[this.currRow];\n row.clearToEndOfRow();\n }\n\n /**\n * Insert a character (without styling) in the current row.\n */\n\n }, {\n key: 'insertChar',\n value: function insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n }, {\n key: 'setPen',\n value: function setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData, lastOutputScreen) {\n logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n var newRow = pacData.row - 1;\n if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n newRow = this.nrRollUpRows - 1;\n }\n\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow - this.nrRollUpRows + i + 1].copy(lastOutputScreen.rows[topRowIndex + i]);\n }\n }\n }\n\n this.currRow = newRow;\n var row = this.rows[this.currRow];\n if (pacData.indent !== null) {\n var indent = pacData.indent;\n var prevPos = Math.max(indent - 1, 0);\n row.setCursor(pacData.indent);\n pacData.color = row.chars[prevPos].penState.foreground;\n }\n var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n this.setPen(styles);\n }\n\n /**\n * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n */\n\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n\n logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n this.backSpace();\n this.setPen(bkgData);\n this.insertChar(0x20); //Space\n }\n }, {\n key: 'setRollUpRows',\n value: function setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n }, {\n key: 'rollUp',\n value: function rollUp() {\n if (this.nrRollUpRows === null) {\n logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n return; //Not properly setup\n }\n logger.log('TEXT', this.getDisplayText());\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n var topRow = this.rows.splice(topRowIndex, 1)[0];\n topRow.clear();\n this.rows.splice(this.currRow, 0, topRow);\n logger.log('INFO', 'Rolling up');\n //logger.log('TEXT', this.get_display_text())\n }\n\n /**\n * Get all non-empty rows with as unicode text.\n */\n\n }, {\n key: 'getDisplayText',\n value: function getDisplayText(asOneRow) {\n asOneRow = asOneRow || false;\n var displayText = [];\n var text = '';\n var rowNr = -1;\n for (var i = 0; i < NR_ROWS; i++) {\n var rowText = this.rows[i].getTextString();\n if (rowText) {\n rowNr = i + 1;\n if (asOneRow) {\n displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n } else {\n displayText.push(rowText.trim());\n }\n }\n }\n if (displayText.length > 0) {\n if (asOneRow) {\n text = '[' + displayText.join(' | ') + ']';\n } else {\n text = displayText.join('\\n');\n }\n }\n return text;\n }\n }, {\n key: 'getTextAndFormat',\n value: function getTextAndFormat() {\n return this.rows;\n }\n }]);\n\n return CaptionScreen;\n}();\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nvar Cea608Channel = function () {\n function Cea608Channel(channelNumber, outputFilter) {\n _classCallCheck(this, Cea608Channel);\n\n this.chNr = channelNumber;\n this.outputFilter = outputFilter;\n this.mode = null;\n this.verbose = 0;\n this.displayedMemory = new CaptionScreen();\n this.nonDisplayedMemory = new CaptionScreen();\n this.lastOutputScreen = new CaptionScreen();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null; // Keeps track of where a cue started.\n }\n\n _createClass(Cea608Channel, [{\n key: 'reset',\n value: function reset() {\n this.mode = null;\n this.displayedMemory.reset();\n this.nonDisplayedMemory.reset();\n this.lastOutputScreen.reset();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null;\n this.lastCueEndTime = null;\n }\n }, {\n key: 'getHandler',\n value: function getHandler() {\n return this.outputFilter;\n }\n }, {\n key: 'setHandler',\n value: function setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n this.writeScreen.setPAC(pacData, this.lastOutputScreen);\n }\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n }, {\n key: 'setMode',\n value: function setMode(newMode) {\n if (newMode === this.mode) {\n return;\n }\n this.mode = newMode;\n logger.log('INFO', 'MODE=' + newMode);\n if (this.mode === 'MODE_POP-ON') {\n this.writeScreen = this.nonDisplayedMemory;\n } else {\n this.writeScreen = this.displayedMemory;\n this.writeScreen.reset();\n this.lastOutputScreen.reset();\n }\n if (this.mode !== 'MODE_ROLL-UP') {\n this.displayedMemory.nrRollUpRows = null;\n this.nonDisplayedMemory.nrRollUpRows = null;\n }\n this.mode = newMode;\n }\n }, {\n key: 'insertChars',\n value: function insertChars(chars) {\n for (var i = 0; i < chars.length; i++) {\n this.writeScreen.insertChar(chars[i]);\n }\n var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccRCL',\n value: function ccRCL() {\n // Resume Caption Loading (switch mode to Pop On)\n logger.log('INFO', 'RCL - Resume Caption Loading');\n this.setMode('MODE_POP-ON');\n }\n }, {\n key: 'ccBS',\n value: function ccBS() {\n // BackSpace\n logger.log('INFO', 'BS - BackSpace');\n if (this.mode === 'MODE_TEXT') {\n return;\n }\n this.writeScreen.backSpace();\n if (this.writeScreen === this.displayedMemory) {\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccAOF',\n value: function ccAOF() {\n // Reserved (formerly Alarm Off)\n return;\n }\n }, {\n key: 'ccAON',\n value: function ccAON() {\n // Reserved (formerly Alarm On)\n return;\n }\n }, {\n key: 'ccDER',\n value: function ccDER() {\n // Delete to End of Row\n logger.log('INFO', 'DER- Delete to End of Row');\n this.writeScreen.clearToEndOfRow();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccRU',\n value: function ccRU(nrRows) {\n //Roll-Up Captions-2,3,or 4 Rows\n logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n this.writeScreen = this.displayedMemory;\n this.setMode('MODE_ROLL-UP');\n this.writeScreen.setRollUpRows(nrRows);\n }\n }, {\n key: 'ccFON',\n value: function ccFON() {\n //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({ flash: true });\n }\n }, {\n key: 'ccRDC',\n value: function ccRDC() {\n // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n }, {\n key: 'ccTR',\n value: function ccTR() {\n // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccRTD',\n value: function ccRTD() {\n // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccEDM',\n value: function ccEDM() {\n // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccCR',\n value: function ccCR() {\n // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccENM',\n value: function ccENM() {\n //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n }, {\n key: 'ccEOC',\n value: function ccEOC() {\n //End of Caption (Flip Memories)\n logger.log('INFO', 'EOC - End Of Caption');\n if (this.mode === 'MODE_POP-ON') {\n var tmp = this.displayedMemory;\n this.displayedMemory = this.nonDisplayedMemory;\n this.nonDisplayedMemory = tmp;\n this.writeScreen = this.nonDisplayedMemory;\n logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n }\n this.outputDataUpdate();\n }\n }, {\n key: 'ccTO',\n value: function ccTO(nrCols) {\n // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n }, {\n key: 'ccMIDROW',\n value: function ccMIDROW(secondByte) {\n // Parse MIDROW command\n var styles = { flash: false };\n styles.underline = secondByte % 2 === 1;\n styles.italics = secondByte >= 0x2e;\n if (!styles.italics) {\n var colorIndex = Math.floor(secondByte / 2) - 0x10;\n var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n styles.foreground = colors[colorIndex];\n } else {\n styles.foreground = 'white';\n }\n logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n this.writeScreen.setPen(styles);\n }\n }, {\n key: 'outputDataUpdate',\n value: function outputDataUpdate() {\n var t = logger.time;\n if (t === null) {\n return;\n }\n if (this.outputFilter) {\n if (this.outputFilter.updateData) {\n this.outputFilter.updateData(t, this.displayedMemory);\n }\n if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n // Start of a new cue\n this.cueStartTime = t;\n } else {\n if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n }\n this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n }\n }\n this.lastOutputScreen.copy(this.displayedMemory);\n }\n }\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n if (this.outputFilter) {\n if (!this.displayedMemory.isEmpty()) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n }\n this.cueStartTime = t;\n }\n }\n }\n }]);\n\n return Cea608Channel;\n}();\n\nvar Cea608Parser = function () {\n function Cea608Parser(field, out1, out2) {\n _classCallCheck(this, Cea608Parser);\n\n this.field = field || 1;\n this.outputs = [out1, out2];\n this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n this.currChNr = -1; // Will be 1 or 2\n this.lastCmdA = null; // First byte of last command\n this.lastCmdB = null; // Second byte of last command\n this.bufferedData = [];\n this.startTime = null;\n this.lastTime = null;\n this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n }\n\n _createClass(Cea608Parser, [{\n key: 'getHandler',\n value: function getHandler(index) {\n return this.channels[index].getHandler();\n }\n }, {\n key: 'setHandler',\n value: function setHandler(index, newHandler) {\n this.channels[index].setHandler(newHandler);\n }\n\n /**\n * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n */\n\n }, {\n key: 'addData',\n value: function addData(t, byteList) {\n var cmdFound,\n a,\n b,\n charsFound = false;\n\n this.lastTime = t;\n logger.setTime(t);\n\n for (var i = 0; i < byteList.length; i += 2) {\n a = byteList[i] & 0x7f;\n b = byteList[i + 1] & 0x7f;\n if (a === 0 && b === 0) {\n this.dataCounters.padding += 2;\n continue;\n } else {\n logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n }\n cmdFound = this.parseCmd(a, b);\n if (!cmdFound) {\n cmdFound = this.parseMidrow(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parsePAC(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parseBackgroundAttributes(a, b);\n }\n if (!cmdFound) {\n charsFound = this.parseChars(a, b);\n if (charsFound) {\n if (this.currChNr && this.currChNr >= 0) {\n var channel = this.channels[this.currChNr - 1];\n channel.insertChars(charsFound);\n } else {\n logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n }\n }\n }\n if (cmdFound) {\n this.dataCounters.cmd += 2;\n } else if (charsFound) {\n this.dataCounters.char += 2;\n } else {\n this.dataCounters.other += 2;\n logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n }\n }\n }\n\n /**\n * Parse Command.\n * @returns {Boolean} Tells if a command was found\n */\n\n }, {\n key: 'parseCmd',\n value: function parseCmd(a, b) {\n var chNr = null;\n\n var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n if (!(cond1 || cond2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null; // Repeated commands are dropped (once)\n logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n return true;\n }\n\n if (a === 0x14 || a === 0x17) {\n chNr = 1;\n } else {\n chNr = 2; // (a === 0x1C || a=== 0x1f)\n }\n\n var channel = this.channels[chNr - 1];\n\n if (a === 0x14 || a === 0x1C) {\n if (b === 0x20) {\n channel.ccRCL();\n } else if (b === 0x21) {\n channel.ccBS();\n } else if (b === 0x22) {\n channel.ccAOF();\n } else if (b === 0x23) {\n channel.ccAON();\n } else if (b === 0x24) {\n channel.ccDER();\n } else if (b === 0x25) {\n channel.ccRU(2);\n } else if (b === 0x26) {\n channel.ccRU(3);\n } else if (b === 0x27) {\n channel.ccRU(4);\n } else if (b === 0x28) {\n channel.ccFON();\n } else if (b === 0x29) {\n channel.ccRDC();\n } else if (b === 0x2A) {\n channel.ccTR();\n } else if (b === 0x2B) {\n channel.ccRTD();\n } else if (b === 0x2C) {\n channel.ccEDM();\n } else if (b === 0x2D) {\n channel.ccCR();\n } else if (b === 0x2E) {\n channel.ccENM();\n } else if (b === 0x2F) {\n channel.ccEOC();\n }\n } else {\n //a == 0x17 || a == 0x1F\n channel.ccTO(b - 0x20);\n }\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Parse midrow styling command\n * @returns {Boolean}\n */\n\n }, {\n key: 'parseMidrow',\n value: function parseMidrow(a, b) {\n var chNr = null;\n\n if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n if (a === 0x11) {\n chNr = 1;\n } else {\n chNr = 2;\n }\n if (chNr !== this.currChNr) {\n logger.log('ERROR', 'Mismatch channel in midrow parsing');\n return false;\n }\n var channel = this.channels[chNr - 1];\n channel.ccMIDROW(b);\n logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n return true;\n }\n return false;\n }\n /**\n * Parse Preable Access Codes (Table 53).\n * @returns {Boolean} Tells if PAC found\n */\n\n }, {\n key: 'parsePAC',\n value: function parsePAC(a, b) {\n\n var chNr = null;\n var row = null;\n\n var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n if (!(case1 || case2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true; // Repeated commands are dropped (once)\n }\n\n chNr = a <= 0x17 ? 1 : 2;\n\n if (0x40 <= b && b <= 0x5F) {\n row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n } else {\n // 0x60 <= b <= 0x7F\n row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n }\n var pacData = this.interpretPAC(row, b);\n var channel = this.channels[chNr - 1];\n channel.setPAC(pacData);\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Interpret the second byte of the pac, and return the information.\n * @returns {Object} pacData with style parameters.\n */\n\n }, {\n key: 'interpretPAC',\n value: function interpretPAC(row, byte) {\n var pacIndex = byte;\n var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\n if (byte > 0x5F) {\n pacIndex = byte - 0x60;\n } else {\n pacIndex = byte - 0x40;\n }\n pacData.underline = (pacIndex & 1) === 1;\n if (pacIndex <= 0xd) {\n pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n } else if (pacIndex <= 0xf) {\n pacData.italics = true;\n pacData.color = 'white';\n } else {\n pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n }\n return pacData; // Note that row has zero offset. The spec uses 1.\n }\n\n /**\n * Parse characters.\n * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n */\n\n }, {\n key: 'parseChars',\n value: function parseChars(a, b) {\n\n var channelNr = null,\n charCodes = null,\n charCode1 = null;\n\n if (a >= 0x19) {\n channelNr = 2;\n charCode1 = a - 8;\n } else {\n channelNr = 1;\n charCode1 = a;\n }\n if (0x11 <= charCode1 && charCode1 <= 0x13) {\n // Special character\n var oneCode = b;\n if (charCode1 === 0x11) {\n oneCode = b + 0x50;\n } else if (charCode1 === 0x12) {\n oneCode = b + 0x70;\n } else {\n oneCode = b + 0x90;\n }\n logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n charCodes = [oneCode];\n } else if (0x20 <= a && a <= 0x7f) {\n charCodes = b === 0 ? [a] : [a, b];\n }\n if (charCodes) {\n var hexCodes = numArrayToHexArray(charCodes);\n logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n return charCodes;\n }\n\n /**\n * Parse extended background attributes as well as new foreground color black.\n * @returns{Boolean} Tells if background attributes are found\n */\n\n }, {\n key: 'parseBackgroundAttributes',\n value: function parseBackgroundAttributes(a, b) {\n var bkgData, index, chNr, channel;\n\n var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n if (!(case1 || case2)) {\n return false;\n }\n bkgData = {};\n if (a === 0x10 || a === 0x18) {\n index = Math.floor((b - 0x20) / 2);\n bkgData.background = backgroundColors[index];\n if (b % 2 === 1) {\n bkgData.background = bkgData.background + '_semi';\n }\n } else if (b === 0x2d) {\n bkgData.background = 'transparent';\n } else {\n bkgData.foreground = 'black';\n if (b === 0x2f) {\n bkgData.underline = true;\n }\n }\n chNr = a < 0x18 ? 1 : 2;\n channel = this.channels[chNr - 1];\n channel.setBkgData(bkgData);\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true;\n }\n\n /**\n * Reset state of parser and its channels.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].reset();\n }\n }\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n\n /**\n * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n */\n\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].cueSplitAtTime(t);\n }\n }\n }\n }]);\n\n return Cea608Parser;\n}();\n\nexports.default = Cea608Parser;\n\n},{}],43:[function(_dereq_,module,exports){\n'use strict';\n\nvar Cues = {\n\n newCue: function newCue(track, startTime, endTime, captionScreen) {\n var row;\n var cue;\n var indenting;\n var indent;\n var text;\n var VTTCue = window.VTTCue || window.TextTrackCue;\n\n for (var r = 0; r < captionScreen.rows.length; r++) {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty()) {\n for (var c = 0; c < row.chars.length; c++) {\n if (row.chars[c].uchar.match(/\\s/) && indenting) {\n indent++;\n } else {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n cue = new VTTCue(startTime, endTime, text.trim());\n\n if (indent >= 16) {\n indent--;\n } else {\n indent++;\n }\n\n // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n // also, drop line 1 since it's to close to the top\n if (navigator.userAgent.match(/Firefox\\//)) {\n cue.line = r + 1;\n } else {\n cue.line = r > 7 ? r - 2 : r + 1;\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{}],44:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\n\nvar EWMA = function () {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n function EWMA(halfLife) {\n _classCallCheck(this, EWMA);\n\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = 0;\n this.totalWeight_ = 0;\n }\n\n _createClass(EWMA, [{\n key: \"sample\",\n value: function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n }\n }, {\n key: \"getTotalWeight\",\n value: function getTotalWeight() {\n return this.totalWeight_;\n }\n }, {\n key: \"getEstimate\",\n value: function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n } else {\n return this.estimate_;\n }\n }\n }]);\n\n return EWMA;\n}();\n\nexports.default = EWMA;\n\n},{}],45:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction noop() {}\n\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nvar exportedLogger = fakeLogger;\n\n/*globals self: false */\n\n//let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction formatMsg(type, msg) {\n msg = '[' + type + '] > ' + msg;\n return msg;\n}\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args[0]) {\n args[0] = formatMsg(type, args[0]);\n }\n func.apply(self.console, args);\n };\n }\n return noop;\n}\n\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n functions[_key2 - 1] = arguments[_key2];\n }\n\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log();\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n};\n\nvar logger = exports.logger = exportedLogger;\n\n},{}],46:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = function () {\n function TimeRanges() {\n _classCallCheck(this, TimeRanges);\n }\n\n _createClass(TimeRanges, null, [{\n key: 'toString',\n value: function toString(r) {\n var log = '',\n len = r.length;\n for (var i = 0; i < len; i++) {\n log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n }\n return log;\n }\n }]);\n\n return TimeRanges;\n}();\n\nexports.default = TimeRanges;\n\n},{}],47:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * XHR based logger\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar XhrLoader = function () {\n function XhrLoader(config) {\n _classCallCheck(this, XhrLoader);\n\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n _createClass(XhrLoader, [{\n key: 'destroy',\n value: function destroy() {\n this.abort();\n this.loader = null;\n }\n }, {\n key: 'abort',\n value: function abort() {\n var loader = this.loader;\n if (loader && loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n\n window.clearTimeout(this.requestTimeout);\n this.requestTimeout = null;\n window.clearTimeout(this.retryTimeout);\n this.retryTimeout = null;\n }\n }, {\n key: 'load',\n value: function load(context, config, callbacks) {\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.stats = { trequest: performance.now(), retry: 0 };\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n }\n }, {\n key: 'loadInternal',\n value: function loadInternal() {\n var xhr,\n context = this.context;\n\n if (typeof XDomainRequest !== 'undefined') {\n xhr = this.loader = new XDomainRequest();\n } else {\n xhr = this.loader = new XMLHttpRequest();\n }\n\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n\n xhr.open('GET', context.url, true);\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.responseType = context.responseType;\n var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n if (this.xhrSetup) {\n this.xhrSetup(xhr, context.url);\n }\n // setup timeout before we perform request\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n xhr.send();\n }\n }, {\n key: 'readystatechange',\n value: function readystatechange(event) {\n var xhr = event.currentTarget,\n readyState = xhr.readyState,\n stats = this.stats,\n context = this.context,\n config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n if (status >= 200 && status < 300) {\n stats.tload = Math.max(stats.tfirst, performance.now());\n var data = void 0,\n len = void 0;\n if (context.responseType === 'arraybuffer') {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n var response = { url: xhr.responseURL, data: data };\n this.callbacks.onSuccess(response, stats, context);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _logger.logger.error(status + ' while loading ' + context.url);\n this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n } else {\n // retry\n _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n // aborts and resets internal state\n this.destroy();\n // schedule retry\n this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout() {\n _logger.logger.warn('timeout while loading ' + this.context.url);\n this.callbacks.onTimeout(this.stats, this.context);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // last args is to provide on progress data\n onProgress(stats, this.context, null);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"45\":45}]},{},[33])(33)\n});\n//# sourceMappingURL=hls.js.map\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Hls = __webpack_require__(0);\n\n/**\n * hls.js source handler\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = new Hls(options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n\n return function() {\n var now = Date.now();\n\n if (!_recoverDecodingErrorDate || (now - _recoverDecodingErrorDate) > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n }\n else if (!_recoverAudioCodecErrorDate || (now - _recoverAudioCodecErrorDate) > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function(e) {\n var mediaError = e.currentTarget.error;\n\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n *\n */\n this.dispose = function() {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function() {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(Hls.Events.LEVEL_LOADED, function(event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(Hls.Events.ERROR, function(event, data) {\n if (data.fatal) {\n switch (data.type) {\n case Hls.ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case Hls.ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n\n Object.keys(Hls.Events).forEach(function(key) {\n var eventName = Hls.Events[key];\n hls.on(eventName, function(event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\n\nvar hlsTypeRE = /^application\\/(x-mpegURL|vnd\\.apple\\.mpegURL)$/i;\nvar hlsExtRE = /\\.m3u8/i;\n\nvar HlsSourceHandler = {\n canHandleSource: function(source) {\n if (source.skipContribHlsJs) {\n return '';\n }\n else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n }\n else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n }\n else {\n return '';\n }\n },\n handleSource: function(source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function(type) {\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n }\n};\n\nif (Hls.isSupported()) {\n var videojs = __webpack_require__(1); // resolved UMD-wise through webpack\n\n if (videojs) {\n videojs.getComponent('Html5').registerSourceHandler(HlsSourceHandler, 0);\n }\n else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// videojs-contrib-hlsjs.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 40673ba98f65560086ba","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Hls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n},{}],2:[function(_dereq_,module,exports){\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var HASH_SPLIT = /^([^#]*)(.*)$/;\r\n var QUERY_SPLIT = /^([^\\?]*)(.*)$/;\r\n var DOMAIN_SPLIT = /^(([a-z]+:\\/\\/)?[^:\\/]+(?::[0-9]+)?)?(\\/?.*)$/i;\r\n\r\n var URLToolkit = {\r\n // build an absolute URL from a relative one using the provided baseURL\r\n // if relativeURL is an absolute URL it will be returned as is.\r\n buildAbsoluteURL: function(baseURL, relativeURL) {\r\n // remove any remaining space and CRLF\r\n relativeURL = relativeURL.trim();\r\n if (/^[a-z]+:/i.test(relativeURL)) {\r\n // complete url, not relative\r\n return relativeURL;\r\n }\r\n\r\n var relativeURLQuery = null;\r\n var relativeURLHash = null;\r\n\r\n var relativeURLHashSplit = HASH_SPLIT.exec(relativeURL);\r\n if (relativeURLHashSplit) {\r\n relativeURLHash = relativeURLHashSplit[2];\r\n relativeURL = relativeURLHashSplit[1];\r\n }\r\n var relativeURLQuerySplit = QUERY_SPLIT.exec(relativeURL);\r\n if (relativeURLQuerySplit) {\r\n relativeURLQuery = relativeURLQuerySplit[2];\r\n relativeURL = relativeURLQuerySplit[1];\r\n }\r\n\r\n var baseURLHashSplit = HASH_SPLIT.exec(baseURL);\r\n if (baseURLHashSplit) {\r\n baseURL = baseURLHashSplit[1];\r\n }\r\n var baseURLQuerySplit = QUERY_SPLIT.exec(baseURL);\r\n if (baseURLQuerySplit) {\r\n baseURL = baseURLQuerySplit[1];\r\n }\r\n\r\n var baseURLDomainSplit = DOMAIN_SPLIT.exec(baseURL);\r\n if (!baseURLDomainSplit) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n \r\n // e.g. 'http://', 'https://', ''\r\n var baseURLProtocol = baseURLDomainSplit[2] || '';\r\n // e.g. 'http://example.com', '//example.com', 'example.com', ''\r\n var baseURLProtocolDomain = baseURLDomainSplit[1] || '';\r\n // e.g. '/a/b/c/playlist.m3u8', 'a/b/c/playlist.m3u8'\r\n var baseURLPath = baseURLDomainSplit[3];\r\n if (baseURLPath.indexOf('/') !== 0 && baseURLProtocolDomain !== '') {\r\n // this handles a base url of http://example.com (missing last slash)\r\n baseURLPath = '/'+baseURLPath;\r\n }\r\n\r\n var builtURL = null;\r\n if (/^\\/\\//.test(relativeURL)) {\r\n // relative url starts wth '//' so copy protocol (which may be '' if baseUrl didn't provide one)\r\n builtURL = baseURLProtocol+URLToolkit.buildAbsolutePath('', relativeURL.substring(2));\r\n }\r\n else if (/^\\//.test(relativeURL)) {\r\n // relative url starts with '/' so start from root of domain\r\n builtURL = baseURLProtocolDomain+'/'+URLToolkit.buildAbsolutePath('', relativeURL.substring(1));\r\n }\r\n else {\r\n builtURL = URLToolkit.buildAbsolutePath(baseURLProtocolDomain+baseURLPath, relativeURL);\r\n }\r\n\r\n // put the query and hash parts back\r\n if (relativeURLQuery) {\r\n builtURL += relativeURLQuery;\r\n }\r\n if (relativeURLHash) {\r\n builtURL += relativeURLHash;\r\n }\r\n return builtURL;\r\n },\r\n\r\n // build an absolute path using the provided basePath\r\n // adapted from https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#Using_relative_URLs_in_the_path_parameter\r\n // this does not handle the case where relativePath is \"/\" or \"//\". These cases should be handled outside this.\r\n buildAbsolutePath: function(basePath, relativePath) {\r\n var sRelPath = relativePath;\r\n var nUpLn, sDir = '', sPath = basePath.replace(/[^\\/]*$/, sRelPath.replace(/(\\/|^)(?:\\.?\\/+)+/g, '$1'));\r\n for (var nEnd, nStart = 0; nEnd = sPath.indexOf('/../', nStart), nEnd > -1; nStart = nEnd + nUpLn) {\r\n nUpLn = /^\\/(?:\\.\\.\\/)*/.exec(sPath.slice(nEnd))[0].length;\r\n sDir = (sDir + sPath.substring(nStart, nEnd)).replace(new RegExp('(?:\\\\\\/+[^\\\\\\/]*){0,' + ((nUpLn - 1) / 3) + '}$'), '/');\r\n }\r\n return sDir + sPath.substr(nStart);\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[function(_dereq_,module,exports){\nvar bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn, options) {\n var wkey;\n var cacheKeys = Object.keys(cache);\n\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n var exp = cache[key].exports;\n // Using babel as a transpiler to use esmodule, the export will always\n // be an object with the default export as a property of it. To ensure\n // the existing api and babel esmodule exports are both supported we\n // check for both\n if (exp === fn || exp && exp.default === fn) {\n wkey = key;\n break;\n }\n }\n\n if (!wkey) {\n wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n var wcache = {};\n for (var i = 0, l = cacheKeys.length; i < l; i++) {\n var key = cacheKeys[i];\n wcache[key] = key;\n }\n sources[wkey] = [\n Function(['require','module','exports'], '(' + fn + ')(self)'),\n wcache\n ];\n }\n var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);\n\n var scache = {}; scache[wkey] = wkey;\n sources[skey] = [\n Function(['require'], (\n // try to call default if defined to also support babel esmodule\n // exports\n 'var f = require(' + stringify(wkey) + ');' +\n '(f.default ? f.default : f)(self);'\n )),\n scache\n ];\n\n var workerSources = {};\n resolveSources(skey);\n\n function resolveSources(key) {\n workerSources[key] = true;\n\n for (var depPath in sources[key][1]) {\n var depKey = sources[key][1][depPath];\n if (!workerSources[depKey]) {\n resolveSources(depKey);\n }\n }\n }\n\n var src = '(' + bundleFn + ')({'\n + Object.keys(workerSources).map(function (key) {\n return stringify(key) + ':['\n + sources[key][0]\n + ',' + stringify(sources[key][1]) + ']'\n ;\n }).join(',')\n + '},{},[' + stringify(skey) + '])'\n ;\n\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n var blob = new Blob([src], { type: 'text/javascript' });\n if (options && options.bare) { return blob; }\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n};\n\n},{}],4:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nvar _ewmaBandwidthEstimator = _dereq_(9);\n\nvar _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * simple ABR Controller\n * - compute next level based on last fragment bw heuristics\n * - implement an abandon rules triggered if we have less than 2 frag buffered and if computed bw shows that we risk buffer stalling\n */\n\nvar AbrController = function (_EventHandler) {\n _inherits(AbrController, _EventHandler);\n\n function AbrController(hls) {\n _classCallCheck(this, AbrController);\n\n var _this = _possibleConstructorReturn(this, (AbrController.__proto__ || Object.getPrototypeOf(AbrController)).call(this, hls, _events2.default.FRAG_LOADING, _events2.default.FRAG_LOADED, _events2.default.FRAG_BUFFERED, _events2.default.ERROR));\n\n _this.lastLoadedFragLevel = 0;\n _this._autoLevelCapping = -1;\n _this._nextAutoLevel = -1;\n _this.hls = hls;\n _this.onCheck = _this.abandonRulesCheck.bind(_this);\n return _this;\n }\n\n _createClass(AbrController, [{\n key: 'destroy',\n value: function destroy() {\n this.clearTimer();\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag;\n if (frag.type === 'main') {\n if (!this.timer) {\n this.timer = setInterval(this.onCheck, 100);\n }\n // lazy init of bw Estimator, rationale is that we use different params for Live/VoD\n // so we need to wait for stream manifest / playlist type to instantiate it.\n if (!this.bwEstimator) {\n var hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast = void 0,\n ewmaSlow = void 0;\n\n if (isLive) {\n ewmaFast = config.abrEwmaFastLive;\n ewmaSlow = config.abrEwmaSlowLive;\n } else {\n ewmaFast = config.abrEwmaFastVoD;\n ewmaSlow = config.abrEwmaSlowVoD;\n }\n this.bwEstimator = new _ewmaBandwidthEstimator2.default(hls, ewmaSlow, ewmaFast, config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n }, {\n key: 'abandonRulesCheck',\n value: function abandonRulesCheck() {\n /*\n monitor fragment retrieval time...\n we compute expected time of arrival of the complete fragment.\n we compare it to expected time of buffer starvation\n */\n var hls = this.hls,\n v = hls.media,\n frag = this.fragCurrent,\n loader = frag.loader,\n minAutoLevel = this.minAutoLevel;\n\n // if loader has been destroyed or loading has been aborted, stop timer and return\n if (!loader || loader.stats && loader.stats.aborted) {\n _logger.logger.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n var stats = loader.stats;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded(ready state === HAVE_NOTHING = 0)) AND autoswitching enabled AND not lowest level (=> means that we have several levels) */\n if (v && (!v.paused && v.playbackRate !== 0 || !v.readyState) && frag.autoLevel && frag.level) {\n var requestDelay = performance.now() - stats.trequest,\n playbackRate = Math.abs(v.playbackRate);\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > 500 * frag.duration / playbackRate) {\n var levels = hls.levels,\n loadRate = Math.max(1, stats.bw ? stats.bw / 8 : stats.loaded * 1000 / requestDelay),\n // byte/s; at least 1 byte/s to avoid division by zero\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, hls.config.maxBufferHole).end - pos) / playbackRate;\n // consider emergency switch down only if we have less than 2 frag buffered AND\n // time to finish loading current fragment is bigger than buffer starvation delay\n // ie if we risk buffer starvation if bw does not increase quickly\n if (bufferStarvationDelay < 2 * frag.duration / playbackRate && fragLoadedDelay > bufferStarvationDelay) {\n var fragLevelNextLoadedDelay = void 0,\n nextLoadLevel = void 0;\n // lets iterate through lower level and try to find the biggest one that could avoid rebuffering\n // we start from current level - 1 and we step down , until we find a matching level\n for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (8 * 0.8 * loadRate);\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n // we found a lower level that be rebuffering free with current estimated bw !\n break;\n }\n }\n // only emergency switch down if it takes less time to load new fragment at lowest level instead\n // of finishing loading current one ...\n if (fragLevelNextLoadedDelay < fragLoadedDelay) {\n _logger.logger.warn('loading too slow, abort fragment loading and switch to level ' + nextLoadLevel + ':fragLoadedDelay[' + nextLoadLevel + ']= minAutoLevel; i--) {\n var levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n _logger.logger.trace('level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: ' + i + '/' + Math.round(adjustedbw) + '/' + bitrate + '/' + avgDuration + '/' + maxFetchDuration + '/' + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...\n !fetchDuration || live || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var nextAutoLevel = this._nextAutoLevel,\n bwEstimator = this.bwEstimator,\n hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate;\n // in case next auto level has been forced, and bw not available or not reliable\n if (nextAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n // cap next auto level by max auto level\n return Math.min(nextAutoLevel, this.maxAutoLevel);\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this.nextABRAutoLevel;\n if (nextAutoLevel !== -1) {\n // nextAutoLevel is defined, use it to cap ABR computed quality level\n nextABRAutoLevel = Math.min(nextAutoLevel, nextABRAutoLevel);\n }\n if (minAutoBitrate !== undefined) {\n var levelNextBitrate = levels[nextABRAutoLevel].realBitrate ? Math.max(levels[nextABRAutoLevel].realBitrate, levels[nextABRAutoLevel].bitrate) : levels[nextABRAutoLevel].bitrate;\n while (levelNextBitrate < minAutoBitrate) {\n nextABRAutoLevel++;\n }\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this.hls,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var levels = this.hls.levels,\n autoLevelCapping = this._autoLevelCapping,\n maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n }, {\n key: 'nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = this.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = this.minAutoLevel;\n var v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = v ? v.currentTime : 0,\n\n // playbackRate is the absolute value of the playback rate; if v.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n playbackRate = v && v.playbackRate !== 0 ? Math.abs(v.playbackRate) : 1.0,\n avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate,\n\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (_bufferHelper2.default.bufferInfo(v, pos, config.maxBufferHole).end - pos) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor, levels);\n if (bestLevel >= 0) {\n return bestLevel;\n } else {\n _logger.logger.trace('rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering');\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay,\n bwFactor = config.abrBandWidthFactor,\n bwUpFactor = config.abrBandWidthUpFactor;\n if (bufferStarvationDelay === 0) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n _logger.logger.trace('bitrate test took ' + Math.round(1000 * bitrateTestDelay) + 'ms, set first fragment max fetchDuration to ' + Math.round(1000 * maxStarvationDelay) + ' ms');\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(currentLevel, currentFragDuration, avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor, levels);\n return Math.max(bestLevel, 0);\n }\n }\n }]);\n\n return AbrController;\n}(_eventHandler2.default);\n\nexports.default = AbrController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45,\"9\":9}],5:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Audio Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n STARTING: 'STARTING',\n IDLE: 'IDLE',\n PAUSED: 'PAUSED',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\n};\n\nvar AudioStreamController = function (_EventHandler) {\n _inherits(AudioStreamController, _EventHandler);\n\n function AudioStreamController(hls) {\n _classCallCheck(this, AudioStreamController);\n\n var _this = _possibleConstructorReturn(this, (AudioStreamController.__proto__ || Object.getPrototypeOf(AudioStreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.AUDIO_TRACKS_UPDATED, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED, _events2.default.INIT_PTS_FOUND));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\n return _this;\n }\n\n _createClass(AudioStreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n _logger.logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = this.startPosition ? this.startPosition : startPosition;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n this.startPosition = startPosition;\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n var _this2 = this;\n\n var pos,\n track,\n trackDetails,\n hls = this.hls,\n config = hls.config;\n //logger.log('audioStream:' + this.state);\n var now;\n var retryDate;\n var isSeeking;\n\n var _ret = function () {\n switch (_this2.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n case State.PAUSED:\n //don't do anything in paused state either ...\n case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n _this2.state = State.WAITING_TRACK;\n _this2.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = _this2.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\n }\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (!_this2.media && (_this2.startFragRequested || !config.startFragPrefetch)) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // if we have not yet loaded any fragment, start loading from start position\n if (_this2.loadedmetadata) {\n pos = _this2.media.currentTime;\n } else {\n pos = _this2.nextLoadPosition;\n }\n var media = _this2.mediaBuffer ? _this2.mediaBuffer : _this2.media,\n bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = _this2.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = _this2.audioSwitch,\n trackId = _this2.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen && trackId < tracks.length) {\n trackDetails = tracks[trackId].details;\n // if track info not retrieved yet, switch state and wait for track retrieval\n if (typeof trackDetails === 'undefined') {\n _this2.state = State.WAITING_TRACK;\n break;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n if (!audioSwitch && !trackDetails.live && fragPrevious && fragPrevious.sn === trackDetails.endSN) {\n // if we are not seeking or if we are seeking but everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference when switching\n // between different renditions. using half frag duration should help cope with these cases.\n if (!_this2.media.seeking || _this2.media.duration - bufferEnd < fragPrevious.duration / 2) {\n // Finalize the media stream\n _this2.hls.trigger(_events2.default.BUFFER_EOS, { type: 'audio' });\n _this2.state = State.ENDED;\n break;\n }\n }\n\n // find fragment index, contiguous with end of buffer position\n var fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n frag = void 0;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n _this2.media.currentTime = start + 0.05;\n } else {\n return {\n v: void 0\n };\n }\n }\n }\n }\n\n // if bufferEnd before start of playlist, load first fragment\n if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === _this2.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + _this2.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n _this2.media.currentTime = nextBuffered + 0.05;\n return {\n v: void 0\n };\n }\n } else {\n (function () {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - maxFragLookUpTolerance > bufferEnd) {\n return -1;\n }\n return 0;\n });\n if (!foundFrag) {\n _logger.logger.log('frag not found @bufferEnd/start:' + bufferEnd + '/' + start);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < trackDetails.endSN) {\n frag = fragments[frag.sn + 1 - trackDetails.startSN];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n } else {\n frag = null;\n }\n }\n }\n })();\n }\n if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId);\n _this2.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + trackId + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (_this2.fragLoadIdx !== undefined) {\n _this2.fragLoadIdx++;\n } else {\n _this2.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(_this2.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return {\n v: void 0\n };\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = _this2.fragLoadIdx;\n _this2.fragCurrent = frag;\n _this2.startFragRequested = true;\n _this2.nextLoadPosition = frag.start + frag.duration;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n _this2.state = State.FRAG_LOADING;\n }\n }\n }\n break;\n case State.WAITING_TRACK:\n track = _this2.tracks[_this2.trackId];\n // check if playlist is already loaded\n if (track && track.details) {\n _this2.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n now = performance.now();\n retryDate = _this2.retryDate;\n\n media = _this2.media;\n isSeeking = media && media.seeking;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n\n if (!retryDate || now >= retryDate || isSeeking) {\n _logger.logger.log('audioStreamController: retryDate reached, switch back to IDLE state');\n _this2.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var tracks = this.tracks;\n if (tracks) {\n // reset fragment load counter\n tracks.forEach(function (track) {\n if (track.details) {\n track.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (this.media) {\n this.lastCurrentTime = this.media.currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onAudioTracksUpdated',\n value: function onAudioTracksUpdated(data) {\n _logger.logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url;\n this.trackId = data.id;\n this.state = State.IDLE;\n\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment = null;\n // destroy useless demuxer when switching audio to main\n if (!altAudio) {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n } else {\n // switching to audio track, start timer if not already started\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n }\n\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\n\n // compute start position\n if (!this.startFragRequested) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n this.startPosition = 0;\n }\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for track to start downloading a new fragment\n if (this.state === State.WAITING_TRACK) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.FRAG_LOADING && fragCurrent && data.frag.type === 'audio' && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec;\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n if (initPTS !== undefined) {\n this.pendingBuffering = true;\n _logger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, audioCodec, null, start, cc, trackId, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, initPTS);\n } else {\n _logger.logger.log('unknown video PTS for continuity counter ' + cc + ', waiting for video PTS before demuxing audio frag ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],track ' + trackId);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = 'mp4a.40.2';\n track.id = data.id;\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n _logger.logger.log('audio track:audio,container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this3 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n (function () {\n var trackId = _this3.trackId,\n track = _this3.tracks[trackId],\n frag = _this3.fragCurrent,\n hls = _this3.hls;\n\n _logger.logger.log('parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb);\n _levelHelper2.default.updateFragPTSDTS(track.details, frag.sn, data.startPTS, data.endPTS);\n\n var audioSwitch = _this3.audioSwitch,\n media = _this3.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n _this3.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n _this3.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = _this3.pendingData;\n if (!_this3.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // arm pending Buffering flag before appending a segment\n _this3.pendingBuffering = true;\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n _this3.pendingData = [];\n _this3.appended = true;\n }\n }\n //trigger handler right now\n _this3.tick();\n })();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'audio' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'audio') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'audio' });\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('audio buffered : ' + _timeRanges2.default.toString(media.buffered));\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to audio fragment\n if (frag && frag.type !== 'audio') {\n return;\n }\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n if (loadError <= config.fragLoadingMaxRetry) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('audioStreamController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('audioStreamController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n // when in ERROR state, don't switch back to IDLE state in case a non-fatal error is received\n if (this.state !== State.ERROR) {\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n this.state = data.fatal ? State.ERROR : State.IDLE;\n _logger.logger.warn('audioStreamController: ' + data.details + ' while loading frag,switch to ' + this.state + ' state ...');\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this4 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this4.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n this.tick();\n }\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],6:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * audio track controller\n */\n\nvar AudioTrackController = function (_EventHandler) {\n _inherits(AudioTrackController, _EventHandler);\n\n function AudioTrackController(hls) {\n _classCallCheck(this, AudioTrackController);\n\n var _this = _possibleConstructorReturn(this, (AudioTrackController.__proto__ || Object.getPrototypeOf(AudioTrackController)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_LOADED, _events2.default.AUDIO_TRACK_LOADED));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n this.updateTrack(this.trackId);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.audioTracks || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(_events2.default.AUDIO_TRACKS_UPDATED, { audioTracks: tracks });\n // loop through available audio tracks and autoselect default if needed\n var id = 0;\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n _logger.logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n _logger.logger.log('audioTrack ' + data.id + ' loaded');\n this.tracks[data.id].details = data.details;\n // check if current playlist is a live playlist\n if (data.details.live && !this.timer) {\n // if live playlist we will have to reload it periodically\n // set reload period to playlist target duration\n this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);\n }\n if (!data.details.live && this.timer) {\n // playlist is not live and timer is armed : stopping it\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'setAudioTrackInternal',\n value: function setAudioTrackInternal(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('switching to audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(newId) {\n // check if level idx is valid\n if (newId >= 0 && newId < this.tracks.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this.trackId = newId;\n _logger.logger.log('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n var details = audioTrack.details;\n if (url && (details === undefined || details.live === true)) {\n // track not retrieved yet, or live playlist we need to (re)load it\n _logger.logger.log('(re)loading playlist for audioTrack ' + newId);\n this.hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n }]);\n\n return AudioTrackController;\n}(_eventHandler2.default);\n\nexports.default = AudioTrackController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],7:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Buffer Controller\n */\n\nvar BufferController = function (_EventHandler) {\n _inherits(BufferController, _EventHandler);\n\n function BufferController(hls) {\n _classCallCheck(this, BufferController);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\n var _this = _possibleConstructorReturn(this, (BufferController.__proto__ || Object.getPrototypeOf(BufferController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_PARSED, _events2.default.BUFFER_RESET, _events2.default.BUFFER_APPENDING, _events2.default.BUFFER_CODECS, _events2.default.BUFFER_EOS, _events2.default.BUFFER_FLUSHING, _events2.default.LEVEL_PTS_UPDATED, _events2.default.LEVEL_UPDATED));\n\n _this._msDuration = null;\n // the value that we want to set mediaSource.duration to\n _this._levelDuration = null;\n\n // Source Buffer listeners\n _this.onsbue = _this.onSBUpdateEnd.bind(_this);\n _this.onsbe = _this.onSBUpdateError.bind(_this);\n _this.pendingTracks = {};\n _this.tracks = {};\n return _this;\n }\n\n _createClass(BufferController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos). At the time of change we issue\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/dailymotion/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var audioExpected = data.audio,\n videoExpected = data.video,\n sourceBufferNb = 0;\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n if (data.altAudio && (audioExpected || videoExpected)) {\n sourceBufferNb = (audioExpected ? 1 : 0) + (videoExpected ? 1 : 0);\n _logger.logger.log(sourceBufferNb + ' sourceBuffer(s) expected');\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var media = this.media = data.media;\n if (media) {\n // setup the media source\n var ms = this.mediaSource = new MediaSource();\n //Media Source listeners\n this.onmso = this.onMediaSourceOpen.bind(this);\n this.onmse = this.onMediaSourceEnded.bind(this);\n this.onmsc = this.onMediaSourceClose.bind(this);\n ms.addEventListener('sourceopen', this.onmso);\n ms.addEventListener('sourceended', this.onmse);\n ms.addEventListener('sourceclose', this.onmsc);\n // link video and media Source\n media.src = URL.createObjectURL(ms);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n _logger.logger.log('media source detaching');\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n ms.endOfStream();\n } catch (err) {\n _logger.logger.warn('onMediaDetaching:' + err.message + ' while calling endOfStream');\n }\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (this.media) {\n URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n this.onmso = this.onmse = this.onmsc = null;\n this.hls.trigger(_events2.default.MEDIA_DETACHED);\n }\n }, {\n key: 'onMediaSourceOpen',\n value: function onMediaSourceOpen() {\n _logger.logger.log('media source opened');\n this.hls.trigger(_events2.default.MEDIA_ATTACHED, { media: this.media });\n var mediaSource = this.mediaSource;\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n this.checkPendingTracks();\n }\n }, {\n key: 'checkPendingTracks',\n value: function checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n var pendingTracks = this.pendingTracks,\n pendingTracksNb = Object.keys(pendingTracks).length;\n // if any pending tracks and (if nb of pending tracks gt or equal than expected nb or if unknown expected nb)\n if (pendingTracksNb && (this.sourceBufferNb <= pendingTracksNb || this.sourceBufferNb === 0)) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n this.doAppending();\n }\n }\n }, {\n key: 'onMediaSourceClose',\n value: function onMediaSourceClose() {\n _logger.logger.log('media source closed');\n }\n }, {\n key: 'onMediaSourceEnded',\n value: function onMediaSourceEnded() {\n _logger.logger.log('media source ended');\n }\n }, {\n key: 'onSBUpdateEnd',\n value: function onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n }, {\n key: 'onSBUpdateError',\n value: function onSBUpdateError(event) {\n _logger.logger.error('sourceBuffer error:' + event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false });\n // we don't need to do more than that, as accordin to the spec, updateend will be fired just after\n }\n }, {\n key: 'onBufferReset',\n value: function onBufferReset() {\n var sourceBuffer = this.sourceBuffer;\n for (var type in sourceBuffer) {\n var sb = sourceBuffer[type];\n try {\n this.mediaSource.removeSourceBuffer(sb);\n sb.removeEventListener('updateend', this.onsbue);\n sb.removeEventListener('error', this.onsbe);\n } catch (err) {}\n }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n }, {\n key: 'onBufferCodecs',\n value: function onBufferCodecs(tracks) {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n // if sourcebuffers already created, do nothing ...\n if (Object.keys(this.sourceBuffer).length === 0) {\n for (var trackName in tracks) {\n this.pendingTracks[trackName] = tracks[trackName];\n }\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n // try to create sourcebuffers if mediasource opened\n this.checkPendingTracks();\n }\n }\n }\n }, {\n key: 'createSourceBuffers',\n value: function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + ';codecs=' + codec;\n _logger.logger.log('creating sourceBuffer(' + mimeType + ')');\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = { codec: codec, container: track.container };\n track.buffer = sb;\n } catch (err) {\n _logger.logger.error('error while trying to add sourceBuffer:' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType: mimeType });\n }\n }\n }\n this.hls.trigger(_events2.default.BUFFER_CREATED, { tracks: tracks });\n }\n }, {\n key: 'onBufferAppending',\n value: function onBufferAppending(data) {\n if (!this._needsFlush) {\n if (!this.segments) {\n this.segments = [data];\n } else {\n this.segments.push(data);\n }\n this.doAppending();\n }\n }\n }, {\n key: 'onBufferAppendFail',\n value: function onBufferAppendFail(data) {\n _logger.logger.error('sourceBuffer error:', data.event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // this error might not always be fatal (it is fatal if decode error is set, in that case\n // it will be followed by a mediaElement error ...)\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false, frag: this.fragCurrent });\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n\n }, {\n key: 'onBufferEos',\n value: function onBufferEos(data) {\n var sb = this.sourceBuffer;\n var dataType = data.type;\n for (var type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n _logger.logger.log(type + ' sourceBuffer now EOS');\n }\n }\n }\n this.checkEos();\n }\n\n // if all source buffers are marked as ended, signal endOfStream() to MediaSource.\n\n }, {\n key: 'checkEos',\n value: function checkEos() {\n var sb = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for (var type in sb) {\n var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n _logger.logger.log('all media data available, signal endOfStream() to MediaSource and stop loading fragment');\n //Notify the media element that it now has all of the media data\n try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n }, {\n key: 'onBufferFlushing',\n value: function onBufferFlushing(data) {\n this.flushRange.push({ start: data.startOffset, end: data.endOffset, type: data.type });\n // attempt flush immediatly\n this.flushBufferCounter = 0;\n this.doFlush();\n }\n }, {\n key: 'onLevelUpdated',\n value: function onLevelUpdated(event) {\n var details = event.details;\n if (details.fragments.length === 0) {\n return;\n }\n this._levelDuration = details.totalduration + details.fragments[0].start;\n this.updateMediaElementDuration();\n }\n\n // https://github.com/dailymotion/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (var type in sourceBuffer) {\n if (sourceBuffer[type].updating) {\n // can't set duration whilst a buffer is updating\n return;\n }\n }\n if (this._msDuration === null) {\n // initialise to the value that the media source is reporting\n this._msDuration = mediaSource.duration;\n }\n var duration = media.duration;\n // levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update mediasource duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n }, {\n key: 'doFlush',\n value: function doFlush() {\n // loop through all buffer ranges to flush\n while (this.flushRange.length) {\n var range = this.flushRange[0];\n // flushBuffer will abort any buffer append in progress and flush Audio/Video Buffer\n if (this.flushBuffer(range.start, range.end, range.type)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n this.flushBufferCounter = 0;\n } else {\n this._needsFlush = true;\n // avoid looping, wait for SB update end to retrigger a flush\n return;\n }\n }\n if (this.flushRange.length === 0) {\n // everything flushed\n this._needsFlush = false;\n\n // let's recompute this.appended, which is used to avoid flush looping\n var appended = 0;\n var sourceBuffer = this.sourceBuffer;\n try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(_events2.default.BUFFER_FLUSHED);\n }\n }\n }, {\n key: 'doAppending',\n value: function doAppending() {\n var hls = this.hls,\n sourceBuffer = this.sourceBuffer,\n segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n _logger.logger.error('trying to append although a media error occured, flush segment and abort');\n return;\n }\n if (this.appending) {\n //logger.log(`sb appending in progress`);\n return;\n }\n if (segments && segments.length) {\n var segment = segments.shift();\n try {\n var type = segment.type,\n sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\n } else {\n // in case we don't have any source buffer matching with this segment type,\n // it means that Mediasource fails to create sourcebuffer\n // discard this segment, and trigger update end\n this.onSBUpdateEnd();\n }\n } catch (err) {\n // in case any error occured while appending, put back segment in segments table\n _logger.logger.error('error while trying to append buffer:' + err.message);\n segments.unshift(segment);\n var event = { type: _errors.ErrorTypes.MEDIA_ERROR };\n if (err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = _errors.ErrorDetails.BUFFER_APPEND_ERROR;\n event.frag = this.fragCurrent;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. retrying help recovering this\n */\n if (this.appendError > hls.config.appendErrorMaxRetry) {\n _logger.logger.log('fail ' + hls.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer');\n segments = [];\n event.fatal = true;\n hls.trigger(_events2.default.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n }\n } else {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n this.segments = [];\n event.details = _errors.ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(_events2.default.ERROR, event);\n return;\n }\n }\n }\n }\n }\n\n /*\n flush specified buffered range,\n return true once range has been flushed.\n as sourceBuffer.remove() is asynchronous, flushBuffer will be retriggered on sourceBuffer update end\n */\n\n }, {\n key: 'flushBuffer',\n value: function flushBuffer(startOffset, endOffset, typeIn) {\n var sb,\n i,\n bufStart,\n bufEnd,\n flushStart,\n flushEnd,\n sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n _logger.logger.log('flushBuffer,pos/start/end: ' + this.media.currentTime.toFixed(3) + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping : don't try to flush more than the nb of appended segments\n if (this.flushBufferCounter < this.appended) {\n for (var type in sourceBuffer) {\n // check if sourcebuffer type is defined (typeIn): if yes, let's only flush this one\n // if no, let's flush all sourcebuffers\n if (typeIn && type !== typeIn) {\n continue;\n }\n sb = sourceBuffer[type];\n // we are going to flush buffer, mark source buffer as 'not ended'\n sb.ended = false;\n if (!sb.updating) {\n try {\n for (i = 0; i < sb.buffered.length; i++) {\n bufStart = sb.buffered.start(i);\n bufEnd = sb.buffered.end(i);\n // workaround firefox not able to properly flush multiple buffered range.\n if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && endOffset === Number.POSITIVE_INFINITY) {\n flushStart = startOffset;\n flushEnd = endOffset;\n } else {\n flushStart = Math.max(bufStart, startOffset);\n flushEnd = Math.min(bufEnd, endOffset);\n }\n /* sometimes sourcebuffer.remove() does not flush\n the exact expected time range.\n to avoid rounding issues/infinite loop,\n only flush buffer range of length greater than 500ms.\n */\n if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {\n this.flushBufferCounter++;\n _logger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n _logger.logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n _logger.logger.warn('abort flushing too many retries');\n }\n _logger.logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n }]);\n\n return BufferController;\n}(_eventHandler2.default);\n\nexports.default = BufferController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],8:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * cap stream level to media size dimension controller\n */\n\nvar CapLevelController = function (_EventHandler) {\n _inherits(CapLevelController, _EventHandler);\n\n function CapLevelController(hls) {\n _classCallCheck(this, CapLevelController);\n\n return _possibleConstructorReturn(this, (CapLevelController.__proto__ || Object.getPrototypeOf(CapLevelController)).call(this, hls, _events2.default.FPS_DROP_LEVEL_CAPPING, _events2.default.MEDIA_ATTACHING, _events2.default.MANIFEST_PARSED));\n }\n\n _createClass(CapLevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.hls.config.capLevelToPlayerSize) {\n this.media = this.restrictedLevels = null;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n this.timer = clearInterval(this.timer);\n }\n }\n }\n }, {\n key: 'onFpsDropLevelCapping',\n value: function onFpsDropLevelCapping(data) {\n if (!this.restrictedLevels) {\n this.restrictedLevels = [];\n }\n if (!this.isLevelRestricted(data.droppedLevel)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n hls.firstLevel = this.getMaxLevel(data.firstLevel);\n clearInterval(this.timer);\n this.timer = setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n }\n }\n }, {\n key: 'detectPlayerSize',\n value: function detectPlayerSize() {\n if (this.media) {\n var levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (hls.autoLevelCapping > this.autoLevelCapping) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */\n\n }, {\n key: 'getMaxLevel',\n value: function getMaxLevel(capLevelIndex) {\n var result = 0,\n i = void 0,\n level = void 0,\n mWidth = this.mediaWidth,\n mHeight = this.mediaHeight,\n lWidth = 0,\n lHeight = 0;\n\n for (i = 0; i <= capLevelIndex; i++) {\n level = this.levels[i];\n if (this.isLevelRestricted(i)) {\n break;\n }\n result = i;\n lWidth = level.width;\n lHeight = level.height;\n if (mWidth <= lWidth || mHeight <= lHeight) {\n break;\n }\n }\n return result;\n }\n }, {\n key: 'isLevelRestricted',\n value: function isLevelRestricted(level) {\n return this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1 ? true : false;\n }\n }, {\n key: 'contentScaleFactor',\n get: function get() {\n var pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch (e) {}\n return pixelRatio;\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n }]);\n\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"27\":27,\"28\":28}],9:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\nvar _ewma = _dereq_(44);\n\nvar _ewma2 = _interopRequireDefault(_ewma);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EwmaBandWidthEstimator = function () {\n function EwmaBandWidthEstimator(hls, slow, fast, defaultEstimate) {\n _classCallCheck(this, EwmaBandWidthEstimator);\n\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _ewma2.default(slow);\n this.fast_ = new _ewma2.default(fast);\n }\n\n _createClass(EwmaBandWidthEstimator, [{\n key: 'sample',\n value: function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000 * numBytes / durationMs,\n\n //console.log('instant bw:'+ Math.round(bandwidth));\n // we weight sample using loading duration....\n weight = durationMs / 1000;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n }\n }, {\n key: 'canEstimate',\n value: function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n }\n }, {\n key: 'getEstimate',\n value: function getEstimate() {\n if (this.canEstimate()) {\n //console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n //console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }]);\n\n return EwmaBandWidthEstimator;\n}();\n\nexports.default = EwmaBandWidthEstimator;\n\n},{\"44\":44}],10:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * FPS Controller\n */\n\nvar FPSController = function (_EventHandler) {\n _inherits(FPSController, _EventHandler);\n\n function FPSController(hls) {\n _classCallCheck(this, FPSController);\n\n return _possibleConstructorReturn(this, (FPSController.__proto__ || Object.getPrototypeOf(FPSController)).call(this, hls, _events2.default.MEDIA_ATTACHING));\n }\n\n _createClass(FPSController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n }, {\n key: 'checkFPS',\n value: function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(_events2.default.FPS_DROP, { currentDropped: currentDropped, currentDecoded: currentDecoded, totalDroppedFrames: droppedFrames });\n if (droppedFPS > 0) {\n //logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n }, {\n key: 'checkFPSInterval',\n value: function checkFPSInterval() {\n var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"27\":27,\"28\":28,\"45\":45}],11:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Level Controller\n */\n\nvar LevelController = function (_EventHandler) {\n _inherits(LevelController, _EventHandler);\n\n function LevelController(hls) {\n _classCallCheck(this, LevelController);\n\n var _this = _possibleConstructorReturn(this, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = _this._autoLevelCapping = -1;\n return _this;\n }\n\n _createClass(LevelController, [{\n key: 'destroy',\n value: function destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n this.canload = true;\n var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n this.canload = false;\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if (level.audioCodec || level.attrs && level.attrs.AUDIO) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels0.length;\n level.url = [level.url];\n level.urlId = 0;\n levels0.push(level);\n } else {\n levels0[redundantLevelId].url.push(level.url);\n }\n });\n\n // remove audio-only level if we also have levels with audio+video codecs signalled\n if (videoCodecFound && audioCodecFound) {\n levels0.forEach(function (level) {\n if (level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', videoCodec));\n });\n\n if (levels.length) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort level on bitrate\n levels.sort(function (a, b) {\n return a.bitrate - b.bitrate;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n _logger.logger.log('manifest loaded,' + levels.length + ' level(s) found, first bitrate:' + bitrateStart);\n break;\n }\n }\n hls.trigger(_events2.default.MANIFEST_PARSED, { levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio: audioCodecFound, video: videoCodecFound, altAudio: data.audioTracks.length > 0 });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: true, url: hls.url, reason: 'no level with compatible codecs found in manifest' });\n }\n return;\n }\n }, {\n key: 'setLevelInternal',\n value: function setLevelInternal(newLevel) {\n var levels = this._levels;\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n if (this._level !== newLevel) {\n _logger.logger.log('switching to level ' + newLevel);\n this._level = newLevel;\n this.hls.trigger(_events2.default.LEVEL_SWITCH, { level: newLevel });\n }\n var level = levels[newLevel],\n levelDetails = level.details;\n // check if we need to load playlist for this level\n if (!levelDetails || levelDetails.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: newLevel, id: urlId });\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx' });\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n if (data.fatal) {\n return;\n }\n\n var details = data.details,\n hls = this.hls,\n levelId = void 0,\n level = void 0,\n levelError = false,\n abrController = hls.abrController,\n minAutoLevel = abrController.minAutoLevel;\n // try to recover not fatal errors\n switch (details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\n break;\n default:\n break;\n }\n /* try to switch to a redundant stream if any available.\n * if no redundant stream available, emergency switch down (if in auto mode and current level not 0)\n * otherwise, we cannot recover this network error ...\n */\n if (levelId !== undefined) {\n level = this._levels[levelId];\n if (!level.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n _logger.logger.warn('level controller,' + details + ' for level ' + levelId + ': switching to redundant stream id ' + level.urlId);\n } else {\n // we could try to recover if in auto mode and current level not lowest level (0)\n var recoverable = this._manualLevel === -1 && levelId;\n if (recoverable) {\n _logger.logger.warn('level controller,' + details + ': switch-down for next fragment');\n abrController.nextAutoLevel = Math.max(minAutoLevel, levelId - 1);\n } else if (level && level.details && level.details.live) {\n _logger.logger.warn('level controller,' + details + ' on live stream, discard');\n if (levelError) {\n // reset this._level so that another call to set level() will retrigger a frag load\n this._level = undefined;\n }\n // other errors are handled by stream controller\n } else if (details === _errors.ErrorDetails.LEVEL_LOAD_ERROR || details === _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n var media = hls.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n if (mediaBuffered) {\n var retryDelay = hls.config.levelLoadingRetryDelay;\n _logger.logger.warn('level controller,' + details + ', but media buffered, retry in ' + retryDelay + 'ms');\n this.timer = setTimeout(this.ontick, retryDelay);\n } else {\n _logger.logger.error('cannot recover ' + details + ' error');\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n hls.trigger(_events2.default.ERROR, data);\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n var newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n var reloadInterval = 1000 * (newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\n curDetails = curLevel.details;\n if (curDetails && newDetails.endSN === curDetails.endSN) {\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n _logger.logger.log('same live playlist, reload twice faster');\n }\n // decrement reloadInterval with level loading delay\n reloadInterval -= performance.now() - data.stats.trequest;\n // in any case, don't reload more than every second\n reloadInterval = Math.max(1000, Math.round(reloadInterval));\n _logger.logger.log('live playlist, reload in ' + reloadInterval + ' ms');\n this.timer = setTimeout(this.ontick, reloadInterval);\n } else {\n this.timer = null;\n }\n }\n }\n }, {\n key: 'tick',\n value: function tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId],\n urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\n }\n }, {\n key: 'levels',\n get: function get() {\n return this._levels;\n }\n }, {\n key: 'level',\n get: function get() {\n return this._level;\n },\n set: function set(newLevel) {\n var levels = this._levels;\n if (levels && levels.length > newLevel) {\n if (this._level !== newLevel || levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n }\n }, {\n key: 'manualLevel',\n get: function get() {\n return this._manualLevel;\n },\n set: function set(newLevel) {\n this._manualLevel = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: 'firstLevel',\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: 'startLevel',\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n // if not in autostart level, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, this.hls.abrController.minAutoLevel);\n }\n this._startLevel = newLevel;\n }\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.abrController.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"45\":45}],12:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _binarySearch = _dereq_(41);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(30);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(22);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(31);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(46);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Stream Controller\n */\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_LEVEL: 'WAITING_LEVEL',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR'\n};\n\nvar StreamController = function (_EventHandler) {\n _inherits(StreamController, _EventHandler);\n\n function StreamController(hls) {\n _classCallCheck(this, StreamController);\n\n var _this = _possibleConstructorReturn(this, (StreamController.__proto__ || Object.getPrototypeOf(StreamController)).call(this, hls, _events2.default.MEDIA_ATTACHED, _events2.default.MEDIA_DETACHING, _events2.default.MANIFEST_LOADING, _events2.default.MANIFEST_PARSED, _events2.default.LEVEL_LOADED, _events2.default.KEY_LOADED, _events2.default.FRAG_LOADED, _events2.default.FRAG_LOAD_EMERGENCY_ABORTED, _events2.default.FRAG_PARSING_INIT_SEGMENT, _events2.default.FRAG_PARSING_DATA, _events2.default.FRAG_PARSED, _events2.default.ERROR, _events2.default.AUDIO_TRACK_SWITCHING, _events2.default.AUDIO_TRACK_SWITCHED, _events2.default.BUFFER_CREATED, _events2.default.BUFFER_APPENDED, _events2.default.BUFFER_FLUSHED));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(StreamController, [{\n key: 'destroy',\n value: function destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n _eventHandler2.default.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.levels) {\n var lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.level = -1;\n this.fragLoadError = 0;\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n _logger.logger.warn('cannot start loading as manifest not parsed yet');\n this.state = State.STOPPED;\n }\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n var frag = this.fragCurrent;\n if (frag) {\n if (frag.loader) {\n frag.loader.abort();\n }\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n this.state = State.STOPPED;\n }\n }, {\n key: 'tick',\n value: function tick() {\n this.ticks++;\n if (this.ticks === 1) {\n this.doTick();\n if (this.ticks > 1) {\n setTimeout(this.tick, 1);\n }\n this.ticks = 0;\n }\n }\n }, {\n key: 'doTick',\n value: function doTick() {\n switch (this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n // when this returns false there was an error and we shall return immediatly\n // from current tick\n if (!this._doTickIdle()) {\n return;\n }\n break;\n case State.WAITING_LEVEL:\n var level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = State.IDLE;\n }\n break;\n case State.FRAG_LOADING_WAITING_RETRY:\n var now = performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || this.media && this.media.seeking) {\n _logger.logger.log('mediaController: retryDate reached, switch back to IDLE state');\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\n case State.STOPPED:\n case State.FRAG_LOADING:\n case State.PARSING:\n case State.PARSED:\n case State.ENDED:\n break;\n default:\n break;\n }\n // check buffer\n this._checkBuffer();\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n // Ironically the \"idle\" state is the on we do the most logic in it seems ....\n // NOTE: Maybe we could rather schedule a check for buffer length after half of the currently\n // played segment, or on pause/play/seek instead of naively checking every 100ms?\n\n }, {\n key: '_doTickIdle',\n value: function _doTickIdle() {\n var hls = this.hls,\n config = hls.config,\n media = this.media;\n\n // if video not attached AND\n // start fragment already requested OR start frag prefetch disable\n // exit loop\n // => if start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return true;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n var pos = void 0;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n var level = hls.nextLoadLevel,\n levelInfo = this.levels[level],\n levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n maxBufLen = Math.min(maxBufLen, config.maxMaxBufferLength);\n\n // determine next candidate fragment to be loaded, based on current position and end of buffer position\n // ensure up to `config.maxMaxBufferLength` of buffer upfront\n\n var bufferInfo = _bufferHelper2.default.bufferInfo(this.mediaBuffer ? this.mediaBuffer : media, pos, config.maxBufferHole),\n bufferLen = bufferInfo.len;\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return true;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n _logger.logger.trace('buffer length of ' + bufferLen.toFixed(3) + ' is below max of ' + maxBufLen.toFixed(3) + '. checking for more payload ...');\n\n // set next load level : this will trigger a playlist load if needed\n this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (typeof levelDetails === 'undefined' || levelDetails.live && this.levelLastLoaded !== level) {\n this.state = State.WAITING_LEVEL;\n return true;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // if everything (almost) til the end is buffered, let's signal eos\n // we don't compare exactly media.duration === bufferInfo.end as there could be some subtle media duration difference\n // using half frag duration should help cope with these cases.\n // also cope with almost zero last frag duration (max last frag duration with 200ms) refer to https://github.com/dailymotion/hls.js/pull/657\n if (media.duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration / 2)) {\n // Finalize the media stream\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_EOS, data);\n this.state = State.ENDED;\n return true;\n }\n }\n\n // if we have the levelDetails for the selected variant, lets continue enrichen our stream (load keys/fragments or trigger EOS, etc..)\n return this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n var fragPrevious = this.fragPrevious,\n level = this.level,\n fragments = levelDetails.fragments,\n fragLen = fragments.length;\n\n // empty playlist\n if (fragLen === 0) {\n return false;\n }\n\n // find fragment index, contiguous with end of buffer position\n var start = fragments[0].start,\n end = fragments[fragLen - 1].start + fragments[fragLen - 1].duration,\n bufferEnd = bufferInfo.end,\n frag = void 0;\n\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return false;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return false;\n }\n } else {\n // VoD playlist: if bufferEnd before start of playlist, load first fragment\n if (bufferEnd < start) {\n frag = fragments[0];\n }\n }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n return this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return true;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n var config = this.hls.config,\n media = this.media;\n\n var frag = void 0;\n\n // check if requested position is within seekable boundaries :\n //logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start - config.maxFragLookUpTolerance, end - maxLatency)) {\n var liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n _logger.logger.log('buffer end: ' + bufferEnd.toFixed(3) + ' is located too far from the end of live sliding playlist, reset currentTime to : ' + liveSyncPosition.toFixed(3));\n bufferEnd = liveSyncPosition;\n if (media && media.readyState && media.duration > liveSyncPosition) {\n media.currentTime = liveSyncPosition;\n }\n }\n\n // if end of buffer greater than live edge, don't load any fragment\n // this could happen if live playlist intermittently slides in the past.\n // level 1 loaded [182580161,182580167]\n // level 1 loaded [182580162,182580169]\n // Loading 182580168 of [182580162 ,182580169],level 1 ..\n // Loading 182580169 of [182580162 ,182580169],level 1 ..\n // level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168\n // level 1 loaded [182580164,182580171]\n //\n // don't return null in case media not loaded yet (readystate === 0)\n if (levelDetails.PTSKnown && bufferEnd > end && media && media.readyState) {\n return null;\n }\n\n if (this.startFragRequested && !levelDetails.PTSKnown) {\n /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...\n try to load frag matching with next SN.\n even if SN are not synchronized between playlists, loading this frag will help us\n compute playlist sliding and find the right one after in case it was not the right consecutive one */\n if (fragPrevious) {\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n _logger.logger.log('live playlist, switching playlist, load frag with next SN: ' + frag.sn);\n }\n }\n if (!frag) {\n /* we have no idea about which fragment should be loaded.\n so let's load mid fragment. it will help computing playlist sliding and find the right one\n */\n frag = fragments[Math.min(fragLen - 1, Math.round(fragLen / 2))];\n _logger.logger.log('live playlist, switching playlist, unknown, load middle frag : ' + frag.sn);\n }\n }\n return frag;\n }\n }, {\n key: '_findFragment',\n value: function _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n\n var frag = void 0,\n foundFrag = void 0,\n maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n foundFrag = _binarySearch2.default.search(fragments, function (candidate) {\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n //logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n if (candidate.start + candidate.duration - maxFragLookUpTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - maxFragLookUpTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n });\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n start = foundFrag.start;\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.level === fragPrevious.level && frag.sn === fragPrevious.sn) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS,\n curSNIdx = frag.sn - levelDetails.startSN;\n // if there is a significant delta between audio and video, larger than max allowed hole,\n // and if previous remuxed fragment did not start with a keyframe. (fragPrevious.dropped)\n // let's try to load previous fragment again to get last keyframe\n // then we will reload again current fragment (that way we should be able to fill the buffer hole ...)\n if (deltaPTS && deltaPTS > config.maxBufferHole && fragPrevious.dropped && curSNIdx) {\n frag = fragments[curSNIdx - 1];\n _logger.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');\n // decrement previous frag load counter to avoid frag loop loading error when next fragment will get reloaded\n fragPrevious.loadCounter--;\n } else {\n frag = fragments[curSNIdx + 1];\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n var hls = this.hls,\n config = hls.config;\n\n //logger.log('loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level);\n this.state = State.KEY_LOADING;\n hls.trigger(_events2.default.KEY_LOADING, { frag: frag });\n } else {\n _logger.logger.log('Loading ' + frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos.toFixed(3) + ',bufferEnd:' + bufferEnd.toFixed(3));\n // ensure that we are not reloading the same fragments in loop ...\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx++;\n } else {\n this.fragLoadIdx = 0;\n }\n if (frag.loadCounter) {\n frag.loadCounter++;\n var maxThreshold = config.fragLoadingLoopThreshold;\n // if this frag has already been loaded 3 times, and if it has been reloaded recently\n if (frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag });\n return false;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n this.nextLoadPosition = frag.start + frag.duration;\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return true;\n }\n }\n }, {\n key: 'getBufferRange',\n value: function getBufferRange(position) {\n return _binarySearch2.default.search(this.bufferRange, function (range) {\n if (position < range.start) {\n return -1;\n } else if (position > range.end) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferRange',\n value: function followingBufferRange(range) {\n if (range) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferRange(range.end + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var rangeCurrent,\n currentTime,\n video = this.media;\n if (video && video.readyState && video.seeking === false) {\n currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n if (currentTime > video.playbackRate * this.lastCurrentTime) {\n this.lastCurrentTime = currentTime;\n }\n if (_bufferHelper2.default.isBuffered(video, currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (_bufferHelper2.default.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n rangeCurrent = this.getBufferRange(currentTime + 0.1);\n }\n if (rangeCurrent) {\n var fragPlaying = rangeCurrent.frag;\n if (fragPlaying !== this.fragPlaying) {\n this.fragPlaying = fragPlaying;\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n }\n }\n }\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */\n\n }, {\n key: 'immediateLevelSwitch',\n value: function immediateLevelSwitch() {\n _logger.logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n var media = this.media,\n previouslyPaused = void 0;\n if (media) {\n previouslyPaused = media.paused;\n media.pause();\n } else {\n // don't restart playback after instant level switch in case media not attached\n previouslyPaused = true;\n }\n this.previouslyPaused = previouslyPaused;\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)\n - resume the playback if needed\n */\n\n }, {\n key: 'immediateLevelSwitchEnd',\n value: function immediateLevelSwitchEnd() {\n var media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if (_bufferHelper2.default.isBuffered(media, media.currentTime)) {\n // only nudge if currentTime is buffered\n media.currentTime -= 0.0001;\n }\n if (!this.previouslyPaused) {\n media.play();\n }\n }\n }\n }, {\n key: 'nextLevelSwitch',\n value: function nextLevelSwitch() {\n /* try to switch ASAP without breaking video playback :\n in order to ensure smooth but quick level switching,\n we need to find the next flushable buffer range\n we should take into account new segment fetch time\n */\n var media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n var fetchdelay = void 0,\n currentRange = void 0,\n nextRange = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n currentRange = this.getBufferRange(media.currentTime);\n if (currentRange && currentRange.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.flushMainBuffer(0, currentRange.start - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,\n nextLevel = this.levels[nextLevelId],\n fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.bitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n //logger.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n nextRange = this.getBufferRange(media.currentTime + fetchdelay);\n if (nextRange) {\n // we can flush buffer range following this one without stalling playback\n nextRange = this.followingBufferRange(nextRange);\n if (nextRange) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush position is the start position of this new buffer\n this.flushMainBuffer(nextRange.start, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\n }\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('seeked', this.onvseeked);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n _logger.logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // reset fragment loading counter on MSE detaching to avoid reporting FRAG_LOOP_LOADING_ERROR after error recovery\n var levels = this.levels;\n if (levels) {\n // reset fragment load counter\n levels.forEach(function (level) {\n if (level.details) {\n level.details.fragments.forEach(function (fragment) {\n fragment.loadCounter = undefined;\n });\n }\n });\n }\n // remove video listeners\n if (media) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('seeked', this.onvseeked);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvended = null;\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n }, {\n key: 'onMediaSeeking',\n value: function onMediaSeeking() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined,\n config = this.config;\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n if (this.state === State.FRAG_LOADING) {\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole),\n fragCurrent = this.fragCurrent;\n // check if we are seeking to a unbuffered area AND if frag loading is in progress\n if (bufferInfo.len === 0 && fragCurrent) {\n var tolerance = config.maxFragLookUpTolerance,\n fragStartOffset = fragCurrent.start - tolerance,\n fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // check if we seek position will be out of currently loaded frag range : if out cancel frag load, if in, don't do anything\n if (currentTime < fragStartOffset || currentTime > fragEndOffset) {\n if (fragCurrent.loader) {\n _logger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n } else {\n _logger.logger.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // switch to IDLE state to check for potential new fragment\n this.state = State.IDLE;\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n // avoid reporting fragment loop loading error in case user is seeking several times on same position\n if (this.state !== State.FRAG_LOADING && this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n _logger.logger.log('media seeked to ' + this.media.currentTime.toFixed(3));\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n }, {\n key: 'onMediaEnded',\n value: function onMediaEnded() {\n _logger.logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n // reset buffer on manifest loading\n _logger.logger.log('trigger BUFFER_RESET');\n this.hls.trigger(_events2.default.BUFFER_RESET);\n this.bufferRange = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n }, {\n key: 'onManifestParsed',\n value: function onManifestParsed(data) {\n var aac = false,\n heaac = false,\n codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac;\n if (this.audioCodecSwitch) {\n _logger.logger.log('both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragRequested = false;\n var config = this.config;\n if (config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('level ' + newLevelId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n this.levelLastLoaded = newLevelId;\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n _levelHelper2.default.mergeDetails(curDetails, newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n // override level info\n curLevel.details = newDetails;\n this.hls.trigger(_events2.default.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n if (this.startFragRequested === false) {\n // compute start position if set to -1. use it straight away if value is defined\n if (this.startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = newDetails.startTimeOffset;\n if (!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n _logger.logger.log('negative start time offset ' + startTimeOffset + ', count from end of last fragment');\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n _logger.logger.log('start time offset found in playlist, adjust startPosition to ' + startTimeOffset);\n this.startPosition = startTimeOffset;\n } else {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = this.computeLivePosition(sliding, newDetails);\n _logger.logger.log('configure startPosition to ' + this.startPosition);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\n }\n this.nextLoadPosition = this.startPosition;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n }, {\n key: 'onKeyLoaded',\n value: function onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'main' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n _logger.logger.log('Loaded ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + fragCurrent.level);\n // reset frag bitrate test in any case after frag loaded event\n this.bitrateTest = false;\n // if this frag was loaded to perform a bitrate test AND if hls.nextLoadLevel is greater than 0\n // then this means that we should be able to load a fragment at a higher quality level\n if (fragLoaded.bitrateTest === true && this.hls.nextLoadLevel) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = State.IDLE;\n this.startFragRequested = false;\n stats.tparsed = stats.tbuffered = performance.now();\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'main' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = stats;\n var duration = details.totalduration,\n start = !isNaN(fragCurrent.startDTS) ? fragCurrent.startDTS : fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec === undefined) {\n audioCodec = this.lastAudioCodec;\n }\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n }\n this.pendingBuffering = true;\n this.appended = false;\n _logger.logger.log('Parsing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level + ', cc ' + fragCurrent.cc);\n var demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new _demuxer2.default(this.hls, 'main');\n }\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n demuxer.push(data.payload, audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, sn, duration, fragCurrent.decryptdata, accurateTimeOffset, null);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n trackName,\n track;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (tracks.audio && this.altAudio) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n var audioCodec = this.levels[this.level].audioCodec,\n ua = navigator.userAgent.toLowerCase();\n if (audioCodec && this.audioCodecSwap) {\n _logger.logger.log('swapping playlist audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // in case AAC and HE-AAC audio codecs are signalled in manifest\n // force HE-AAC , as it seems that most browsers prefers that way,\n // except for mono streams OR on FF\n // these conditions might need to be reviewed ...\n if (this.audioCodecSwitch) {\n // don't force HE-AAC if mono stream\n if (track.metadata.channelCount !== 1 &&\n // don't force HE-AAC if firefox\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n _logger.logger.log('Android: force audio codec to ' + audioCodec);\n }\n track.levelCodec = audioCodec;\n track.id = data.id;\n }\n track = tracks.video;\n if (track) {\n track.levelCodec = this.levels[this.level].videoCodec;\n track.id = data.id;\n }\n\n // if remuxer specify that a unique track needs to generated,\n // let's merge all tracks together\n if (data.unique) {\n var mergedTrack = {\n codec: '',\n levelCodec: ''\n };\n for (trackName in data.tracks) {\n track = tracks[trackName];\n mergedTrack.container = track.container;\n if (mergedTrack.codec) {\n mergedTrack.codec += ',';\n mergedTrack.levelCodec += ',';\n }\n if (track.codec) {\n mergedTrack.codec += track.codec;\n }\n if (track.levelCodec) {\n mergedTrack.levelCodec += track.levelCodec;\n }\n }\n tracks = { audiovideo: mergedTrack };\n }\n this.hls.trigger(_events2.default.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n for (trackName in tracks) {\n track = tracks[trackName];\n _logger.logger.log('main track:' + trackName + ',container:' + track.container + ',codecs[level/parsed]=[' + track.levelCodec + '/' + track.codec + ']');\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, { type: trackName, data: initSegment, parent: 'main', content: 'initSegment' });\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsingData',\n value: function onFragParsingData(data) {\n var _this2 = this;\n\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && !(data.type === 'audio' && this.altAudio) && // filter out main audio if audio track is loaded through audio stream controller\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n\n _logger.logger.log('Parsed ' + data.type + ',PTS:[' + data.startPTS.toFixed(3) + ',' + data.endPTS.toFixed(3) + '],DTS:[' + data.startDTS.toFixed(3) + '/' + data.endDTS.toFixed(3) + '],nb:' + data.nb + ',dropped:' + (data.dropped || 0));\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag.sn, data.startPTS, data.endPTS, data.startDTS, data.endDTS),\n hls = this.hls;\n hls.trigger(_events2.default.LEVEL_PTS_UPDATED, { details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n }\n\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n }, {\n key: 'onFragParsed',\n value: function onFragParsed(data) {\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && data.id === 'main' && data.sn === fragCurrent.sn && data.level === fragCurrent.level && this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n }, {\n key: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n _logger.logger.log('switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent.loader) {\n _logger.logger.log('switching to main audio track, cancel main fragment load');\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n this.fragPrevious = null;\n // destroy demuxer to force init segment generation (following audio switch)\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n }, {\n key: 'onBufferCreated',\n value: function onBufferCreated(data) {\n var tracks = data.tracks,\n mediaTrack = void 0,\n name = void 0,\n alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n this.videoBuffer = tracks[type].buffer;\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n _logger.logger.log('alternate track found, use ' + name + '.buffered to schedule main fragment loading');\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n }\n }, {\n key: 'onBufferAppended',\n value: function onBufferAppended(data) {\n if (data.parent === 'main') {\n var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n var _this3 = this;\n\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n (function () {\n var media = _this3.mediaBuffer ? _this3.mediaBuffer : _this3.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter potentially evicted bufferRange. this is to avoid memleak on live streams\n var bufferRange = _this3.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n // push new range\n bufferRange.push({ type: frag.type, start: frag.startPTS, end: frag.endPTS, frag: frag });\n // sort, as we use BinarySearch for lookup in getBufferRange ...\n _this3.bufferRange = bufferRange.sort(function (a, b) {\n return a.start - b.start;\n });\n _this3.fragPrevious = frag;\n var stats = _this3.stats;\n stats.tbuffered = performance.now();\n // we should get rid of this.fragLastKbps\n _this3.fragLastKbps = Math.round(8 * stats.total / (stats.tbuffered - stats.tfirst));\n _this3.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: frag, id: 'main' });\n _this3.state = State.IDLE;\n })();\n }\n this.tick();\n }\n }\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag || this.fragCurrent;\n // don't handle frag error not related to main fragment\n if (frag && frag.type !== 'main') {\n return;\n }\n var media = this.media,\n\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, media.currentTime) && _bufferHelper2.default.isBuffered(media, media.currentTime + 0.5);\n switch (data.details) {\n case _errors.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_LOAD_TIMEOUT:\n if (!data.fatal) {\n var loadError = this.fragLoadError;\n if (loadError) {\n loadError++;\n } else {\n loadError = 1;\n }\n var config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\n this.fragLoadError = loadError;\n // reset load counter to avoid frag loop loading error\n frag.loadCounter = 0;\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, loadError - 1) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n _logger.logger.warn('mediaController: frag loading failed, retry in ' + delay + ' ms');\n this.retryDate = performance.now() + delay;\n // retry loading state\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n break;\n case _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n if (!data.fatal) {\n // if buffer is not empty\n if (mediaBuffered) {\n // try to reduce max buffer length : rationale is that we could get\n // frag loop loading error because of buffer eviction\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // buffer empty. report as fatal if in manual mode or if lowest level.\n // level controller takes care of emergency switch down logic\n if (!frag.autoLevel || frag.level === 0) {\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(_events2.default.ERROR, data);\n this.state = State.ERROR;\n }\n }\n }\n break;\n case _errors.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in cas of non fatal error while waiting level load to be completed, switch back to IDLE\n if (this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (this.state === State.PARSING || this.state === State.PARSED) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(frag.duration);\n this.state = State.IDLE;\n } else {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/dailymotion/hls.js/pull/708\n // in that case flush the whole buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: '_reduceMaxBufferLength',\n value: function _reduceMaxBufferLength(minLength) {\n var config = this.config;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n _logger.logger.warn('reduce max buffer length to ' + config.maxMaxBufferLength + 's and switch to IDLE state');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n }, {\n key: '_checkBuffer',\n value: function _checkBuffer() {\n var media = this.media;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if (media && media.readyState) {\n var currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.buffered;\n // adjust currentTime to start position on loaded metadata\n if (!this.loadedmetadata && buffered.length && !media.seeking) {\n this.loadedmetadata = true;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n var startPosition = this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n _logger.logger.log('target start position:' + startPosition);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if (!startPositionBuffered) {\n startPosition = buffered.start(0);\n _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition);\n }\n _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n var bufferInfo = _bufferHelper2.default.bufferInfo(media, currentTime, 0),\n expectedPlaying = !(media.paused || // not playing when media is paused\n media.ended || // not playing when media is ended\n media.buffered.length === 0),\n // not playing if nothing buffered\n jumpThreshold = 0.5,\n // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart,\n delta = nextBufferStart - currentTime;\n if (nextBufferStart && delta < config.maxSeekHole && delta > 0) {\n this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to next buffered @ ' + nextBufferStart + ' + nudge ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\n }\n }\n }\n }\n }\n }\n }, {\n key: 'onFragLoadEmergencyAborted',\n value: function onFragLoadEmergencyAborted() {\n this.state = State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferRange\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this.bufferRange = this.bufferRange.filter(function (range) {\n return _bufferHelper2.default.isBuffered(media, (range.start + range.end) / 2);\n });\n\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = State.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n }, {\n key: 'computeLivePosition',\n value: function computeLivePosition(sliding, levelDetails) {\n var targetLatency = this.config.liveSyncDuration !== undefined ? this.config.liveSyncDuration : this.config.liveSyncDurationCount * levelDetails.targetduration;\n return sliding + Math.max(0, levelDetails.totalduration - targetLatency);\n }\n }, {\n key: 'state',\n set: function set(nextState) {\n if (this.state !== nextState) {\n var previousState = this.state;\n this._state = nextState;\n _logger.logger.log('main stream:' + previousState + '->' + nextState);\n this.hls.trigger(_events2.default.STREAM_STATE_TRANSITION, { previousState: previousState, nextState: nextState });\n }\n },\n get: function get() {\n return this._state;\n }\n }, {\n key: 'currentLevel',\n get: function get() {\n var media = this.media;\n if (media) {\n var range = this.getBufferRange(media.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferRange',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this._liveSyncPosition;\n },\n set: function set(value) {\n this._liveSyncPosition = value;\n }\n }]);\n\n return StreamController;\n}(_eventHandler2.default);\n\nexports.default = StreamController;\n\n},{\"22\":22,\"26\":26,\"27\":27,\"28\":28,\"30\":30,\"31\":31,\"41\":41,\"45\":45,\"46\":46}],13:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(42);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Timeline Controller\n */\n\nvar TimelineController = function (_EventHandler) {\n _inherits(TimelineController, _EventHandler);\n\n function TimelineController(hls) {\n _classCallCheck(this, TimelineController);\n\n var _this = _possibleConstructorReturn(this, (TimelineController.__proto__ || Object.getPrototypeOf(TimelineController)).call(this, hls, _events2.default.MEDIA_ATTACHING, _events2.default.MEDIA_DETACHING, _events2.default.FRAG_PARSING_USERDATA, _events2.default.MANIFEST_LOADING, _events2.default.FRAG_LOADED, _events2.default.LEVEL_SWITCH));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack1) {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1) {\n self.textTrack1 = self.createTextTrack('captions', 'English', 'en');\n self.textTrack1.textTrack1 = true;\n } else {\n self.textTrack1 = existingTrack1;\n self.clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack1, startTime, endTime, screen);\n }\n };\n\n var channel2 = {\n 'newCue': function newCue(startTime, endTime, screen) {\n if (!self.textTrack2) {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2) {\n self.textTrack2 = self.createTextTrack('captions', 'Spanish', 'es');\n self.textTrack2.textTrack2 = true;\n } else {\n self.textTrack2 = existingTrack2;\n self.clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n\n self.Cues.newCue(self.textTrack2, startTime, endTime, screen);\n }\n };\n\n _this.cea608Parser = new _cea608Parser2.default(0, channel1, channel2);\n }\n return _this;\n }\n\n _createClass(TimelineController, [{\n key: 'clearCurrentCues',\n value: function clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n }\n }, {\n key: 'getExistingTrack',\n value: function getExistingTrack(channelNumber) {\n var media = this.media;\n if (media) {\n for (var i = 0; i < media.textTracks.length; i++) {\n var textTrack = media.textTracks[i];\n var propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n }, {\n key: 'createTextTrack',\n value: function createTextTrack(kind, label, lang) {\n if (this.media) {\n return this.media.addTextTrack(kind, label, lang);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onMediaAttaching',\n value: function onMediaAttaching(data) {\n this.media = data.media;\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastPts = Number.NEGATIVE_INFINITY;\n }\n }, {\n key: 'onLevelSwitch',\n value: function onLevelSwitch() {\n if (this.hls.currentLevel.closedCaptions === 'NONE') {\n this.enabled = false;\n } else {\n this.enabled = true;\n }\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n if (data.frag.type === 'main') {\n var pts = data.frag.start; //Number.POSITIVE_INFINITY;\n // if this is a frag for a previously loaded timerange, remove all captions\n // TODO: consider just removing captions for the timerange\n if (pts <= this.lastPts) {\n this.clearCurrentCues(this.textTrack1);\n this.clearCurrentCues(this.textTrack2);\n }\n this.lastPts = pts;\n }\n }\n }, {\n key: 'onFragParsingUserdata',\n value: function onFragParsingUserdata(data) {\n // push all of the CEA-708 messages into the interpreter\n // immediately. It will create the proper timestamps based on our PTS value\n if (this.enabled && this.config.enableCEA708Captions) {\n for (var i = 0; i < data.samples.length; i++) {\n var ccdatas = this.extractCea608Data(data.samples[i].bytes);\n this.cea608Parser.addData(data.samples[i].pts, ccdatas);\n }\n }\n }\n }, {\n key: 'extractCea608Data',\n value: function extractCea608Data(byteArray) {\n var count = byteArray[0] & 31;\n var position = 2;\n var tmpByte, ccbyte1, ccbyte2, ccValid, ccType;\n var actualCCBytes = [];\n\n for (var j = 0; j < count; j++) {\n tmpByte = byteArray[position++];\n ccbyte1 = 0x7F & byteArray[position++];\n ccbyte2 = 0x7F & byteArray[position++];\n ccValid = (4 & tmpByte) === 0 ? false : true;\n ccType = 3 & tmpByte;\n\n if (ccbyte1 === 0 && ccbyte2 === 0) {\n continue;\n }\n\n if (ccValid) {\n if (ccType === 0) // || ccType === 1\n {\n actualCCBytes.push(ccbyte1);\n actualCCBytes.push(ccbyte2);\n }\n }\n }\n return actualCCBytes;\n }\n }]);\n\n return TimelineController;\n}(_eventHandler2.default);\n\nexports.default = TimelineController;\n\n},{\"27\":27,\"28\":28,\"42\":42}],14:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],15:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n this.subMix = [];\n this.subMix[0] = new Uint32Array(256);\n this.subMix[1] = new Uint32Array(256);\n this.subMix[2] = new Uint32Array(256);\n this.subMix[3] = new Uint32Array(256);\n\n this.invSubMix = [];\n this.invSubMix[0] = new Uint32Array(256);\n this.invSubMix[1] = new Uint32Array(256);\n this.invSubMix[2] = new Uint32Array(256);\n this.invSubMix[3] = new Uint32Array(256);\n\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix0 = this.subMix[0];\n var subMix1 = this.subMix[1];\n var subMix2 = this.subMix[2];\n var subMix3 = this.subMix[3];\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(this.ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(this.ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix0 = this.invSubMix[0];\n var invSubMix1 = this.invSubMix[1];\n var invSubMix2 = this.invSubMix[2];\n var invSubMix3 = this.invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n\n while (offset < inputInt32.length) {\n inputWords0 = this.networkToHostOrderSwap(inputInt32[offset]);\n inputWords1 = this.networkToHostOrderSwap(inputInt32[offset + 1]);\n inputWords2 = this.networkToHostOrderSwap(inputInt32[offset + 2]);\n inputWords3 = this.networkToHostOrderSwap(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = this.networkToHostOrderSwap(t0 ^ initVector0);\n outputInt32[offset + 1] = this.networkToHostOrderSwap(t3 ^ initVector1);\n outputInt32[offset + 2] = this.networkToHostOrderSwap(t2 ^ initVector2);\n outputInt32[offset + 3] = this.networkToHostOrderSwap(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],16:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _aesCrypto = _dereq_(14);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(17);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(15);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n _logger.logger.log('JS AES decrypt');\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n (function () {\n _logger.logger.log('WebCrypto AES decrypt');\n var subtle = _this.subtle;\n if (_this.key !== key) {\n _this.key = key;\n _this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n _this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n })();\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"14\":14,\"15\":15,\"17\":17,\"26\":26,\"45\":45}],17:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],18:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * AAC demuxer\n */\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(45);\n\nvar _id = _dereq_(24);\n\nvar _id2 = _interopRequireDefault(_id);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AACDemuxer = function () {\n function AACDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n this.insertDiscontinuity();\n }\n\n _createClass(AACDemuxer, [{\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._aacTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0 };\n }\n }, {\n key: 'push',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var track,\n id3 = new _id2.default(data),\n pts = 90 * id3.timeStamp,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n\n var contiguous = false;\n if (cc !== this.lastCC) {\n _logger.logger.log(this.id + ' discontinuity detected');\n this.lastCC = cc;\n this.insertDiscontinuity();\n this.remuxer.switchLevel();\n this.remuxer.insertDiscontinuity();\n } else if (level !== this.lastLevel) {\n _logger.logger.log('audio track switch detected');\n this.lastLevel = level;\n this.remuxer.switchLevel();\n this.insertDiscontinuity();\n } else if (sn === this.lastSN + 1) {\n contiguous = true;\n }\n track = this._aacTrack;\n this.lastSN = sn;\n this.lastLevel = level;\n\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n\n if (!track.audiosamplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(level, sn, cc, track, { samples: [] }, { samples: [{ pts: pts, dts: pts, unit: id3.payload }] }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n // check if data contains ID3 timestamp and ADTS sync worc\n var id3 = new _id2.default(data),\n offset,\n len;\n if (id3.hasTimeStamp) {\n // look for ADTS header (0xFFFx)\n for (offset = id3.length, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return AACDemuxer;\n}();\n\nexports.default = AACDemuxer;\n\n},{\"19\":19,\"24\":24,\"45\":45}],19:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ADTS parser helper\n */\n\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ADTS = function () {\n function ADTS() {\n _classCallCheck(this, ADTS);\n }\n\n _createClass(ADTS, null, [{\n key: 'getAudioConfig',\n value: function getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType,\n // :int\n adtsSampleingIndex,\n // :int\n adtsExtensionSampleingIndex,\n // :int\n adtsChanelConfig,\n // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xC0) >>> 6) + 1;\n adtsSampleingIndex = (data[offset + 2] & 0x3C) >>> 2;\n if (adtsSampleingIndex > adtsSampleingRates.length - 1) {\n observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'invalid ADTS sampling index:' + adtsSampleingIndex });\n return;\n }\n adtsChanelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChanelConfig |= (data[offset + 3] & 0xC0) >>> 6;\n _logger.logger.log('manifest codec:' + audioCodec + ',ADTS data:type:' + adtsObjectType + ',sampleingIndex:' + adtsSampleingIndex + '[' + adtsSampleingRates[adtsSampleingIndex] + 'Hz],channelConfig:' + adtsChanelConfig);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/i.test(userAgent)) {\n if (adtsSampleingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi/Opera ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSampleingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSampleingIndex = adtsSampleingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && adtsSampleingIndex >= 6 && adtsChanelConfig === 1 || !audioCodec && adtsChanelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSampleingIndex = adtsSampleingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSampleingIndex & 0x0E) >> 1;\n config[1] |= (adtsSampleingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChanelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSampleingIndex\n config[1] |= (adtsExtensionSampleingIndex & 0x0E) >> 1;\n config[2] = (adtsExtensionSampleingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec };\n }\n }]);\n\n return ADTS;\n}();\n\nexports.default = ADTS;\n\n},{\"26\":26,\"45\":45}],20:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _decrypter = _dereq_(16);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(18);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _tsdemuxer = _dereq_(25);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp4Remuxer = _dereq_(38);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(39);\n\nvar _passthroughRemuxer2 = _interopRequireDefault(_passthroughRemuxer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DemuxerInline = function () {\n function DemuxerInline(hls, id, typeSupported) {\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, DemuxerInline);\n\n this.hls = hls;\n this.id = id;\n this.config = this.hls.config || config;\n this.typeSupported = typeSupported;\n }\n\n _createClass(DemuxerInline, [{\n key: 'destroy',\n value: function destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n if (this.decrypter == null) {\n this.decrypter = new _decrypter2.default(this.hls, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n this.decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.hls.trigger(_events2.default.FRAG_DECRYPTED, { level: level, sn: sn, stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n cc !== this.cc && !demuxer.probe(data)) {\n var hls = this.hls,\n id = this.id,\n config = this.config,\n typeSupported = this.typeSupported;\n // probe for content type\n if (_tsdemuxer2.default.probe(data)) {\n if (this.typeSupported.mp2t === true) {\n demuxer = new _tsdemuxer2.default(hls, id, _passthroughRemuxer2.default, config, typeSupported);\n } else {\n demuxer = new _tsdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n }\n demuxer.probe = _tsdemuxer2.default.probe;\n } else if (_aacdemuxer2.default.probe(data)) {\n demuxer = new _aacdemuxer2.default(hls, id, _mp4Remuxer2.default, config, typeSupported);\n demuxer.probe = _aacdemuxer2.default.probe;\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS);\n this.cc = cc;\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"16\":16,\"18\":18,\"25\":25,\"26\":26,\"28\":28,\"38\":38,\"39\":39}],21:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* demuxer web worker.\n * - listen to worker message, and trigger DemuxerInline upon reception of Fragments.\n * - provides MP4 Boxes back to main thread using [transferable objects](https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast) in order to minimize message passing overhead.\n */\n\nvar DemuxerWorker = function DemuxerWorker(self) {\n // observer setup\n var observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({ event: ev, data: data });\n };\n\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n //console.log('demuxer cmd:' + data.cmd);\n switch (data.cmd) {\n case 'init':\n var config = JSON.parse(data.config);\n self.demuxer = new _demuxerInline2.default(observer, data.id, data.typeSupported, config);\n try {\n (0, _logger.enableLogs)(config.debug === true);\n } catch (err) {\n console.warn('demuxerWorker: unable to enable logs');\n }\n // signal end of worker init\n forwardMessage('init', null);\n break;\n case 'demux':\n self.demuxer.push(data.data, data.audioCodec, data.videoCodec, data.timeOffset, data.cc, data.level, data.sn, data.duration, data.decryptdata, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSED, forwardMessage);\n observer.on(_events2.default.ERROR, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(_events2.default.FRAG_PARSING_DATA, function (ev, data) {\n var data1 = data.data1.buffer,\n data2 = data.data2.buffer;\n // remove data1 and data2 reference from data to avoid copying them ...\n delete data.data1;\n delete data.data2;\n self.postMessage({ event: ev, data: data, data1: data1, data2: data2 }, [data1, data2]);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"20\":20,\"28\":28,\"45\":45}],22:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(20);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(21);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Demuxer = function () {\n function Demuxer(hls, id) {\n _classCallCheck(this, Demuxer);\n\n this.hls = hls;\n this.id = id;\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mp2t: hls.config.enableMP2TPassThrough && MediaSource.isTypeSupported('video/mp2t'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n if (hls.config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\n w = this.w = work(_demuxerWorker2.default);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function (event) {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event: 'demuxerWorker', err: { message: event.message + ' (' + event.filename + ':' + event.lineno + ')' } });\n };\n w.postMessage({ cmd: 'init', typeSupported: typeSupported, id: id, config: JSON.stringify(hls.config) });\n } catch (err) {\n _logger.logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n if (w) {\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(w.objectURL);\n }\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(hls, id, typeSupported);\n }\n this.demuxInitialized = true;\n }\n\n _createClass(Demuxer, [{\n key: 'destroy',\n value: function destroy() {\n var w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n }\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({ cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, sn: sn, duration: duration, decryptdata: decryptdata, accurateTimeOffset: accurateTimeOffset, defaultInitPTS: defaultInitPTS }, [data]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, decryptdata, accurateTimeOffset, defaultInitPTS);\n }\n }\n }\n }, {\n key: 'onWorkerMessage',\n value: function onWorkerMessage(ev) {\n var data = ev.data,\n hls = this.hls;\n //console.log('onWorkerMessage:' + data.event);\n switch (data.event) {\n case 'init':\n // revoke the Object URL that was used to create demuxer worker, so as not to leak it\n URL.revokeObjectURL(this.w.objectURL);\n break;\n // special case for FRAG_PARSING_DATA: data1 and data2 are transferable objects\n case _events2.default.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n data.data.data2 = new Uint8Array(data.data2);\n /* falls through */\n default:\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"20\":20,\"21\":21,\"26\":26,\"28\":28,\"3\":3,\"45\":45}],23:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ExpGolomb = function () {\n function ExpGolomb(data) {\n _classCallCheck(this, ExpGolomb);\n\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n\n\n _createClass(ExpGolomb, [{\n key: 'loadWord',\n value: function loadWord() {\n var data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n\n }, {\n key: 'skipBits',\n value: function skipBits(count) {\n var skipBytes; // :int\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes >> 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n\n }, {\n key: 'readBits',\n value: function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size),\n // :uint\n valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _logger.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n\n }, {\n key: 'skipLZ',\n value: function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if (0 !== (this.word & 0x80000000 >>> leadingZeroCount)) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n\n }, {\n key: 'skipUEG',\n value: function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n\n }, {\n key: 'skipEG',\n value: function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n\n }, {\n key: 'readUEG',\n value: function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n\n }, {\n key: 'readEG',\n value: function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n\n }, {\n key: 'readBoolean',\n value: function readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n\n }, {\n key: 'readUByte',\n value: function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n\n }, {\n key: 'readUShort',\n value: function readUShort() {\n return this.readBits(16);\n }\n // ():int\n\n }, {\n key: 'readUInt',\n value: function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n }, {\n key: 'skipScalingList',\n value: function skipScalingList(count) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n }, {\n key: 'readSPS',\n value: function readSPS() {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\n };\n }\n }, {\n key: 'readSliceType',\n value: function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n }\n }]);\n\n return ExpGolomb;\n}();\n\nexports.default = ExpGolomb;\n\n},{\"45\":45}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * ID3 parser\n */\n\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n//import Hex from '../utils/hex';\n\nvar ID3 = function () {\n function ID3(data) {\n _classCallCheck(this, ID3);\n\n this._hasTimeStamp = false;\n var offset = 0,\n byte1,\n byte2,\n byte3,\n byte4,\n tagSize,\n endPos,\n header,\n len;\n do {\n header = this.readUTF(data, offset, 3);\n offset += 3;\n // first check for ID3 header\n if (header === 'ID3') {\n // skip 24 bits\n offset += 3;\n // retrieve tag(s) length\n byte1 = data[offset++] & 0x7f;\n byte2 = data[offset++] & 0x7f;\n byte3 = data[offset++] & 0x7f;\n byte4 = data[offset++] & 0x7f;\n tagSize = (byte1 << 21) + (byte2 << 14) + (byte3 << 7) + byte4;\n endPos = offset + tagSize;\n //logger.log(`ID3 tag found, size/end: ${tagSize}/${endPos}`);\n\n // read ID3 tags\n this._parseID3Frames(data, offset, endPos);\n offset = endPos;\n } else if (header === '3DI') {\n // http://id3.org/id3v2.4.0-structure chapter 3.4. ID3v2 footer\n offset += 7;\n _logger.logger.log('3DI footer found, end: ' + offset);\n } else {\n offset -= 3;\n len = offset;\n if (len) {\n //logger.log(`ID3 len: ${len}`);\n if (!this.hasTimeStamp) {\n _logger.logger.warn('ID3 tag found, but no timestamp');\n }\n this._length = len;\n this._payload = data.subarray(0, len);\n }\n return;\n }\n } while (true);\n }\n\n _createClass(ID3, [{\n key: 'readUTF',\n value: function readUTF(data, start, len) {\n\n var result = '',\n offset = start,\n end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while (offset < end);\n return result;\n }\n }, {\n key: '_parseID3Frames',\n value: function _parseID3Frames(data, offset, endPos) {\n var tagId, tagLen, tagStart, tagFlags, timestamp;\n while (offset + 8 <= endPos) {\n tagId = this.readUTF(data, offset, 4);\n offset += 4;\n\n tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++];\n\n tagFlags = data[offset++] << 8 + data[offset++];\n\n tagStart = offset;\n //logger.log(\"ID3 tag id:\" + tagId);\n switch (tagId) {\n case 'PRIV':\n //logger.log('parse frame:' + Hex.hexDump(data.subarray(offset,endPos)));\n // owner should be \"com.apple.streaming.transportStreamTimestamp\"\n if (this.readUTF(data, offset, 44) === 'com.apple.streaming.transportStreamTimestamp') {\n offset += 44;\n // smelling even better ! we found the right descriptor\n // skip null character (string end) + 3 first bytes\n offset += 4;\n\n // timestamp is 33 bit expressed as a big-endian eight-octet number, with the upper 31 bits set to zero.\n var pts33Bit = data[offset++] & 0x1;\n this._hasTimeStamp = true;\n\n timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n _logger.logger.trace('ID3 timestamp found: ' + timestamp);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n }, {\n key: 'hasTimeStamp',\n get: function get() {\n return this._hasTimeStamp;\n }\n }, {\n key: 'timeStamp',\n get: function get() {\n return this._timeStamp;\n }\n }, {\n key: 'length',\n get: function get() {\n return this._length;\n }\n }, {\n key: 'payload',\n get: function get() {\n return this._payload;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\n\n},{\"45\":45}],25:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n// import Hex from '../utils/hex';\n\n\nvar _adts = _dereq_(19);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(23);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TSDemuxer = function () {\n function TSDemuxer(observer, id, remuxerClass, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.id = id;\n this.remuxerClass = remuxerClass;\n this.config = config;\n this.typeSupported = typeSupported;\n this.lastCC = 0;\n this.remuxer = new this.remuxerClass(observer, id, config, typeSupported);\n }\n\n _createClass(TSDemuxer, [{\n key: 'switchLevel',\n value: function switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.remuxer.switchLevel();\n }\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'push',\n value: function push(data, audioCodec, videoCodec, timeOffset, cc, level, sn, duration, accurateTimeOffset, defaultInitPTS) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n codecsOnly = this.remuxer.passthrough,\n unknownPIDs = false;\n\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n this.contiguous = false;\n this.accurateTimeOffset = accurateTimeOffset;\n if (cc !== this.lastCC) {\n _logger.logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n }\n if (level !== this.lastLevel) {\n _logger.logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n } else if (sn === this.lastSN + 1) {\n this.contiguous = true;\n }\n this.lastSN = sn;\n\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.pesData,\n id3Data = id3Track.pesData,\n parsePAT = this._parsePAT,\n parsePMT = this._parsePMT,\n parsePES = this._parsePES,\n parseAVCPES = this._parseAVCPES.bind(this),\n parseAACPES = this._parseAACPES.bind(this),\n parseMPEGPES = this._parseMPEGPES.bind(this),\n parseID3PES = this._parseID3PES.bind(this);\n\n // don't parse last TS packet if incomplete\n len -= len % 188;\n // loop through TS packets\n for (start = 0; start < len; start += 188) {\n if (data[start] === 0x47) {\n stt = !!(data[start + 1] & 0x40);\n // pid is a 13-bit field starting at the last bit of TS[1]\n pid = ((data[start + 1] & 0x1f) << 8) + data[start + 2];\n atf = (data[start + 3] & 0x30) >> 4;\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + 188) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, false);\n if (codecsOnly) {\n // if we have video codec info AND\n // if audio PID is undefined OR if we have audio codec info,\n // we have all codec info !\n if (avcTrack.codec && (audioId === -1 || audioTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n avcData = { data: [], size: 0 };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + 188));\n avcData.size += start + 188 - offset;\n }\n break;\n case audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n if (codecsOnly) {\n // here we now that we have audio codec info\n // if video PID is undefined OR if we have video codec info,\n // we have all codec infos !\n if (audioTrack.codec && (avcId === -1 || avcTrack.codec)) {\n this.remux(level, sn, cc, data, timeOffset);\n return;\n }\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.size += start + 188 - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n }\n id3Data = { data: [], size: 0 };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + 188));\n id3Data.size += start + 188 - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n break;\n case pmtId:\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n _logger.logger.log('reparse from beginning');\n unknownPIDs = false;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = -188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n case 17:\n case 0x1fff:\n break;\n default:\n unknownPIDs = true;\n break;\n }\n } else {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47' });\n }\n }\n // try to parse last PES packets\n if (avcData && (pes = parsePES(avcData))) {\n parseAVCPES(pes, true);\n avcTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n avcTrack.pesData = avcData;\n }\n\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\n }\n\n if (id3Data && (pes = parsePES(id3Data))) {\n parseID3PES(pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n this.remux(level, sn, cc, null, timeOffset, defaultInitPTS);\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, data, timeOffset, defaultInitPTS) {\n var avcTrack = this._avcTrack,\n samples = avcTrack.samples,\n nbNalu = 0,\n naluLen = 0;\n\n // compute total/avc sample length and nb of NAL units\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i],\n units = sample.units.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n }\n avcTrack.len = naluLen;\n avcTrack.nbNalu = nbNalu;\n this.remuxer.remux(level, sn, cc, this._audioTrack, this._avcTrack, this._id3Track, this._txtTrack, timeOffset, this.contiguous, this.accurateTimeOffset, defaultInitPTS, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n }, {\n key: '_parsePAT',\n value: function _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n }, {\n key: '_parsePMT',\n value: function _parsePMT(data, offset, mpegSupported) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\n sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n pid = (data[offset + 1] & 0x1F) << 8 | data[offset + 2];\n switch (data[offset]) {\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n case 0x0f:\n //logger.log('AAC PID:' + pid);\n if (result.audio === -1) {\n result.audio = pid;\n }\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n case 0x1b:\n //logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n default:\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0F) << 8 | data[offset + 4]) + 5;\n }\n return result;\n }\n }, {\n key: '_parsePES',\n value: function _parsePES(stream) {\n var i = 0,\n frag,\n pesFlags,\n pesPrefix,\n pesLen,\n pesHdrLen,\n pesData,\n pesPts,\n pesDts,\n payloadStartOffset,\n data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n //retrieve PTS/DTS from first fragment\n frag = data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen > stream.size - 6) {\n return null;\n }\n pesFlags = frag[7];\n if (pesFlags & 0xC0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0E) * 536870912 + // 1 << 29\n (frag[10] & 0xFF) * 4194304 + // 1 << 22\n (frag[11] & 0xFE) * 16384 + // 1 << 14\n (frag[12] & 0xFF) * 128 + // 1 << 7\n (frag[13] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesPts > 4294967295) {\n // decrement 2^33\n pesPts -= 8589934592;\n }\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0E) * 536870912 + // 1 << 29\n (frag[15] & 0xFF) * 4194304 + // 1 << 22\n (frag[16] & 0xFE) * 16384 + // 1 << 14\n (frag[17] & 0xFF) * 128 + // 1 << 7\n (frag[18] & 0xFE) / 2;\n // check if greater than 2^32 -1\n if (pesDts > 4294967295) {\n // decrement 2^33\n pesDts -= 8589934592;\n }\n if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n payloadStartOffset = pesHdrLen + 9;\n\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return { data: pesData, pts: pesPts, dts: pesDts, len: pesLen };\n } else {\n return null;\n }\n }\n }, {\n key: 'pushAccesUnit',\n value: function pushAccesUnit(avcSample, avcTrack) {\n if (avcSample.units.units.length && avcSample.frame) {\n // only push AVC sample if starting with a keyframe is not mandatory OR\n // if keyframe already found in this fragment OR\n // keyframe found in last fragment (track.sps) AND\n // samples already appended (we already found a keyframe in this fragment) OR fragment is contiguous\n if (!this.config.forceKeyFrameOnDiscontinuity || avcSample.key === true || avcTrack.sps && (avcTrack.samples.length || this.contiguous)) {\n avcTrack.samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if (avcSample.debug.length) {\n _logger.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug + ',' + avcSample.units.length);\n }\n }\n }, {\n key: '_parseAVCPES',\n value: function _parseAVCPES(pes, last) {\n var _this = this;\n\n //logger.log('parse new PES');\n var track = this._avcTrack,\n units = this._parseAVCNALu(pes.data),\n debug = false,\n expGolombDecoder,\n avcSample = this.avcSample,\n push,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(function (unit) {\n switch (unit.type) {\n //NDR\n case 1:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var data = unit.data;\n if (data.length > 4) {\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\n }\n break;\n //IDR\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = _this._createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new _expGolomb2.default(_this.discardEPB(unit.data));\n\n // skip frameType\n expGolombDecoder.readUByte();\n\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n\n while (!endOfCaptions && expGolombDecoder.bytesAvailable > 1) {\n payloadType = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadType += b;\n } while (b === 0xFF);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n b = expGolombDecoder.readUByte();\n payloadSize += b;\n } while (b === 0xFF);\n\n // TODO: there can be more than one payload in an SEI packet...\n // TODO: need to read type and size in a while loop to get them all\n if (payloadType === 4 && expGolombDecoder.bytesAvailable !== 0) {\n\n endOfCaptions = true;\n\n var countryCode = expGolombDecoder.readUByte();\n\n if (countryCode === 181) {\n var providerCode = expGolombDecoder.readUShort();\n\n if (providerCode === 49) {\n var userStructure = expGolombDecoder.readUInt();\n\n if (userStructure === 0x47413934) {\n var userDataType = expGolombDecoder.readUByte();\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = expGolombDecoder.readUByte();\n var secondByte = expGolombDecoder.readUByte();\n\n var totalCCs = 31 & firstByte;\n var byteArray = [firstByte, secondByte];\n\n for (i = 0; i < totalCCs; i++) {\n // 3 bytes per CC\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n byteArray.push(expGolombDecoder.readUByte());\n }\n\n _this._insertSampleInOrder(_this._txtTrack.samples, { type: 3, pts: pes.pts, bytes: byteArray });\n }\n }\n }\n }\n } else if (payloadSize < expGolombDecoder.bytesAvailable) {\n for (i = 0; i < payloadSize; i++) {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n expGolombDecoder = new _expGolomb2.default(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n //PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n if (avcSample) {\n _this.pushAccesUnit(avcSample, track);\n }\n avcSample = _this.avcSample = _this._createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = false;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n this.pushAccesUnit(avcSample, track);\n this.avcSample = null;\n }\n }\n }, {\n key: '_createAVCSample',\n value: function _createAVCSample(key, pts, dts, debug) {\n return { key: key, pts: pts, dts: dts, units: { units: [], length: 0 }, debug: debug };\n }\n }, {\n key: '_insertSampleInOrder',\n value: function _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len - 1].pts) {\n arr.push(data);\n } else {\n for (var pos = len - 1; pos >= 0; pos--) {\n if (data.pts < arr[pos].pts) {\n arr.splice(pos, 0, data);\n break;\n }\n }\n }\n } else {\n arr.push(data);\n }\n }\n }, {\n key: '_getLastNalUnit',\n value: function _getLastNalUnit() {\n var avcSample = this.avcSample,\n lastUnit = void 0;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.units.length === 0) {\n var track = this._avcTrack,\n samples = track.samples;\n avcSample = samples[samples.length - 1];\n }\n if (avcSample) {\n var units = avcSample.units.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n }, {\n key: '_parseAVCNALu',\n value: function _parseAVCNALu(array) {\n var i = 0,\n len = array.byteLength,\n value,\n overflow,\n track = this._avcTrack,\n state = track.naluState || 0,\n lastState = state;\n var units = [],\n unit,\n unitType,\n lastUnitStart = -1,\n lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -1) {\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n unit = { data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType };\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n //logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n unit = { data: array.subarray(lastUnitStart, len), type: lastUnitType, state: state };\n units.push(unit);\n //logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this._getLastNalUnit();\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n }\n\n /**\n * remove Emulation Prevention bytes from a RBSP\n */\n\n }, {\n key: 'discardEPB',\n value: function discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength,\n newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - EPBPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }\n }, {\n key: '_parseAACPES',\n value: function _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config,\n frameLength,\n frameDuration,\n frameIndex,\n offset,\n headerLength,\n stamp,\n len,\n aacSample;\n if (aacOverFlow) {\n var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength);\n tmp.set(aacOverFlow, 0);\n tmp.set(data, aacOverFlow.byteLength);\n //logger.log(`AAC: append overflowing ${aacOverFlow.byteLength} bytes to beginning of new PES`);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset) {\n var reason, fatal;\n if (offset < len - 1) {\n reason = 'AAC PES did not start with ADTS header,offset:' + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _logger.logger.warn('parsing error:' + reason);\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n var audioCodec = this.audioCodec;\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n track.duration = this._duration;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.audiosamplerate;\n\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n if (aacOverFlow && aacLastPTS) {\n var newPTS = aacLastPTS + frameDuration;\n if (Math.abs(newPTS - pts) > 1) {\n _logger.logger.log('AAC: align PTS for overlapping frames by ' + Math.round((newPTS - pts) / 90));\n pts = newPTS;\n }\n }\n\n while (offset + 5 < len) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;\n // retrieve frame size\n frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= len) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n track.samples.push(aacSample);\n track.len += frameLength;\n offset += frameLength + headerLength;\n frameIndex++;\n // look for ADTS header (0xFFFx)\n for (; offset < len - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n if (offset < len) {\n aacOverFlow = data.subarray(offset, len);\n //logger.log(`AAC: overflow detected:${len-offset}`);\n } else {\n aacOverFlow = null;\n }\n this.aacOverFlow = aacOverFlow;\n this.aacLastPTS = stamp;\n }\n }, {\n key: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n var data = pes.data;\n var pts = pes.pts;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var parsed;\n\n while (offset < length && (parsed = this._parseMpeg(data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n }, {\n key: '_onMpegFrame',\n value: function _onMpegFrame(data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 / sampleRate * 1000;\n var stamp = pts + frameIndex * frameDuration;\n var track = this._audioTrack;\n\n track.config = [];\n track.channelCount = channelCount;\n track.audiosamplerate = sampleRate;\n track.duration = this._duration;\n track.samples.push({ unit: data, pts: stamp, dts: stamp });\n track.len += data.length;\n }\n }, {\n key: '_onMpegNoise',\n value: function _onMpegNoise(data) {\n _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n }\n }, {\n key: '_parseMpeg',\n value: function _parseMpeg(data, start, end, frameIndex, pts) {\n var 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];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = data[start + 1] >> 3 & 3;\n var headerC = data[start + 1] >> 1 & 3;\n var headerE = data[start + 2] >> 4 & 15;\n var headerF = data[start + 2] >> 2 & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n if (start + frameLength > end) {\n return -1;\n }\n if (this._onMpegFrame) {\n this._onMpegFrame(data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n }\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n if (this._onMpegNoise) {\n this._onMpegNoise(data.subarray(start, offset - 1));\n }\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n }\n }, {\n key: '_parseID3PES',\n value: function _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n }], [{\n key: 'probe',\n value: function probe(data) {\n // a TS fragment should contain at least 3 TS packets, a PAT, a PMT, and one PID, each starting with 0x47\n if (data.length >= 3 * 188 && data[0] === 0x47 && data[188] === 0x47 && data[2 * 188] === 0x47) {\n return true;\n } else {\n return false;\n }\n }\n }]);\n\n return TSDemuxer;\n}();\n\nexports.default = TSDemuxer;\n\n},{\"19\":19,\"23\":23,\"26\":26,\"28\":28,\"45\":45}],26:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ErrorTypes = exports.ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'networkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'mediaError',\n // Identifier for a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nvar ErrorDetails = exports.ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut',\n // Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason}\n MANIFEST_PARSING_ERROR: 'manifestParsingError',\n // Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason}\n MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError',\n // Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut',\n // Identifier for a level switch error - data: { level : faulty level Id, event : error description}\n LEVEL_SWITCH_ERROR: 'levelSwitchError',\n // Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError',\n // Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }}\n AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut',\n // Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n FRAG_LOAD_ERROR: 'fragLoadError',\n // Identifier for fragment loop loading error - data: { frag : fragment object}\n FRAG_LOOP_LOADING_ERROR: 'fragLoopLoadingError',\n // Identifier for fragment load timeout error - data: { frag : fragment object}\n FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut',\n // Identifier for a fragment decryption error event - data: parsing error description\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a remux alloc error event - data: { id : demuxer Id, bytes : nb of bytes on which allocation failed , reason : error text }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\n // Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }}\n KEY_LOAD_ERROR: 'keyLoadError',\n // Identifier for decrypt key load timeout error - data: { frag : fragment object}\n KEY_LOAD_TIMEOUT: 'keyLoadTimeOut',\n // Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType }\n BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError',\n // Identifier for a buffer append error - data: append error description\n BUFFER_APPEND_ERROR: 'bufferAppendError',\n // Identifier for a buffer appending error event - data: appending error description\n BUFFER_APPENDING_ERROR: 'bufferAppendingError',\n // Identifier for a buffer stalled error event\n BUFFER_STALLED_ERROR: 'bufferStalledError',\n // Identifier for a buffer full event\n BUFFER_FULL_ERROR: 'bufferFullError',\n // Identifier for a buffer seek over hole event\n BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',\n // Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException'\n};\n\n},{}],27:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\n *\n * All objects in the event handling chain should inherit from this class\n *\n */\n\nvar _logger = _dereq_(45);\n\nvar _errors = _dereq_(26);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar EventHandler = function () {\n function EventHandler(hls) {\n _classCallCheck(this, EventHandler);\n\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n\n for (var _len = arguments.length, events = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n events[_key - 1] = arguments[_key];\n }\n\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n _createClass(EventHandler, [{\n key: 'destroy',\n value: function destroy() {\n this.unregisterListeners();\n }\n }, {\n key: 'isEventHandler',\n value: function isEventHandler() {\n return _typeof(this.handledEvents) === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n if (event === 'hlsEventGeneric') {\n throw new Error('Forbidden event name: ' + event);\n }\n this.hls.on(event, this.onEvent);\n }.bind(this));\n }\n }\n }, {\n key: 'unregisterListeners',\n value: function unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function (event) {\n this.hls.off(event, this.onEvent);\n }.bind(this));\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n\n }, {\n key: 'onEvent',\n value: function onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n }, {\n key: 'onEventGeneric',\n value: function onEventGeneric(event, data) {\n var eventToFunction = function eventToFunction(event, data) {\n var funcName = 'on' + event.replace('hls', '');\n if (typeof this[funcName] !== 'function') {\n throw new Error('Event ' + event + ' has no generic handler in this ' + this.constructor.name + ' class (tried ' + funcName + ')');\n }\n return this[funcName].bind(this, data);\n };\n try {\n eventToFunction.call(this, event, data).call();\n } catch (err) {\n _logger.logger.error('internal error happened while processing ' + event + ':' + err.message);\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });\n }\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;\n\n},{\"26\":26,\"28\":28,\"45\":45}],28:[function(_dereq_,module,exports){\n'use strict';\n\nmodule.exports = {\n // fired before MediaSource is attaching to media element - data: { media }\n MEDIA_ATTACHING: 'hlsMediaAttaching',\n // fired when MediaSource has been succesfully attached to media element - data: { }\n MEDIA_ATTACHED: 'hlsMediaAttached',\n // fired before detaching MediaSource from media element - data: { }\n MEDIA_DETACHING: 'hlsMediaDetaching',\n // fired when MediaSource has been detached from media element - data: { }\n MEDIA_DETACHED: 'hlsMediaDetached',\n // fired when we buffer is going to be resetted\n BUFFER_RESET: 'hlsBufferReset',\n // fired when we know about the codecs that we need buffers for to push into - data: {tracks : { container, codec, levelCodec, initSegment, metadata }}\n BUFFER_CODECS: 'hlsBufferCodecs',\n // fired when sourcebuffers have been created data: { tracks : tracks}\n BUFFER_CREATED: 'hlsBufferCreated',\n // fired when we append a segment to the buffer - data: { segment: segment object }\n BUFFER_APPENDING: 'hlsBufferAppending',\n // fired when we are done with appending a media segment to the buffer data : { parent : segment parent that triggered BUFFER_APPENDING , pending : nb of segments waiting for appending for this segment parent}\n BUFFER_APPENDED: 'hlsBufferAppended',\n // fired when the stream is finished and we want to notify the media buffer that there will be no more data\n BUFFER_EOS: 'hlsBufferEos',\n // fired when the media buffer should be flushed - data {startOffset, endOffset}\n BUFFER_FLUSHING: 'hlsBufferFlushing',\n // fired when the media has been flushed\n BUFFER_FLUSHED: 'hlsBufferFlushed',\n // fired to signal that a manifest loading starts - data: { url : manifestURL}\n MANIFEST_LOADING: 'hlsManifestLoading',\n // fired after manifest has been loaded - data: { levels : [available quality levels] , audioTracks : [ available audio tracks], url : manifestURL, stats : { trequest, tfirst, tload, mtime}}\n MANIFEST_LOADED: 'hlsManifestLoaded',\n // fired after manifest has been parsed - data: { levels : [available quality levels] , firstLevel : index of first quality level appearing in Manifest}\n MANIFEST_PARSED: 'hlsManifestParsed',\n // fired when a level playlist loading starts - data: { url : level URL level : id of level being loaded}\n LEVEL_LOADING: 'hlsLevelLoading',\n // fired when a level playlist loading finishes - data: { details : levelDetails object, level : id of loaded level, stats : { trequest, tfirst, tload, mtime} }\n LEVEL_LOADED: 'hlsLevelLoaded',\n // fired when a level's details have been updated based on previous details, after it has been loaded. - data: { details : levelDetails object, level : id of updated level }\n LEVEL_UPDATED: 'hlsLevelUpdated',\n // fired when a level's PTS information has been updated after parsing a fragment - data: { details : levelDetails object, level : id of updated level, drift: PTS drift observed when parsing last fragment }\n LEVEL_PTS_UPDATED: 'hlsLevelPtsUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired to notify that audio track lists has been updated data: { audioTracks : audioTracks}\n AUDIO_TRACKS_UPDATED: 'hlsAudioTracksUpdated',\n // fired when an audio track switch occurs - data: { id : audio track id} // deprecated\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id}\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id}\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\n // fired when an audio track loading starts - data: { url : audio track URL id : audio track id}\n AUDIO_TRACK_LOADING: 'hlsAudioTrackLoading',\n // fired when an audio track loading finishes - data: { details : levelDetails object, id : audio track id, stats : { trequest, tfirst, tload, mtime} }\n AUDIO_TRACK_LOADED: 'hlsAudioTrackLoaded',\n // fired when the first timestamp is found. - data: { id : demuxer id, initPTS: initPTS }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\n // fired when a fragment loading starts - data: { frag : fragment object}\n FRAG_LOADING: 'hlsFragLoading',\n // fired when a fragment loading is progressing - data: { frag : fragment object, { trequest, tfirst, loaded}}\n FRAG_LOAD_PROGRESS: 'hlsFragLoadProgress',\n // Identifier for fragment load aborting for emergency switch down - data: {frag : fragment object}\n FRAG_LOAD_EMERGENCY_ABORTED: 'hlsFragLoadEmergencyAborted',\n // fired when a fragment loading is completed - data: { frag : fragment object, payload : fragment payload, stats : { trequest, tfirst, tload, length}}\n FRAG_LOADED: 'hlsFragLoaded',\n // fired when a fragment has finished decrypting - data: { level : levelId, sn : sequence number }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // fired when Init Segment has been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, , level : levelId, sn : sequence number, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // fired when data have been extracted from fragment - data: { id : demuxer id, level : levelId, sn : sequence number, data1 : moof MP4 box or TS fragments, data2 : mdat MP4 box or null}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id; level : levelId, sn : sequence number, }\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { id : demuxer id,frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current media position is changing - data : { id : demuxer id, frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFpsDrop',\n //triggered when FPS drop triggers auto level capping - data: {level, droppedlevel}\n FPS_DROP_LEVEL_CAPPING: 'hlsFpsDropLevelCapping',\n // Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}\n ERROR: 'hlsError',\n // fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n // fired when a decrypt key loading starts - data: { frag : fragment object}\n KEY_LOADING: 'hlsKeyLoading',\n // fired when a decrypt key loading is completed - data: { frag : fragment object, payload : key payload, stats : { trequest, tfirst, tload, length}}\n KEY_LOADED: 'hlsKeyLoaded',\n // fired upon stream controller state transitions - data: {previousState, nextState}\n STREAM_STATE_TRANSITION: 'hlsStreamStateTransition'\n};\n\n},{}],29:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * AAC helper\n */\n\nvar AAC = function () {\n function AAC() {\n _classCallCheck(this, AAC);\n }\n\n _createClass(AAC, null, [{\n key: 'getSilentFrame',\n value: function getSilentFrame(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0:d=0.05\" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 2) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 3) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Buffer Helper class, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = function () {\n function BufferHelper() {\n _classCallCheck(this, BufferHelper);\n }\n\n _createClass(BufferHelper, null, [{\n key: \"isBuffered\",\n value: function isBuffered(media, position) {\n if (media) {\n var buffered = media.buffered;\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n return false;\n }\n }, {\n key: \"bufferInfo\",\n value: function bufferInfo(media, pos, maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered,\n buffered = [],\n i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({ start: vbuffered.start(i), end: vbuffered.end(i) });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n } else {\n return { len: 0, start: 0, end: 0, nextStart: undefined };\n }\n }\n }, {\n key: \"bufferedInfo\",\n value: function bufferedInfo(buffered, pos, maxHoleDuration) {\n var buffered2 = [],\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,\n bufferStart,\n bufferEnd,\n bufferStartNext,\n i;\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n for (i = 0, bufferLen = 0, bufferStart = bufferEnd = pos; i < buffered2.length; i++) {\n var start = buffered2[i].start,\n end = buffered2[i].end;\n //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return { len: bufferLen, start: bufferStart, end: bufferEnd, nextStart: bufferStartNext };\n }\n }]);\n\n return BufferHelper;\n}();\n\nexports.default = BufferHelper;\n\n},{}],31:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LevelHelper = function () {\n function LevelHelper() {\n _classCallCheck(this, LevelHelper);\n }\n\n _createClass(LevelHelper, null, [{\n key: 'mergeDetails',\n value: function mergeDetails(oldDetails, newDetails) {\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN,\n end = Math.min(oldDetails.endSN, newDetails.endSN) - newDetails.startSN,\n delta = newDetails.startSN - oldDetails.startSN,\n oldfragments = oldDetails.fragments,\n newfragments = newDetails.fragments,\n ccOffset = 0,\n PTSFrag;\n\n // check if old/new playlists have fragments in common\n if (end < start) {\n newDetails.PTSKnown = false;\n return;\n }\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n for (var i = start; i <= end; i++) {\n var oldFrag = oldfragments[delta + i],\n newFrag = newfragments[i];\n if (newFrag && oldFrag) {\n ccOffset = oldFrag.cc - newFrag.cc;\n if (!isNaN(oldFrag.startPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.duration = oldFrag.duration;\n PTSFrag = newFrag;\n }\n }\n }\n\n if (ccOffset) {\n _logger.logger.log('discontinuity sliding from playlist, take drift into account');\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].cc += ccOffset;\n }\n }\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n LevelHelper.updateFragPTSDTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldfragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n if (delta >= 0 && delta < oldfragments.length) {\n // adjust start by sliding offset\n var sliding = oldfragments[delta].start;\n for (i = 0; i < newfragments.length; i++) {\n newfragments[i].start += sliding;\n }\n }\n }\n // if we are here, it means we have fragments overlapping between\n // old and new level. reliable PTS info is thus relying on old level\n newDetails.PTSKnown = oldDetails.PTSKnown;\n return;\n }\n }, {\n key: 'updateFragPTSDTS',\n value: function updateFragPTSDTS(details, sn, startPTS, endPTS, startDTS, endDTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\n if (!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(frag.startPTS - startPTS);\n if (isNaN(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n startPTS = Math.min(startPTS, frag.startPTS);\n endPTS = Math.max(endPTS, frag.endPTS);\n startDTS = Math.min(startDTS, frag.startDTS);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n\n var drift = startPTS - frag.start;\n\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n LevelHelper.updatePTS(fragments, i, i - 1);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n LevelHelper.updatePTS(fragments, i, i + 1);\n }\n details.PTSKnown = true;\n //logger.log(` frag start/end:${startPTS.toFixed(3)}/${endPTS.toFixed(3)}`);\n\n return drift;\n }\n }, {\n key: 'updatePTS',\n value: function updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],\n fragTo = fragments[toIdx],\n fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if (!isNaN(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n if (toIdx > fromIdx) {\n fragFrom.duration = fragToPTS - fragFrom.start;\n if (fragFrom.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragFrom.sn + ',level ' + fragFrom.level + ', there should be some duration drift between playlist and fragment!');\n }\n } else {\n fragTo.duration = fragFrom.start - fragToPTS;\n if (fragTo.duration < 0) {\n _logger.logger.warn('negative duration computed for frag ' + fragTo.sn + ',level ' + fragTo.level + ', there should be some duration drift between playlist and fragment!');\n }\n }\n } else {\n // we dont know startPTS[toIdx]\n if (toIdx > fromIdx) {\n fragTo.start = fragFrom.start + fragFrom.duration;\n } else {\n fragTo.start = fragFrom.start - fragTo.duration;\n }\n }\n }\n }]);\n\n return LevelHelper;\n}();\n\nexports.default = LevelHelper;\n\n},{\"45\":45}],32:[function(_dereq_,module,exports){\n/**\n * HLS interface\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n//import FetchLoader from './utils/fetch-loader';\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(26);\n\nvar _playlistLoader = _dereq_(36);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(34);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _abrController = _dereq_(4);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(7);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(8);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _audioStreamController = _dereq_(5);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _streamController = _dereq_(12);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(11);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _timelineController = _dereq_(13);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _audioTrackController = _dereq_(6);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _logger = _dereq_(45);\n\nvar _xhrLoader = _dereq_(47);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _keyLoader = _dereq_(35);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _cues = _dereq_(43);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Hls = function () {\n _createClass(Hls, null, [{\n key: 'isSupported',\n value: function isSupported() {\n window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n return window.MediaSource && typeof window.MediaSource.isTypeSupported === 'function' && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.6.21';\n }\n }, {\n key: 'Events',\n get: function get() {\n return _events2.default;\n }\n }, {\n key: 'ErrorTypes',\n get: function get() {\n return _errors.ErrorTypes;\n }\n }, {\n key: 'ErrorDetails',\n get: function get() {\n return _errors.ErrorDetails;\n }\n }, {\n key: 'DefaultConfig',\n get: function get() {\n if (!Hls.defaultConfig) {\n Hls.defaultConfig = {\n autoStartLoad: true,\n startPosition: -1,\n defaultAudioCodec: undefined,\n debug: false,\n capLevelOnFPSDrop: false,\n capLevelToPlayerSize: false,\n initialLiveManifestSize: 1,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n maxBufferHole: 0.5,\n maxMaxBufferLength: 600,\n maxSeekHole: 2,\n lowBufferWatchdogPeriod: 0.5,\n highBufferWatchdogPeriod: 3,\n nudgeOffset: 0.1,\n nudgeMaxRetry: 3,\n maxFragLookUpTolerance: 0.2,\n liveSyncDurationCount: 3,\n liveMaxLatencyDurationCount: Infinity,\n liveSyncDuration: undefined,\n liveMaxLatencyDuration: undefined,\n enableWorker: true,\n enableSoftwareAES: true,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n manifestLoadingMaxRetryTimeout: 64000,\n startLevel: undefined,\n levelLoadingTimeOut: 10000,\n levelLoadingMaxRetry: 4,\n levelLoadingRetryDelay: 1000,\n levelLoadingMaxRetryTimeout: 64000,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 1000,\n fragLoadingMaxRetryTimeout: 64000,\n fragLoadingLoopThreshold: 3,\n startFragPrefetch: false,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 3,\n loader: _xhrLoader2.default,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: _abrController2.default,\n bufferController: _bufferController2.default,\n capLevelController: _capLevelController2.default,\n fpsController: _fpsController2.default,\n streamController: _streamController2.default,\n audioStreamController: _audioStreamController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true,\n enableMP2TPassThrough: false,\n stretchShortVideoTrack: false,\n forceKeyFrameOnDiscontinuity: true,\n abrEwmaFastLive: 3,\n abrEwmaSlowLive: 9,\n abrEwmaFastVoD: 3,\n abrEwmaSlowVoD: 9,\n abrEwmaDefaultEstimate: 5e5, // 500 kbps\n abrBandWidthFactor: 0.95,\n abrBandWidthUpFactor: 0.7,\n maxStarvationDelay: 4,\n maxLoadingDelay: 4,\n minAutoBitrate: 0\n };\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Hls);\n\n var defaultConfig = Hls.DefaultConfig;\n\n if ((config.liveSyncDurationCount || config.liveMaxLatencyDurationCount) && (config.liveSyncDuration || config.liveMaxLatencyDuration)) {\n throw new Error('Illegal hls.js config: don\\'t mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration');\n }\n\n for (var prop in defaultConfig) {\n if (prop in config) {\n continue;\n }\n config[prop] = defaultConfig[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');\n }\n\n if (config.liveMaxLatencyDuration !== undefined && (config.liveMaxLatencyDuration <= config.liveSyncDuration || config.liveSyncDuration === undefined)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');\n }\n\n (0, _logger.enableLogs)(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new _events4.default();\n observer.trigger = function trigger(event) {\n for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n\n observer.emit.apply(observer, [event, event].concat(data));\n };\n\n observer.off = function off(event) {\n for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n data[_key2 - 1] = arguments[_key2];\n }\n\n observer.removeListener.apply(observer, [event].concat(data));\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n this.playlistLoader = new _playlistLoader2.default(this);\n this.fragmentLoader = new _fragmentLoader2.default(this);\n this.levelController = new _levelController2.default(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new config.bufferController(this);\n this.capLevelController = new config.capLevelController(this);\n this.fpsController = new config.fpsController(this);\n this.streamController = new config.streamController(this);\n this.audioStreamController = new config.audioStreamController(this);\n this.timelineController = new config.timelineController(this);\n this.audioTrackController = new _audioTrackController2.default(this);\n this.keyLoader = new _keyLoader2.default(this);\n }\n\n _createClass(Hls, [{\n key: 'destroy',\n value: function destroy() {\n _logger.logger.log('destroy');\n this.trigger(_events2.default.DESTROYING);\n this.detachMedia();\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.abrController.destroy();\n this.bufferController.destroy();\n this.capLevelController.destroy();\n this.fpsController.destroy();\n this.streamController.destroy();\n this.audioStreamController.destroy();\n this.timelineController.destroy();\n this.audioTrackController.destroy();\n this.keyLoader.destroy();\n this.url = null;\n this.observer.removeAllListeners();\n }\n }, {\n key: 'attachMedia',\n value: function attachMedia(media) {\n _logger.logger.log('attachMedia');\n this.media = media;\n this.trigger(_events2.default.MEDIA_ATTACHING, { media: media });\n }\n }, {\n key: 'detachMedia',\n value: function detachMedia() {\n _logger.logger.log('detachMedia');\n this.trigger(_events2.default.MEDIA_DETACHING);\n this.media = null;\n }\n }, {\n key: 'loadSource',\n value: function loadSource(url) {\n _logger.logger.log('loadSource:' + url);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events2.default.MANIFEST_LOADING, { url: url });\n }\n }, {\n key: 'startLoad',\n value: function startLoad() {\n var startPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.levelController.startLoad();\n this.streamController.startLoad(startPosition);\n this.audioStreamController.startLoad(startPosition);\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.levelController.stopLoad();\n this.streamController.stopLoad();\n this.audioStreamController.stopLoad();\n }\n }, {\n key: 'swapAudioCodec',\n value: function swapAudioCodec() {\n _logger.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n }, {\n key: 'recoverMediaError',\n value: function recoverMediaError() {\n _logger.logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n\n }, {\n key: 'levels',\n get: function get() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n\n }, {\n key: 'currentLevel',\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set currentLevel:' + newLevel);\n this.loadLevel = newLevel;\n this.streamController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n\n }, {\n key: 'nextLevel',\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set nextLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n\n }, {\n key: 'loadLevel',\n get: function get() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n ,\n set: function set(newLevel) {\n _logger.logger.log('set loadLevel:' + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n\n }, {\n key: 'nextLoadLevel',\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n ,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n\n }, {\n key: 'firstLevel',\n get: function get() {\n return Math.max(this.levelController.firstLevel, this.abrController.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set firstLevel:' + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /** Return start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n\n }, {\n key: 'startLevel',\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /** set start level (level of first fragment that will be played back)\n if not overrided by user, first level appearing in manifest will be used as start level\n if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)\n **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set startLevel:' + newLevel);\n this.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n\n }, {\n key: 'autoLevelCapping',\n get: function get() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n ,\n set: function set(newLevel) {\n _logger.logger.log('set autoLevelCapping:' + newLevel);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n\n }, {\n key: 'autoLevelEnabled',\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /* return manual level */\n\n }, {\n key: 'manualLevel',\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n return this.audioTrackController.audioTracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n\n }, {\n key: 'audioTrack',\n get: function get() {\n return this.audioTrackController.audioTrack;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n this.audioTrackController.audioTrack = audioTrackId;\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"26\":26,\"28\":28,\"34\":34,\"35\":35,\"36\":36,\"4\":4,\"43\":43,\"45\":45,\"47\":47,\"5\":5,\"6\":6,\"7\":7,\"8\":8}],33:[function(_dereq_,module,exports){\n'use strict';\n\n// This is mostly for support of the es6 module export\n// syntax with the babel compiler, it looks like it doesnt support\n// function exports like we are used to in node/commonjs\nmodule.exports = _dereq_(32).default;\n\n},{\"32\":32}],34:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Fragment Loader\n */\n\nvar FragmentLoader = function (_EventHandler) {\n _inherits(FragmentLoader, _EventHandler);\n\n function FragmentLoader(hls) {\n _classCallCheck(this, FragmentLoader);\n\n var _this = _possibleConstructorReturn(this, (FragmentLoader.__proto__ || Object.getPrototypeOf(FragmentLoader)).call(this, hls, _events2.default.FRAG_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(FragmentLoader, [{\n key: 'destroy',\n value: function destroy() {\n var loaders = this.loaders;\n for (var loaderName in loaders) {\n var loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onFragLoading',\n value: function onFragLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n config = this.hls.config;\n\n frag.loaded = 0;\n if (loader) {\n _logger.logger.warn('abort previous fragment loader for type:' + type);\n loader.abort();\n }\n loader = this.loaders[type] = frag.loader = typeof config.fLoader !== 'undefined' ? new config.fLoader(config) : new config.loader(config);\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: frag.url, frag: frag, responseType: 'arraybuffer', progressData: false };\n var start = frag.byteRangeStartOffset,\n end = frag.byteRangeEndOffset;\n if (!isNaN(start) && !isNaN(end)) {\n loaderContext.rangeStart = start;\n loaderContext.rangeEnd = end;\n }\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: 0, retryDelay: 0, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this), onProgress: this.loadprogress.bind(this) };\n loader.load(loaderContext, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var payload = response.data,\n frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n // jshint ignore:line\n var frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],35:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Decrypt key Loader\n */\n\nvar KeyLoader = function (_EventHandler) {\n _inherits(KeyLoader, _EventHandler);\n\n function KeyLoader(hls) {\n _classCallCheck(this, KeyLoader);\n\n var _this = _possibleConstructorReturn(this, (KeyLoader.__proto__ || Object.getPrototypeOf(KeyLoader)).call(this, hls, _events2.default.KEY_LOADING));\n\n _this.loaders = {};\n _this.decryptkey = null;\n _this.decrypturl = null;\n return _this;\n }\n\n _createClass(KeyLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onKeyLoading',\n value: function onKeyLoading(data) {\n var frag = data.frag,\n type = frag.type,\n loader = this.loaders[type],\n decryptdata = frag.decryptdata,\n uri = decryptdata.uri;\n // if uri is different from previous one or if decrypt key not retrieved yet\n if (uri !== this.decrypturl || this.decryptkey === null) {\n var config = this.hls.config;\n\n if (loader) {\n _logger.logger.warn('abort previous key loader for type:' + type);\n loader.abort();\n }\n frag.loader = this.loaders[type] = new config.loader(config);\n this.decrypturl = uri;\n this.decryptkey = null;\n\n var loaderContext = void 0,\n loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderContext = { url: uri, frag: frag, responseType: 'arraybuffer' };\n loaderConfig = { timeout: config.fragLoadingTimeOut, maxRetry: config.fragLoadingMaxRetry, retryDelay: config.fragLoadingRetryDelay, maxRetryDelay: config.fragLoadingMaxRetryTimeout };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n frag.loader.load(loaderContext, loaderConfig, loaderCallbacks);\n } else if (this.decryptkey) {\n // we already loaded this key, return it\n decryptdata.key = this.decryptkey;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var frag = context.frag;\n this.decryptkey = frag.decryptdata.key = new Uint8Array(response.data);\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(_events2.default.KEY_LOADED, { frag: frag });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag });\n }\n }]);\n\n return KeyLoader;\n}(_eventHandler2.default);\n\nexports.default = KeyLoader;\n\n},{\"26\":26,\"27\":27,\"28\":28,\"45\":45}],36:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(27);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(26);\n\nvar _attrList = _dereq_(40);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(45);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nvar LEVEL_PLAYLIST_REGEX_SLOW = /(?:(?:#(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\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri);\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n value: function createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n\n return uint8View;\n }\n\n /**\n * Utility method for parseLevelPlaylist to get a fragment's decryption data from the currently parsed encryption key data\n * @param levelkey - a playlist's encryption info\n * @param segmentNumber - the fragment's segment number\n * @returns {*} - an object to be applied as a fragment's decryptdata\n */\n\n }, {\n key: 'fragmentDecryptdataFromLevelkey',\n value: function fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl);\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\n}();\n\nvar PlaylistLoader = function (_EventHandler) {\n _inherits(PlaylistLoader, _EventHandler);\n\n function PlaylistLoader(hls) {\n _classCallCheck(this, PlaylistLoader);\n\n var _this = _possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this, hls, _events2.default.MANIFEST_LOADING, _events2.default.LEVEL_LOADING, _events2.default.AUDIO_TRACK_LOADING));\n\n _this.loaders = {};\n return _this;\n }\n\n _createClass(PlaylistLoader, [{\n key: 'destroy',\n value: function destroy() {\n for (var loaderName in this.loaders) {\n var loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n _eventHandler2.default.prototype.destroy.call(this);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading(data) {\n this.load(data.url, { type: 'manifest' });\n }\n }, {\n key: 'onLevelLoading',\n value: function onLevelLoading(data) {\n this.load(data.url, { type: 'level', level: data.level, id: data.id });\n }\n }, {\n key: 'onAudioTrackLoading',\n value: function onAudioTrackLoading(data) {\n this.load(data.url, { type: 'audioTrack', id: data.id });\n }\n }, {\n key: 'load',\n value: function load(url, context) {\n var loader = this.loaders[context.type];\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n _logger.logger.trace('playlist request ongoing');\n return;\n } else {\n _logger.logger.warn('abort previous loader for type:' + context.type);\n loader.abort();\n }\n }\n var config = this.hls.config,\n retry = void 0,\n timeout = void 0,\n retryDelay = void 0,\n maxRetryDelay = void 0;\n if (context.type === 'manifest') {\n retry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeout;\n } else {\n retry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeout;\n _logger.logger.log('loading playlist for ' + context.type + ' ' + (context.level || context.id));\n }\n loader = this.loaders[context.type] = context.loader = typeof config.pLoader !== 'undefined' ? new config.pLoader(config) : new config.loader(config);\n context.url = url;\n context.responseType = '';\n\n var loaderConfig = void 0,\n loaderCallbacks = void 0;\n loaderConfig = { timeout: timeout, maxRetry: retry, retryDelay: retryDelay, maxRetryDelay: maxRetryDelay };\n loaderCallbacks = { onSuccess: this.loadsuccess.bind(this), onError: this.loaderror.bind(this), onTimeout: this.loadtimeout.bind(this) };\n loader.load(context, loaderConfig, loaderCallbacks);\n }\n }, {\n key: 'resolve',\n value: function resolve(url, baseUrl) {\n return _urlToolkit2.default.buildAbsoluteURL(baseUrl, url);\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {\n var level = {};\n\n var attrs = level.attrs = new _attrList2.default(result[1]);\n level.url = this.resolve(result[2], baseurl);\n\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n level.bitrate = attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH');\n level.name = attrs.NAME;\n\n var codecs = attrs.CODECS;\n if (codecs) {\n codecs = codecs.split(/[ ,]+/);\n for (var i = 0; i < codecs.length; i++) {\n var codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n }, {\n key: 'parseMasterPlaylistMedia',\n value: function parseMasterPlaylistMedia(string, baseurl, type) {\n var result = void 0,\n medias = [];\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null) {\n var media = {};\n var attrs = new _attrList2.default(result[1]);\n if (attrs.TYPE === type) {\n media.groupId = attrs['GROUP-ID'];\n media.name = attrs.NAME;\n media.type = type;\n media.default = attrs.DEFAULT === 'YES';\n media.autoselect = attrs.AUTOSELECT === 'YES';\n media.forced = attrs.FORCED === 'YES';\n if (attrs.URI) {\n media.url = this.resolve(attrs.URI, baseurl);\n }\n media.lang = attrs.LANGUAGE;\n if (!media.name) {\n media.name = media.lang;\n }\n medias.push(media);\n }\n }\n return medias;\n }\n }, {\n key: 'avc1toavcoti',\n value: function avc1toavcoti(codec) {\n var result,\n avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n }, {\n key: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/dailymotion/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new _attrList2.default(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if (decrypturi && decryptmethod === 'AES-128') {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\n var startAttrs = new _attrList2.default(startParams);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if (!isNaN(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\n level.fragments.pop();\n totalduration -= frag.duration;\n }\n level.totalduration = totalduration;\n level.averagetargetduration = totalduration / level.fragments.length;\n level.endSN = currentSN - 1;\n return level;\n }\n }, {\n key: 'loadsuccess',\n value: function loadsuccess(response, stats, context) {\n var string = response.data,\n url = response.url,\n type = context.type,\n id = context.id,\n level = context.level,\n hls = this.hls;\n\n this.loaders[type] = undefined;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n stats.tload = performance.now();\n //stats.mtime = new Date(target.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n var isLevel = type !== 'audioTrack',\n levelDetails = this.parseLevelPlaylist(string, url, (isLevel ? level : id) || 0, isLevel ? 'main' : 'audio');\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: [{ url: url, details: levelDetails }], audioTracks: [], url: url, stats: stats });\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' });\n }\n } else {\n var levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n var audiotracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n if (audiotracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = false;\n audiotracks.forEach(function (audioTrack) {\n if (!audioTrack.url) {\n embeddedAudioFound = true;\n }\n });\n // if no embedded audio track defined, but audio codec signaled in quality level, we need to signal this main audio track\n // this could happen with playlists with alt audio rendition in which quality levels (main) contains both audio+video. but with mixed audio track not signaled\n if (embeddedAudioFound === false && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _logger.logger.log('audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audiotracks.unshift({ type: 'main', name: 'main' });\n }\n }\n hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audiotracks, url: url, stats: stats });\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest' });\n }\n }\n } else {\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter' });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var details,\n fatal,\n loader = context.loader;\n switch (context.type) {\n case 'manifest':\n details = _errors.ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = _errors.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT;\n fatal = false;\n break;\n }\n if (loader) {\n loader.abort();\n this.loaders[context.type] = undefined;\n }\n this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"2\":2,\"26\":26,\"27\":27,\"28\":28,\"40\":40,\"45\":45}],37:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\nvar MP4 = function () {\n function MP4() {\n _classCallCheck(this, MP4);\n }\n\n _createClass(MP4, null, [{\n key: 'init',\n value: function init() {\n MP4.types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n var videoHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': videoHdlr,\n 'audio': audioHdlr\n };\n\n var dref = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n\n MP4.STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00]);\n MP4.VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n }\n }, {\n key: 'box',\n value: function box(type) {\n var payload = Array.prototype.slice.call(arguments, 1),\n size = 8,\n i = payload.length,\n len = i,\n result;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n }, {\n key: 'hdlr',\n value: function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n }, {\n key: 'mdat',\n value: function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n }, {\n key: 'mdhd',\n value: function mdhd(timescale, duration) {\n duration *= timescale;\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]));\n }\n }, {\n key: 'mdia',\n value: function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n }\n }, {\n key: 'mfhd',\n value: function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xFF, sequenceNumber >> 8 & 0xFF, sequenceNumber & 0xFF]));\n }\n }, {\n key: 'minf',\n value: function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n }\n }, {\n key: 'moof',\n value: function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */\n\n }, {\n key: 'moov',\n value: function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n }\n }, {\n key: 'mvex',\n value: function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n }\n }, {\n key: 'mvhd',\n value: function mvhd(timescale, duration) {\n duration *= timescale;\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n duration >> 24 & 0xFF, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return MP4.box(MP4.types.mvhd, bytes);\n }\n }, {\n key: 'sdtp',\n value: function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n }, {\n key: 'stbl',\n value: function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n }\n }, {\n key: 'avc1',\n value: function avc1(track) {\n var sps = [],\n pps = [],\n i,\n data,\n len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xFF);\n sps.push(len & 0xFF);\n sps = sps.concat(Array.prototype.slice.call(data)); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xFF);\n pps.push(len & 0xFF);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01, // version\n sps[3], // profile\n sps[4], // profile compat\n sps[5], // level\n 0xfc | 3, // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xE0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))),\n // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n width >> 8 & 0xFF, width & 0xff, // width\n height >> 8 & 0xFF, height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x68, 0x6C, 0x73, 0x2E, 0x6A, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\n }\n }, {\n key: 'esds',\n value: function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17 + configlen, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f + configlen, // length\n 0x40, //codec : mpeg4_audio\n 0x15, // stream_type\n 0x00, 0x00, 0x00, // buffer_size\n 0x00, 0x00, 0x00, 0x00, // maxBitrate\n 0x00, 0x00, 0x00, 0x00, // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n }, {\n key: 'mp4a',\n value: function mp4a(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var audiosamplerate = track.audiosamplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n audiosamplerate >> 8 & 0xFF, audiosamplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n }\n }, {\n key: 'tkhd',\n value: function tkhd(track) {\n var id = track.id,\n duration = track.duration * track.timescale,\n width = track.width,\n height = track.height;\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n duration >> 24, duration >> 16 & 0xFF, duration >> 8 & 0xFF, duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x00, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n width >> 8 & 0xFF, width & 0xFF, 0x00, 0x00, // width\n height >> 8 & 0xFF, height & 0xFF, 0x00, 0x00 // height\n ]));\n }\n }, {\n key: 'traf',\n value: function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id;\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF])), MP4.box(MP4.types.tfdt, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n baseMediaDecodeTime >> 24, baseMediaDecodeTime >> 16 & 0XFF, baseMediaDecodeTime >> 8 & 0XFF, baseMediaDecodeTime & 0xFF])), MP4.trun(track, sampleDependencyTable.length + 16 + // tfhd\n 16 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8), // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n }, {\n key: 'trak',\n value: function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n }, {\n key: 'trex',\n value: function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n id >> 24, id >> 16 & 0XFF, id >> 8 & 0XFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n }\n }, {\n key: 'trun',\n value: function trun(track, offset) {\n var samples = track.samples || [],\n len = samples.length,\n arraylen = 12 + 16 * len,\n array = new Uint8Array(arraylen),\n i,\n sample,\n duration,\n size,\n flags,\n cts;\n offset += 8 + arraylen;\n array.set([0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n len >>> 24 & 0xFF, len >>> 16 & 0xFF, len >>> 8 & 0xFF, len & 0xFF, // sample_count\n offset >>> 24 & 0xFF, offset >>> 16 & 0xFF, offset >>> 8 & 0xFF, offset & 0xFF // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xFF, duration >>> 16 & 0xFF, duration >>> 8 & 0xFF, duration & 0xFF, // sample_duration\n size >>> 24 & 0xFF, size >>> 16 & 0xFF, size >>> 8 & 0xFF, size & 0xFF, // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xF0 << 8, flags.degradPrio & 0x0F, // sample_flags\n cts >>> 24 & 0xFF, cts >>> 16 & 0xFF, cts >>> 8 & 0xFF, cts & 0xFF // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n }, {\n key: 'initSegment',\n value: function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks),\n result;\n result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n }\n }]);\n\n return MP4;\n}();\n\nexports.default = MP4;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * fMP4 remuxer\n */\n\nvar _aac = _dereq_(29);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(45);\n\nvar _mp4Generator = _dereq_(37);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(26);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, id, config, typeSupported) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.id = id;\n this.config = config;\n this.typeSupported = typeSupported;\n this.ISGenerated = false;\n this.PES2MP4SCALEFACTOR = 4;\n this.PES_TIMESCALE = 90000;\n this.MP4_TIMESCALE = this.PES_TIMESCALE / this.PES2MP4SCALEFACTOR;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {\n this._initPTS = this._initDTS = undefined;\n }\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(level, sn, cc, audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, defaultInitPTS) {\n this.level = level;\n this.sn = sn;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset, cc);\n }\n\n if (defaultInitPTS !== null) {\n this._initPTS = this._initDTS = defaultInitPTS;\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n var audioData = this.remuxAudio(audioTrack, timeOffset, contiguous, accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n var audioTrackLength = void 0;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength);\n }\n } else {\n var videoData = void 0;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack, timeOffset, contiguous);\n }\n if (videoData && audioTrack.codec) {\n this.remuxEmptyAudio(audioTrack, timeOffset, contiguous, videoData);\n }\n }\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (id3Track.samples.length) {\n this.remuxID3(id3Track, timeOffset);\n }\n //logger.log('nb ID3 samples:' + audioTrack.samples.length);\n if (textTrack.samples.length) {\n this.remuxText(textTrack, timeOffset);\n }\n //notify end of parsing\n this.observer.trigger(_events2.default.FRAG_PARSED, { id: this.id, level: this.level, sn: this.sn });\n }\n }, {\n key: 'generateIS',\n value: function generateIS(audioTrack, videoTrack, timeOffset, cc) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n pesTimeScale = this.PES_TIMESCALE,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { id: this.id, level: this.level, sn: this.sn, tracks: tracks, unique: false },\n computePTSDTS = this._initPTS === undefined,\n initPTS,\n initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n audioTrack.timescale = audioTrack.audiosamplerate;\n // MP4 duration (track duration in seconds multiplied by timescale) is coded on 32 bits\n // we know that each AAC sample contains 1024 frames....\n // in order to avoid overflowing the 32 bit counter for large duration, we use smaller timescale (timescale/gcd)\n // we just need to ensure that AAC sample duration will still be an integer (will be 1024/gcd)\n if (audioTrack.timescale * audioTrack.duration > Math.pow(2, 32)) {\n (function () {\n var greatestCommonDivisor = function greatestCommonDivisor(a, b) {\n if (!b) {\n return a;\n }\n return greatestCommonDivisor(b, a % b);\n };\n audioTrack.timescale = audioTrack.audiosamplerate / greatestCommonDivisor(audioTrack.audiosamplerate, audioTrack.isAAC ? 1024 : 1152);\n })();\n }\n _logger.logger.log('audio mp4 timescale :' + audioTrack.timescale);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _mp4Generator2.default.initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - pesTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n videoTrack.timescale = this.MP4_TIMESCALE;\n tracks.video = {\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4Generator2.default.initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n initPTS = Math.min(initPTS, videoSamples[0].pts - pesTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - pesTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { id: this.id, initPTS: initPTS, cc: cc });\n }\n }\n\n if (Object.keys(tracks).length) {\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n } else {\n observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, id: this.id, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found' });\n }\n }\n }, {\n key: 'remuxVideo',\n value: function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var offset = 8,\n pesTimeScale = this.PES_TIMESCALE,\n pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.units.units;\n // let unitsString = '';\n // for (let j = 0; j < units.length ; j++) {\n // unitsString += units[j].type + ',';\n // if (units[j].data.length < 500) {\n // unitsString += Hex.hexDump(units[j].data);\n // }\n // }\n // logger.log(avcSample.pts + '/' + avcSample.dts + ',' + unitsString + avcSample.units.length);\n // }\n\n // sort video samples by DTS then PTS order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n return deltadts ? deltadts : a.pts - b.pts;\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n var PTSDTSshift = inputSamples.reduce(function (prev, curr) {\n return Math.max(Math.min(prev, curr.pts - curr.dts), -18000);\n }, 0);\n if (PTSDTSshift < 0) {\n _logger.logger.warn('PTS < DTS detected in video samples, shifting DTS by ' + Math.round(PTSDTSshift / 90) + ' ms to overcome this issue');\n for (var i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // ptsNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n var nextAvcDts = void 0;\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous) {\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n nextAvcDts = this.nextAvcDts;\n } else {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * pesTimeScale;\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n firstPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = Math.round((firstDTS - nextAvcDts) / 90);\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n if (delta) {\n if (delta > 1) {\n _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');\n } else if (delta < -1) {\n _logger.logger.log('AVC:' + -delta + ' ms overlapping between fragments detected');\n }\n // remove hole/gap : set DTS to next expected DTS\n firstDTS = nextAvcDts;\n inputSamples[0].dts = firstDTS + initDTS;\n // offset PTS as well, ensure that PTS is smaller or equal than new DTS\n firstPTS = Math.max(firstPTS - delta, nextAvcDts);\n inputSamples[0].pts = firstPTS + initDTS;\n _logger.logger.log('Video/PTS/DTS adjusted: ' + Math.round(firstPTS / 90) + '/' + Math.round(firstDTS / 90) + ',delta:' + delta + ' ms');\n }\n }\n nextDTS = firstDTS;\n\n // compute lastPTS/lastDTS\n sample = inputSamples[inputSamples.length - 1];\n lastDTS = Math.max(ptsNormalize(sample.dts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(ptsNormalize(sample.pts - initDTS, nextAvcDts), 0);\n lastPTS = Math.max(lastPTS, lastDTS);\n\n var vendor = navigator.vendor,\n userAgent = navigator.userAgent,\n isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n\n // on Safari let's signal the same sample duration for all samples\n // sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n if (isSafari) {\n mp4SampleDuration = Math.round((lastDTS - firstDTS) / (pes2mp4ScaleFactor * (inputSamples.length - 1)));\n }\n\n // normalize all PTS/DTS now ...\n for (var _i = 0; _i < nbSamples; _i++) {\n var _sample = inputSamples[_i];\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * pes2mp4ScaleFactor * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(ptsNormalize(_sample.dts - initDTS, nextAvcDts), firstDTS);\n // ensure dts is a multiple of scale factor to avoid rounding issues\n _sample.dts = Math.round(_sample.dts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n // we normalize PTS against nextAvcDts, we also substract initDTS (some streams don't start @ PTS O)\n // and we ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(ptsNormalize(_sample.pts - initDTS, nextAvcDts), _sample.dts);\n // ensure pts is a multiple of scale factor to avoid rounding issues\n _sample.pts = Math.round(_sample.pts / pes2mp4ScaleFactor) * pes2mp4ScaleFactor;\n }\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n var mdatSize = track.len + 4 * track.nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating video mdat ' + mdatSize });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var j = 0, nbUnits = avcSampleUnits.length; j < nbUnits; j++) {\n var unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n } else {\n var config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[_i2 > 0 ? _i2 - 1 : _i2].dts;\n if (config.stretchShortVideoTrack) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than the minimum of maxBufferHole and\n // maxSeekHole. If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * pesTimeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * pesTimeScale : this.nextAudioPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole/maxSeekHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n }\n _logger.logger.log('It is approximately ' + deltaToFrameEnd / 90 + ' ms to the next segment; using duration ' + mp4SampleDuration / 90 + ' ms for the last video frame.');\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n mp4SampleDuration /= pes2mp4ScaleFactor;\n compositionTimeOffset = Math.round((avcSample.pts - avcSample.dts) / pes2mp4ScaleFactor);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / (pes2mp4ScaleFactor * mp4SampleDuration)));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(avcSample.pts/4294967296).toFixed(3)}');\n outputSamples.push({\n size: mp4SampleLength,\n // constant duration\n duration: mp4SampleDuration,\n cts: compositionTimeOffset,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: avcSample.key ? 2 : 1,\n isNonSync: avcSample.key ? 0 : 1\n }\n });\n }\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n this.nextAvcDts = lastDTS + mp4SampleDuration * pes2mp4ScaleFactor;\n var dropped = track.dropped;\n track.len = 0;\n track.nbNalu = 0;\n track.dropped = 0;\n if (outputSamples.length && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n var flags = outputSamples[0].flags;\n // chrome workaround, mark first sample as being a Random Access Point to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n track.samples = outputSamples;\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n track.samples = [];\n\n var data = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: (lastPTS + pes2mp4ScaleFactor * mp4SampleDuration) / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: this.nextAvcDts / pesTimeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped: dropped\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, data);\n return data;\n }\n }, {\n key: 'remuxAudio',\n value: function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n expectedSampleDuration = track.timescale * (track.isAAC ? 1024 : 1152) / track.audiosamplerate,\n pesFrameDuration = expectedSampleDuration * pes2mp4ScaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var view,\n offset = rawMPEG ? 0 : 8,\n audioSample,\n mp4Sample,\n unit,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n lastDTS,\n pts,\n dts,\n ptsnorm,\n dtsnorm,\n outputSamples = [],\n inputSamples = [],\n fillFrame,\n newStamp,\n nextAudioPts;\n\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n inputSamples = track.samples;\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset and next expected PTS OR\n // - less than 20 audio frames distance\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n\n nextAudioPts = this.nextAudioPts;\n contiguous |= inputSamples.length && nextAudioPts && (Math.abs(timeOffset - nextAudioPts / pesTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - this._initDTS) < 20 * pesFrameDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * pesTimeScale;\n }\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPtsNorm = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n ptsNorm = ptsNormalize(sample.pts - initDTS, nextAudioPts),\n delta = ptsNorm - nextPtsNorm;\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -pesFrameDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(Math.abs(delta / 90)) + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n // Otherwise, if we're more than a frame away from where we should be, insert missing frames\n // also only inject silent audio frames if currentTime !== 0 (nextPtsNorm !== 0)\n else if (delta >= pesFrameDuration && nextPtsNorm) {\n var missing = Math.round(delta / pesFrameDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + Math.round(nextPtsNorm / 90) / 1000 + 's due to ' + Math.round(delta / 90) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n newStamp = nextPtsNorm + initDTS;\n newStamp = Math.max(newStamp, initDTS);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPtsNorm + initDTS;\n nextPtsNorm += pesFrameDuration;\n i += 1;\n }\n // Otherwise, we're within half a frame duration, so just adjust pts\n else {\n if (Math.abs(delta) > 0.1 * pesFrameDuration) {\n //logger.log(`Invalid frame delta ${Math.round(ptsNorm - nextPtsNorm + pesFrameDuration)} at PTS ${Math.round(ptsNorm / 90)} (should be ${Math.round(pesFrameDuration)}).`);\n }\n nextPtsNorm += pesFrameDuration;\n if (i === 0) {\n sample.pts = sample.dts = initDTS + nextAudioPts;\n } else {\n sample.pts = sample.dts = inputSamples[i - 1].pts + pesFrameDuration;\n }\n i += 1;\n }\n }\n }\n\n for (var _j = 0, _nbSamples = inputSamples.length; _j < _nbSamples; _j++) {\n audioSample = inputSamples[_j];\n unit = audioSample.unit;\n pts = audioSample.pts - initDTS;\n dts = audioSample.dts - initDTS;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastDTS !== undefined) {\n ptsnorm = ptsNormalize(pts, lastDTS);\n dtsnorm = ptsNormalize(dts, lastDTS);\n mp4Sample.duration = Math.round((dtsnorm - lastDTS) / pes2mp4ScaleFactor);\n } else {\n ptsnorm = ptsNormalize(pts, nextAudioPts);\n dtsnorm = ptsNormalize(dts, nextAudioPts);\n var _delta = Math.round(1000 * (ptsnorm - nextAudioPts) / pesTimeScale),\n numMissingFrames = 0;\n // if fragment are contiguous, detect hole/overlapping between fragments\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n if (contiguous && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0) {\n numMissingFrames = Math.round((ptsnorm - nextAudioPts) / pesFrameDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\n }\n track.len += numMissingFrames * fillFrame.length;\n }\n // if we have frame overlap, overlapping for more than half a frame duraion\n } else if (_delta < -12) {\n // drop overlapping audio frames... browser will deal with it\n _logger.logger.log(-_delta + ' ms overlapping between AAC samples detected, drop frame');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n ptsnorm = dtsnorm = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, ptsnorm);\n firstDTS = Math.max(0, dtsnorm);\n if (track.len > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n\n var mdatSize = rawMPEG ? track.len : track.len + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MUX_ERROR, level: this.level, id: this.id, details: _errors.ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes: mdatSize, reason: 'fail allocating audio mdat ' + mdatSize });\n return;\n }\n if (!rawMPEG) {\n view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n newStamp = ptsnorm - (numMissingFrames - _i3) * pesFrameDuration;\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _logger.logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\n }\n mdat.set(fillFrame, offset);\n offset += fillFrame.byteLength;\n mp4Sample = {\n size: fillFrame.byteLength,\n cts: 0,\n duration: 1024,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\n cts: 0,\n duration: 0,\n flags: {\n isLeading: 0,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradPrio: 0,\n dependsOn: 1\n }\n };\n outputSamples.push(mp4Sample);\n lastDTS = dtsnorm;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = ptsnorm + pes2mp4ScaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstDTS / pes2mp4ScaleFactor, track);\n }\n track.samples = [];\n var audioData = {\n id: this.id,\n level: this.level,\n sn: this.sn,\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / pesTimeScale,\n endPTS: this.nextAudioPts / pesTimeScale,\n startDTS: firstDTS / pesTimeScale,\n endDTS: (dtsnorm + pes2mp4ScaleFactor * lastSampleDuration) / pesTimeScale,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(_events2.default.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n }, {\n key: 'remuxEmptyAudio',\n value: function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var pesTimeScale = this.PES_TIMESCALE,\n mp4timeScale = track.timescale ? track.timescale : track.audiosamplerate,\n pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * pesTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * pesTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = pes2mp4ScaleFactor * sampleDuration,\n\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n\n // silent frame\n silentFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _logger.logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({ unit: silentFrame, pts: stamp, dts: stamp });\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n }, {\n key: 'remuxID3',\n value: function remuxID3(track, timeOffset) {\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n sample.dts = (sample.dts - this._initDTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: 'remuxText',\n value: function remuxText(track, timeOffset) {\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n\n var length = track.samples.length,\n sample;\n // consume samples\n if (length) {\n for (var index = 0; index < length; index++) {\n sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = (sample.pts - this._initPTS) / this.PES_TIMESCALE;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\n id: this.id,\n level: this.level,\n sn: this.sn,\n samples: track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n }, {\n key: '_PTSNormalize',\n value: function _PTSNormalize(value, reference) {\n var offset;\n if (reference === undefined) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return false;\n }\n }]);\n\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"26\":26,\"28\":28,\"29\":29,\"37\":37,\"45\":45}],39:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * passthrough remuxer\n */\n\n\nvar _events = _dereq_(28);\n\nvar _events2 = _interopRequireDefault(_events);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PassThroughRemuxer = function () {\n function PassThroughRemuxer(observer, id) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n this.id = id;\n this.ISGenerated = false;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'insertDiscontinuity',\n value: function insertDiscontinuity() {}\n }, {\n key: 'switchLevel',\n value: function switchLevel() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, rawData) {\n var observer = this.observer;\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n var tracks = {},\n data = { id: this.id, tracks: tracks, unique: true },\n track = videoTrack,\n codec = track.codec;\n\n if (codec) {\n data.tracks.video = {\n container: track.container,\n codec: codec,\n metadata: {\n width: track.width,\n height: track.height\n }\n };\n }\n\n track = audioTrack;\n codec = track.codec;\n if (codec) {\n data.tracks.audio = {\n container: track.container,\n codec: codec,\n metadata: {\n channelCount: track.channelCount\n }\n };\n }\n this.ISGenerated = true;\n observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, data);\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n id: this.id,\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: 'audiovideo',\n nb: 1,\n dropped: 0\n });\n }\n }, {\n key: 'passthrough',\n get: function get() {\n return true;\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"28\":28}],40:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\n\nvar AttrList = function () {\n function AttrList(attrs) {\n _classCallCheck(this, AttrList);\n\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n\n _createClass(AttrList, [{\n key: 'decimalInteger',\n value: function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'hexadecimalInteger',\n value: function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: 'hexadecimalIntegerAsNumber',\n value: function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n }, {\n key: 'decimalFloatingPoint',\n value: function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n }, {\n key: 'enumeratedString',\n value: function enumeratedString(attrName) {\n return this[attrName];\n }\n }, {\n key: 'decimalResolution',\n value: function decimalResolution(attrName) {\n var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n }\n }], [{\n key: 'parseAttrList',\n value: function parseAttrList(input) {\n var match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2],\n quote = '\"';\n\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n }\n }]);\n\n return AttrList;\n}();\n\nexports.default = AttrList;\n\n},{}],41:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array} list The array to search.\n * @param {Function} comparisonFunction\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {*} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFunction) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n\n var comparisonResult = comparisonFunction(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n\n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n},{}],42:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n * This code was ported from the dash.js project at:\n * https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js\n * https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2\n *\n * The original copyright appears below:\n *\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2015-2016, DASH Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * 2. Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes\n */\n\nvar specialCea608CharsCodes = {\n 0x2a: 0xe1, // lowercase a, acute accent\n 0x5c: 0xe9, // lowercase e, acute accent\n 0x5e: 0xed, // lowercase i, acute accent\n 0x5f: 0xf3, // lowercase o, acute accent\n 0x60: 0xfa, // lowercase u, acute accent\n 0x7b: 0xe7, // lowercase c with cedilla\n 0x7c: 0xf7, // division symbol\n 0x7d: 0xd1, // uppercase N tilde\n 0x7e: 0xf1, // lowercase n tilde\n 0x7f: 0x2588, // Full block\n // THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F\n // THIS MEANS THAT \\x50 MUST BE ADDED TO THE VALUES\n 0x80: 0xae, // Registered symbol (R)\n 0x81: 0xb0, // degree sign\n 0x82: 0xbd, // 1/2 symbol\n 0x83: 0xbf, // Inverted (open) question mark\n 0x84: 0x2122, // Trademark symbol (TM)\n 0x85: 0xa2, // Cents symbol\n 0x86: 0xa3, // Pounds sterling\n 0x87: 0x266a, // Music 8'th note\n 0x88: 0xe0, // lowercase a, grave accent\n 0x89: 0x20, // transparent space (regular)\n 0x8a: 0xe8, // lowercase e, grave accent\n 0x8b: 0xe2, // lowercase a, circumflex accent\n 0x8c: 0xea, // lowercase e, circumflex accent\n 0x8d: 0xee, // lowercase i, circumflex accent\n 0x8e: 0xf4, // lowercase o, circumflex accent\n 0x8f: 0xfb, // lowercase u, circumflex accent\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F\n 0x90: 0xc1, // capital letter A with acute\n 0x91: 0xc9, // capital letter E with acute\n 0x92: 0xd3, // capital letter O with acute\n 0x93: 0xda, // capital letter U with acute\n 0x94: 0xdc, // capital letter U with diaresis\n 0x95: 0xfc, // lowercase letter U with diaeresis\n 0x96: 0x2018, // opening single quote\n 0x97: 0xa1, // inverted exclamation mark\n 0x98: 0x2a, // asterisk\n 0x99: 0x2019, // closing single quote\n 0x9a: 0x2501, // box drawings heavy horizontal\n 0x9b: 0xa9, // copyright sign\n 0x9c: 0x2120, // Service mark\n 0x9d: 0x2022, // (round) bullet\n 0x9e: 0x201c, // Left double quotation mark\n 0x9f: 0x201d, // Right double quotation mark\n 0xa0: 0xc0, // uppercase A, grave accent\n 0xa1: 0xc2, // uppercase A, circumflex\n 0xa2: 0xc7, // uppercase C with cedilla\n 0xa3: 0xc8, // uppercase E, grave accent\n 0xa4: 0xca, // uppercase E, circumflex\n 0xa5: 0xcb, // capital letter E with diaresis\n 0xa6: 0xeb, // lowercase letter e with diaresis\n 0xa7: 0xce, // uppercase I, circumflex\n 0xa8: 0xcf, // uppercase I, with diaresis\n 0xa9: 0xef, // lowercase i, with diaresis\n 0xaa: 0xd4, // uppercase O, circumflex\n 0xab: 0xd9, // uppercase U, grave accent\n 0xac: 0xf9, // lowercase u, grave accent\n 0xad: 0xdb, // uppercase U, circumflex\n 0xae: 0xab, // left-pointing double angle quotation mark\n 0xaf: 0xbb, // right-pointing double angle quotation mark\n // THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS\n // THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F\n 0xb0: 0xc3, // Uppercase A, tilde\n 0xb1: 0xe3, // Lowercase a, tilde\n 0xb2: 0xcd, // Uppercase I, acute accent\n 0xb3: 0xcc, // Uppercase I, grave accent\n 0xb4: 0xec, // Lowercase i, grave accent\n 0xb5: 0xd2, // Uppercase O, grave accent\n 0xb6: 0xf2, // Lowercase o, grave accent\n 0xb7: 0xd5, // Uppercase O, tilde\n 0xb8: 0xf5, // Lowercase o, tilde\n 0xb9: 0x7b, // Open curly brace\n 0xba: 0x7d, // Closing curly brace\n 0xbb: 0x5c, // Backslash\n 0xbc: 0x5e, // Caret\n 0xbd: 0x5f, // Underscore\n 0xbe: 0x7c, // Pipe (vertical line)\n 0xbf: 0x223c, // Tilde operator\n 0xc0: 0xc4, // Uppercase A, umlaut\n 0xc1: 0xe4, // Lowercase A, umlaut\n 0xc2: 0xd6, // Uppercase O, umlaut\n 0xc3: 0xf6, // Lowercase o, umlaut\n 0xc4: 0xdf, // Esszett (sharp S)\n 0xc5: 0xa5, // Yen symbol\n 0xc6: 0xa4, // Generic currency sign\n 0xc7: 0x2503, // Box drawings heavy vertical\n 0xc8: 0xc5, // Uppercase A, ring\n 0xc9: 0xe5, // Lowercase A, ring\n 0xca: 0xd8, // Uppercase O, stroke\n 0xcb: 0xf8, // Lowercase o, strok\n 0xcc: 0x250f, // Box drawings heavy down and right\n 0xcd: 0x2513, // Box drawings heavy down and left\n 0xce: 0x2517, // Box drawings heavy up and right\n 0xcf: 0x251b // Box drawings heavy up and left\n};\n\n/**\n * Utils\n */\nvar getCharForByte = function getCharForByte(byte) {\n var charCode = byte;\n if (specialCea608CharsCodes.hasOwnProperty(byte)) {\n charCode = specialCea608CharsCodes[byte];\n }\n return String.fromCharCode(charCode);\n};\n\nvar NR_ROWS = 15,\n NR_COLS = 32;\n// Tables to look up row from PAC data\nvar rowsLowCh1 = { 0x11: 1, 0x12: 3, 0x15: 5, 0x16: 7, 0x17: 9, 0x10: 11, 0x13: 12, 0x14: 14 };\nvar rowsHighCh1 = { 0x11: 2, 0x12: 4, 0x15: 6, 0x16: 8, 0x17: 10, 0x13: 13, 0x14: 15 };\nvar rowsLowCh2 = { 0x19: 1, 0x1A: 3, 0x1D: 5, 0x1E: 7, 0x1F: 9, 0x18: 11, 0x1B: 12, 0x1C: 14 };\nvar rowsHighCh2 = { 0x19: 2, 0x1A: 4, 0x1D: 6, 0x1E: 8, 0x1F: 10, 0x1B: 13, 0x1C: 15 };\n\nvar backgroundColors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'black', 'transparent'];\n\n/**\n * Simple logger class to be able to write with time-stamps and filter on level.\n */\nvar logger = {\n verboseFilter: { 'DATA': 3, 'DEBUG': 3, 'INFO': 2, 'WARNING': 2, 'TEXT': 1, 'ERROR': 0 },\n time: null,\n verboseLevel: 0, // Only write errors\n setTime: function setTime(newTime) {\n this.time = newTime;\n },\n log: function log(severity, msg) {\n var minLevel = this.verboseFilter[severity];\n if (this.verboseLevel >= minLevel) {\n console.log(this.time + ' [' + severity + '] ' + msg);\n }\n }\n};\n\nvar numArrayToHexArray = function numArrayToHexArray(numArray) {\n var hexArray = [];\n for (var j = 0; j < numArray.length; j++) {\n hexArray.push(numArray[j].toString(16));\n }\n return hexArray;\n};\n\nvar PenState = function () {\n function PenState(foreground, underline, italics, background, flash) {\n _classCallCheck(this, PenState);\n\n this.foreground = foreground || 'white';\n this.underline = underline || false;\n this.italics = italics || false;\n this.background = background || 'black';\n this.flash = flash || false;\n }\n\n _createClass(PenState, [{\n key: 'reset',\n value: function reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n }, {\n key: 'setStyles',\n value: function setStyles(styles) {\n var attribs = ['foreground', 'underline', 'italics', 'background', 'flash'];\n for (var i = 0; i < attribs.length; i++) {\n var style = attribs[i];\n if (styles.hasOwnProperty(style)) {\n this[style] = styles[style];\n }\n }\n }\n }, {\n key: 'isDefault',\n value: function isDefault() {\n return this.foreground === 'white' && !this.underline && !this.italics && this.background === 'black' && !this.flash;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.foreground === other.foreground && this.underline === other.underline && this.italics === other.italics && this.background === other.background && this.flash === other.flash;\n }\n }, {\n key: 'copy',\n value: function copy(newPenState) {\n this.foreground = newPenState.foreground;\n this.underline = newPenState.underline;\n this.italics = newPenState.italics;\n this.background = newPenState.background;\n this.flash = newPenState.flash;\n }\n }, {\n key: 'toString',\n value: function toString() {\n return 'color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics + ', background=' + this.background + ', flash=' + this.flash;\n }\n }]);\n\n return PenState;\n}();\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\n\n\nvar StyledUnicodeChar = function () {\n function StyledUnicodeChar(uchar, foreground, underline, italics, background, flash) {\n _classCallCheck(this, StyledUnicodeChar);\n\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline, italics, background, flash);\n }\n\n _createClass(StyledUnicodeChar, [{\n key: 'reset',\n value: function reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n }, {\n key: 'setChar',\n value: function setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n }, {\n key: 'setPenState',\n value: function setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n }, {\n key: 'copy',\n value: function copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n }]);\n\n return StyledUnicodeChar;\n}();\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\n\n\nvar Row = function () {\n function Row() {\n _classCallCheck(this, Row);\n\n this.chars = [];\n for (var i = 0; i < NR_COLS; i++) {\n this.chars.push(new StyledUnicodeChar());\n }\n this.pos = 0;\n this.currPenState = new PenState();\n }\n\n _createClass(Row, [{\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].equals(other.chars[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_COLS; i++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n if (!this.chars[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n\n /**\n * Set the cursor to a valid column.\n */\n\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n if (this.pos !== absPos) {\n this.pos = absPos;\n }\n if (this.pos < 0) {\n logger.log('ERROR', 'Negative cursor position ' + this.pos);\n this.pos = 0;\n } else if (this.pos > NR_COLS) {\n logger.log('ERROR', 'Too large cursor position ' + this.pos);\n this.pos = NR_COLS;\n }\n }\n\n /**\n * Move the cursor relative to current position.\n */\n\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var newPos = this.pos + relPos;\n if (relPos > 1) {\n for (var i = this.pos + 1; i < newPos + 1; i++) {\n this.chars[i].setPenState(this.currPenState);\n }\n }\n this.setCursor(newPos);\n }\n\n /**\n * Backspace, move one step back and clear character.\n */\n\n }, {\n key: 'backSpace',\n value: function backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n }, {\n key: 'insertChar',\n value: function insertChar(byte) {\n if (byte >= 0x90) {\n //Extended char\n this.backSpace();\n }\n var char = getCharForByte(byte);\n if (this.pos >= NR_COLS) {\n logger.log('ERROR', 'Cannot insert ' + byte.toString(16) + ' (' + char + ') at position ' + this.pos + '. Skipping it!');\n return;\n }\n this.chars[this.pos].setChar(char, this.currPenState);\n this.moveCursor(1);\n }\n }, {\n key: 'clearFromPos',\n value: function clearFromPos(startPos) {\n var i;\n for (i = startPos; i < NR_COLS; i++) {\n this.chars[i].reset();\n }\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n }, {\n key: 'getTextString',\n value: function getTextString() {\n var chars = [];\n var empty = true;\n for (var i = 0; i < NR_COLS; i++) {\n var char = this.chars[i].uchar;\n if (char !== ' ') {\n empty = false;\n }\n chars.push(char);\n }\n if (empty) {\n return '';\n } else {\n return chars.join('');\n }\n }\n }, {\n key: 'setPenStyles',\n value: function setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n }]);\n\n return Row;\n}();\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\n\n\nvar CaptionScreen = function () {\n function CaptionScreen() {\n _classCallCheck(this, CaptionScreen);\n\n this.rows = [];\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows.push(new Row()); // Note that we use zero-based numbering (0-14)\n }\n this.currRow = NR_ROWS - 1;\n this.nrRollUpRows = null;\n this.reset();\n }\n\n _createClass(CaptionScreen, [{\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n this.currRow = NR_ROWS - 1;\n }\n }, {\n key: 'equals',\n value: function equals(other) {\n var equal = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].equals(other.rows[i])) {\n equal = false;\n break;\n }\n }\n return equal;\n }\n }, {\n key: 'copy',\n value: function copy(other) {\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n var empty = true;\n for (var i = 0; i < NR_ROWS; i++) {\n if (!this.rows[i].isEmpty()) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: 'backSpace',\n value: function backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n }, {\n key: 'clearToEndOfRow',\n value: function clearToEndOfRow() {\n var row = this.rows[this.currRow];\n row.clearToEndOfRow();\n }\n\n /**\n * Insert a character (without styling) in the current row.\n */\n\n }, {\n key: 'insertChar',\n value: function insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n }, {\n key: 'setPen',\n value: function setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n }, {\n key: 'moveCursor',\n value: function moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n }, {\n key: 'setCursor',\n value: function setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData, lastOutputScreen) {\n logger.log('INFO', 'pacData = ' + JSON.stringify(pacData));\n var newRow = pacData.row - 1;\n if (this.nrRollUpRows && newRow < this.nrRollUpRows - 1) {\n newRow = this.nrRollUpRows - 1;\n }\n\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow - this.nrRollUpRows + i + 1].copy(lastOutputScreen.rows[topRowIndex + i]);\n }\n }\n }\n\n this.currRow = newRow;\n var row = this.rows[this.currRow];\n if (pacData.indent !== null) {\n var indent = pacData.indent;\n var prevPos = Math.max(indent - 1, 0);\n row.setCursor(pacData.indent);\n pacData.color = row.chars[prevPos].penState.foreground;\n }\n var styles = { foreground: pacData.color, underline: pacData.underline, italics: pacData.italics, background: 'black', flash: false };\n this.setPen(styles);\n }\n\n /**\n * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).\n */\n\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n\n logger.log('INFO', 'bkgData = ' + JSON.stringify(bkgData));\n this.backSpace();\n this.setPen(bkgData);\n this.insertChar(0x20); //Space\n }\n }, {\n key: 'setRollUpRows',\n value: function setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n }, {\n key: 'rollUp',\n value: function rollUp() {\n if (this.nrRollUpRows === null) {\n logger.log('DEBUG', 'roll_up but nrRollUpRows not set yet');\n return; //Not properly setup\n }\n logger.log('TEXT', this.getDisplayText());\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n var topRow = this.rows.splice(topRowIndex, 1)[0];\n topRow.clear();\n this.rows.splice(this.currRow, 0, topRow);\n logger.log('INFO', 'Rolling up');\n //logger.log('TEXT', this.get_display_text())\n }\n\n /**\n * Get all non-empty rows with as unicode text.\n */\n\n }, {\n key: 'getDisplayText',\n value: function getDisplayText(asOneRow) {\n asOneRow = asOneRow || false;\n var displayText = [];\n var text = '';\n var rowNr = -1;\n for (var i = 0; i < NR_ROWS; i++) {\n var rowText = this.rows[i].getTextString();\n if (rowText) {\n rowNr = i + 1;\n if (asOneRow) {\n displayText.push('Row ' + rowNr + ': \\'' + rowText + '\\'');\n } else {\n displayText.push(rowText.trim());\n }\n }\n }\n if (displayText.length > 0) {\n if (asOneRow) {\n text = '[' + displayText.join(' | ') + ']';\n } else {\n text = displayText.join('\\n');\n }\n }\n return text;\n }\n }, {\n key: 'getTextAndFormat',\n value: function getTextAndFormat() {\n return this.rows;\n }\n }]);\n\n return CaptionScreen;\n}();\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nvar Cea608Channel = function () {\n function Cea608Channel(channelNumber, outputFilter) {\n _classCallCheck(this, Cea608Channel);\n\n this.chNr = channelNumber;\n this.outputFilter = outputFilter;\n this.mode = null;\n this.verbose = 0;\n this.displayedMemory = new CaptionScreen();\n this.nonDisplayedMemory = new CaptionScreen();\n this.lastOutputScreen = new CaptionScreen();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null; // Keeps track of where a cue started.\n }\n\n _createClass(Cea608Channel, [{\n key: 'reset',\n value: function reset() {\n this.mode = null;\n this.displayedMemory.reset();\n this.nonDisplayedMemory.reset();\n this.lastOutputScreen.reset();\n this.currRollUpRow = this.displayedMemory.rows[NR_ROWS - 1];\n this.writeScreen = this.displayedMemory;\n this.mode = null;\n this.cueStartTime = null;\n this.lastCueEndTime = null;\n }\n }, {\n key: 'getHandler',\n value: function getHandler() {\n return this.outputFilter;\n }\n }, {\n key: 'setHandler',\n value: function setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n }, {\n key: 'setPAC',\n value: function setPAC(pacData) {\n this.writeScreen.setPAC(pacData, this.lastOutputScreen);\n }\n }, {\n key: 'setBkgData',\n value: function setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n }, {\n key: 'setMode',\n value: function setMode(newMode) {\n if (newMode === this.mode) {\n return;\n }\n this.mode = newMode;\n logger.log('INFO', 'MODE=' + newMode);\n if (this.mode === 'MODE_POP-ON') {\n this.writeScreen = this.nonDisplayedMemory;\n } else {\n this.writeScreen = this.displayedMemory;\n this.writeScreen.reset();\n this.lastOutputScreen.reset();\n }\n if (this.mode !== 'MODE_ROLL-UP') {\n this.displayedMemory.nrRollUpRows = null;\n this.nonDisplayedMemory.nrRollUpRows = null;\n }\n this.mode = newMode;\n }\n }, {\n key: 'insertChars',\n value: function insertChars(chars) {\n for (var i = 0; i < chars.length; i++) {\n this.writeScreen.insertChar(chars[i]);\n }\n var screen = this.writeScreen === this.displayedMemory ? 'DISP' : 'NON_DISP';\n logger.log('INFO', screen + ': ' + this.writeScreen.getDisplayText(true));\n if (this.mode === 'MODE_PAINT-ON' || this.mode === 'MODE_ROLL-UP') {\n logger.log('TEXT', 'DISPLAYED: ' + this.displayedMemory.getDisplayText(true));\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccRCL',\n value: function ccRCL() {\n // Resume Caption Loading (switch mode to Pop On)\n logger.log('INFO', 'RCL - Resume Caption Loading');\n this.setMode('MODE_POP-ON');\n }\n }, {\n key: 'ccBS',\n value: function ccBS() {\n // BackSpace\n logger.log('INFO', 'BS - BackSpace');\n if (this.mode === 'MODE_TEXT') {\n return;\n }\n this.writeScreen.backSpace();\n if (this.writeScreen === this.displayedMemory) {\n this.outputDataUpdate();\n }\n }\n }, {\n key: 'ccAOF',\n value: function ccAOF() {\n // Reserved (formerly Alarm Off)\n return;\n }\n }, {\n key: 'ccAON',\n value: function ccAON() {\n // Reserved (formerly Alarm On)\n return;\n }\n }, {\n key: 'ccDER',\n value: function ccDER() {\n // Delete to End of Row\n logger.log('INFO', 'DER- Delete to End of Row');\n this.writeScreen.clearToEndOfRow();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccRU',\n value: function ccRU(nrRows) {\n //Roll-Up Captions-2,3,or 4 Rows\n logger.log('INFO', 'RU(' + nrRows + ') - Roll Up');\n this.writeScreen = this.displayedMemory;\n this.setMode('MODE_ROLL-UP');\n this.writeScreen.setRollUpRows(nrRows);\n }\n }, {\n key: 'ccFON',\n value: function ccFON() {\n //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({ flash: true });\n }\n }, {\n key: 'ccRDC',\n value: function ccRDC() {\n // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n }, {\n key: 'ccTR',\n value: function ccTR() {\n // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccRTD',\n value: function ccRTD() {\n // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n }, {\n key: 'ccEDM',\n value: function ccEDM() {\n // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccCR',\n value: function ccCR() {\n // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n }, {\n key: 'ccENM',\n value: function ccENM() {\n //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n }, {\n key: 'ccEOC',\n value: function ccEOC() {\n //End of Caption (Flip Memories)\n logger.log('INFO', 'EOC - End Of Caption');\n if (this.mode === 'MODE_POP-ON') {\n var tmp = this.displayedMemory;\n this.displayedMemory = this.nonDisplayedMemory;\n this.nonDisplayedMemory = tmp;\n this.writeScreen = this.nonDisplayedMemory;\n logger.log('TEXT', 'DISP: ' + this.displayedMemory.getDisplayText());\n }\n this.outputDataUpdate();\n }\n }, {\n key: 'ccTO',\n value: function ccTO(nrCols) {\n // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n }, {\n key: 'ccMIDROW',\n value: function ccMIDROW(secondByte) {\n // Parse MIDROW command\n var styles = { flash: false };\n styles.underline = secondByte % 2 === 1;\n styles.italics = secondByte >= 0x2e;\n if (!styles.italics) {\n var colorIndex = Math.floor(secondByte / 2) - 0x10;\n var colors = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta'];\n styles.foreground = colors[colorIndex];\n } else {\n styles.foreground = 'white';\n }\n logger.log('INFO', 'MIDROW: ' + JSON.stringify(styles));\n this.writeScreen.setPen(styles);\n }\n }, {\n key: 'outputDataUpdate',\n value: function outputDataUpdate() {\n var t = logger.time;\n if (t === null) {\n return;\n }\n if (this.outputFilter) {\n if (this.outputFilter.updateData) {\n this.outputFilter.updateData(t, this.displayedMemory);\n }\n if (this.cueStartTime === null && !this.displayedMemory.isEmpty()) {\n // Start of a new cue\n this.cueStartTime = t;\n } else {\n if (!this.displayedMemory.equals(this.lastOutputScreen)) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.lastOutputScreen);\n }\n this.cueStartTime = this.displayedMemory.isEmpty() ? null : t;\n }\n }\n this.lastOutputScreen.copy(this.displayedMemory);\n }\n }\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n if (this.outputFilter) {\n if (!this.displayedMemory.isEmpty()) {\n if (this.outputFilter.newCue) {\n this.outputFilter.newCue(this.cueStartTime, t, this.displayedMemory);\n }\n this.cueStartTime = t;\n }\n }\n }\n }]);\n\n return Cea608Channel;\n}();\n\nvar Cea608Parser = function () {\n function Cea608Parser(field, out1, out2) {\n _classCallCheck(this, Cea608Parser);\n\n this.field = field || 1;\n this.outputs = [out1, out2];\n this.channels = [new Cea608Channel(1, out1), new Cea608Channel(2, out2)];\n this.currChNr = -1; // Will be 1 or 2\n this.lastCmdA = null; // First byte of last command\n this.lastCmdB = null; // Second byte of last command\n this.bufferedData = [];\n this.startTime = null;\n this.lastTime = null;\n this.dataCounters = { 'padding': 0, 'char': 0, 'cmd': 0, 'other': 0 };\n }\n\n _createClass(Cea608Parser, [{\n key: 'getHandler',\n value: function getHandler(index) {\n return this.channels[index].getHandler();\n }\n }, {\n key: 'setHandler',\n value: function setHandler(index, newHandler) {\n this.channels[index].setHandler(newHandler);\n }\n\n /**\n * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.\n */\n\n }, {\n key: 'addData',\n value: function addData(t, byteList) {\n var cmdFound,\n a,\n b,\n charsFound = false;\n\n this.lastTime = t;\n logger.setTime(t);\n\n for (var i = 0; i < byteList.length; i += 2) {\n a = byteList[i] & 0x7f;\n b = byteList[i + 1] & 0x7f;\n if (a === 0 && b === 0) {\n this.dataCounters.padding += 2;\n continue;\n } else {\n logger.log('DATA', '[' + numArrayToHexArray([byteList[i], byteList[i + 1]]) + '] -> (' + numArrayToHexArray([a, b]) + ')');\n }\n cmdFound = this.parseCmd(a, b);\n if (!cmdFound) {\n cmdFound = this.parseMidrow(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parsePAC(a, b);\n }\n if (!cmdFound) {\n cmdFound = this.parseBackgroundAttributes(a, b);\n }\n if (!cmdFound) {\n charsFound = this.parseChars(a, b);\n if (charsFound) {\n if (this.currChNr && this.currChNr >= 0) {\n var channel = this.channels[this.currChNr - 1];\n channel.insertChars(charsFound);\n } else {\n logger.log('WARNING', 'No channel found yet. TEXT-MODE?');\n }\n }\n }\n if (cmdFound) {\n this.dataCounters.cmd += 2;\n } else if (charsFound) {\n this.dataCounters.char += 2;\n } else {\n this.dataCounters.other += 2;\n logger.log('WARNING', 'Couldn\\'t parse cleaned data ' + numArrayToHexArray([a, b]) + ' orig: ' + numArrayToHexArray([byteList[i], byteList[i + 1]]));\n }\n }\n }\n\n /**\n * Parse Command.\n * @returns {Boolean} Tells if a command was found\n */\n\n }, {\n key: 'parseCmd',\n value: function parseCmd(a, b) {\n var chNr = null;\n\n var cond1 = (a === 0x14 || a === 0x1C) && 0x20 <= b && b <= 0x2F;\n var cond2 = (a === 0x17 || a === 0x1F) && 0x21 <= b && b <= 0x23;\n if (!(cond1 || cond2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null; // Repeated commands are dropped (once)\n logger.log('DEBUG', 'Repeated command (' + numArrayToHexArray([a, b]) + ') is dropped');\n return true;\n }\n\n if (a === 0x14 || a === 0x17) {\n chNr = 1;\n } else {\n chNr = 2; // (a === 0x1C || a=== 0x1f)\n }\n\n var channel = this.channels[chNr - 1];\n\n if (a === 0x14 || a === 0x1C) {\n if (b === 0x20) {\n channel.ccRCL();\n } else if (b === 0x21) {\n channel.ccBS();\n } else if (b === 0x22) {\n channel.ccAOF();\n } else if (b === 0x23) {\n channel.ccAON();\n } else if (b === 0x24) {\n channel.ccDER();\n } else if (b === 0x25) {\n channel.ccRU(2);\n } else if (b === 0x26) {\n channel.ccRU(3);\n } else if (b === 0x27) {\n channel.ccRU(4);\n } else if (b === 0x28) {\n channel.ccFON();\n } else if (b === 0x29) {\n channel.ccRDC();\n } else if (b === 0x2A) {\n channel.ccTR();\n } else if (b === 0x2B) {\n channel.ccRTD();\n } else if (b === 0x2C) {\n channel.ccEDM();\n } else if (b === 0x2D) {\n channel.ccCR();\n } else if (b === 0x2E) {\n channel.ccENM();\n } else if (b === 0x2F) {\n channel.ccEOC();\n }\n } else {\n //a == 0x17 || a == 0x1F\n channel.ccTO(b - 0x20);\n }\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Parse midrow styling command\n * @returns {Boolean}\n */\n\n }, {\n key: 'parseMidrow',\n value: function parseMidrow(a, b) {\n var chNr = null;\n\n if ((a === 0x11 || a === 0x19) && 0x20 <= b && b <= 0x2f) {\n if (a === 0x11) {\n chNr = 1;\n } else {\n chNr = 2;\n }\n if (chNr !== this.currChNr) {\n logger.log('ERROR', 'Mismatch channel in midrow parsing');\n return false;\n }\n var channel = this.channels[chNr - 1];\n channel.ccMIDROW(b);\n logger.log('DEBUG', 'MIDROW (' + numArrayToHexArray([a, b]) + ')');\n return true;\n }\n return false;\n }\n /**\n * Parse Preable Access Codes (Table 53).\n * @returns {Boolean} Tells if PAC found\n */\n\n }, {\n key: 'parsePAC',\n value: function parsePAC(a, b) {\n\n var chNr = null;\n var row = null;\n\n var case1 = (0x11 <= a && a <= 0x17 || 0x19 <= a && a <= 0x1F) && 0x40 <= b && b <= 0x7F;\n var case2 = (a === 0x10 || a === 0x18) && 0x40 <= b && b <= 0x5F;\n if (!(case1 || case2)) {\n return false;\n }\n\n if (a === this.lastCmdA && b === this.lastCmdB) {\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true; // Repeated commands are dropped (once)\n }\n\n chNr = a <= 0x17 ? 1 : 2;\n\n if (0x40 <= b && b <= 0x5F) {\n row = chNr === 1 ? rowsLowCh1[a] : rowsLowCh2[a];\n } else {\n // 0x60 <= b <= 0x7F\n row = chNr === 1 ? rowsHighCh1[a] : rowsHighCh2[a];\n }\n var pacData = this.interpretPAC(row, b);\n var channel = this.channels[chNr - 1];\n channel.setPAC(pacData);\n this.lastCmdA = a;\n this.lastCmdB = b;\n this.currChNr = chNr;\n return true;\n }\n\n /**\n * Interpret the second byte of the pac, and return the information.\n * @returns {Object} pacData with style parameters.\n */\n\n }, {\n key: 'interpretPAC',\n value: function interpretPAC(row, byte) {\n var pacIndex = byte;\n var pacData = { color: null, italics: false, indent: null, underline: false, row: row };\n\n if (byte > 0x5F) {\n pacIndex = byte - 0x60;\n } else {\n pacIndex = byte - 0x40;\n }\n pacData.underline = (pacIndex & 1) === 1;\n if (pacIndex <= 0xd) {\n pacData.color = ['white', 'green', 'blue', 'cyan', 'red', 'yellow', 'magenta', 'white'][Math.floor(pacIndex / 2)];\n } else if (pacIndex <= 0xf) {\n pacData.italics = true;\n pacData.color = 'white';\n } else {\n pacData.indent = Math.floor((pacIndex - 0x10) / 2) * 4;\n }\n return pacData; // Note that row has zero offset. The spec uses 1.\n }\n\n /**\n * Parse characters.\n * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.\n */\n\n }, {\n key: 'parseChars',\n value: function parseChars(a, b) {\n\n var channelNr = null,\n charCodes = null,\n charCode1 = null;\n\n if (a >= 0x19) {\n channelNr = 2;\n charCode1 = a - 8;\n } else {\n channelNr = 1;\n charCode1 = a;\n }\n if (0x11 <= charCode1 && charCode1 <= 0x13) {\n // Special character\n var oneCode = b;\n if (charCode1 === 0x11) {\n oneCode = b + 0x50;\n } else if (charCode1 === 0x12) {\n oneCode = b + 0x70;\n } else {\n oneCode = b + 0x90;\n }\n logger.log('INFO', 'Special char \\'' + getCharForByte(oneCode) + '\\' in channel ' + channelNr);\n charCodes = [oneCode];\n } else if (0x20 <= a && a <= 0x7f) {\n charCodes = b === 0 ? [a] : [a, b];\n }\n if (charCodes) {\n var hexCodes = numArrayToHexArray(charCodes);\n logger.log('DEBUG', 'Char codes = ' + hexCodes.join(','));\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n return charCodes;\n }\n\n /**\n * Parse extended background attributes as well as new foreground color black.\n * @returns{Boolean} Tells if background attributes are found\n */\n\n }, {\n key: 'parseBackgroundAttributes',\n value: function parseBackgroundAttributes(a, b) {\n var bkgData, index, chNr, channel;\n\n var case1 = (a === 0x10 || a === 0x18) && 0x20 <= b && b <= 0x2f;\n var case2 = (a === 0x17 || a === 0x1f) && 0x2d <= b && b <= 0x2f;\n if (!(case1 || case2)) {\n return false;\n }\n bkgData = {};\n if (a === 0x10 || a === 0x18) {\n index = Math.floor((b - 0x20) / 2);\n bkgData.background = backgroundColors[index];\n if (b % 2 === 1) {\n bkgData.background = bkgData.background + '_semi';\n }\n } else if (b === 0x2d) {\n bkgData.background = 'transparent';\n } else {\n bkgData.foreground = 'black';\n if (b === 0x2f) {\n bkgData.underline = true;\n }\n }\n chNr = a < 0x18 ? 1 : 2;\n channel = this.channels[chNr - 1];\n channel.setBkgData(bkgData);\n this.lastCmdA = null;\n this.lastCmdB = null;\n return true;\n }\n\n /**\n * Reset state of parser and its channels.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].reset();\n }\n }\n this.lastCmdA = null;\n this.lastCmdB = null;\n }\n\n /**\n * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.\n */\n\n }, {\n key: 'cueSplitAtTime',\n value: function cueSplitAtTime(t) {\n for (var i = 0; i < this.channels.length; i++) {\n if (this.channels[i]) {\n this.channels[i].cueSplitAtTime(t);\n }\n }\n }\n }]);\n\n return Cea608Parser;\n}();\n\nexports.default = Cea608Parser;\n\n},{}],43:[function(_dereq_,module,exports){\n'use strict';\n\nvar Cues = {\n\n newCue: function newCue(track, startTime, endTime, captionScreen) {\n var row;\n var cue;\n var indenting;\n var indent;\n var text;\n var VTTCue = window.VTTCue || window.TextTrackCue;\n\n for (var r = 0; r < captionScreen.rows.length; r++) {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty()) {\n for (var c = 0; c < row.chars.length; c++) {\n if (row.chars[c].uchar.match(/\\s/) && indenting) {\n indent++;\n } else {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n cue = new VTTCue(startTime, endTime, text.trim());\n\n if (indent >= 16) {\n indent--;\n } else {\n indent++;\n }\n\n // VTTCue.line get's flakey when using controls, so let's now include line 13&14\n // also, drop line 1 since it's to close to the top\n if (navigator.userAgent.match(/Firefox\\//)) {\n cue.line = r + 1;\n } else {\n cue.line = r > 7 ? r - 2 : r + 1;\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{}],44:[function(_dereq_,module,exports){\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\n\nvar EWMA = function () {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n function EWMA(halfLife) {\n _classCallCheck(this, EWMA);\n\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = 0;\n this.totalWeight_ = 0;\n }\n\n _createClass(EWMA, [{\n key: \"sample\",\n value: function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n }\n }, {\n key: \"getTotalWeight\",\n value: function getTotalWeight() {\n return this.totalWeight_;\n }\n }, {\n key: \"getEstimate\",\n value: function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n } else {\n return this.estimate_;\n }\n }\n }]);\n\n return EWMA;\n}();\n\nexports.default = EWMA;\n\n},{}],45:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction noop() {}\n\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nvar exportedLogger = fakeLogger;\n\n/*globals self: false */\n\n//let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction formatMsg(type, msg) {\n msg = '[' + type + '] > ' + msg;\n return msg;\n}\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args[0]) {\n args[0] = formatMsg(type, args[0]);\n }\n func.apply(self.console, args);\n };\n }\n return noop;\n}\n\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len2 = arguments.length, functions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n functions[_key2 - 1] = arguments[_key2];\n }\n\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nvar enableLogs = exports.enableLogs = function enableLogs(debugConfig) {\n if (debugConfig === true || (typeof debugConfig === 'undefined' ? 'undefined' : _typeof(debugConfig)) === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log();\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n};\n\nvar logger = exports.logger = exportedLogger;\n\n},{}],46:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = function () {\n function TimeRanges() {\n _classCallCheck(this, TimeRanges);\n }\n\n _createClass(TimeRanges, null, [{\n key: 'toString',\n value: function toString(r) {\n var log = '',\n len = r.length;\n for (var i = 0; i < len; i++) {\n log += '[' + r.start(i).toFixed(3) + ',' + r.end(i).toFixed(3) + ']';\n }\n return log;\n }\n }]);\n\n return TimeRanges;\n}();\n\nexports.default = TimeRanges;\n\n},{}],47:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * XHR based logger\n */\n\nvar _logger = _dereq_(45);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar XhrLoader = function () {\n function XhrLoader(config) {\n _classCallCheck(this, XhrLoader);\n\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n _createClass(XhrLoader, [{\n key: 'destroy',\n value: function destroy() {\n this.abort();\n this.loader = null;\n }\n }, {\n key: 'abort',\n value: function abort() {\n var loader = this.loader;\n if (loader && loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n\n window.clearTimeout(this.requestTimeout);\n this.requestTimeout = null;\n window.clearTimeout(this.retryTimeout);\n this.retryTimeout = null;\n }\n }, {\n key: 'load',\n value: function load(context, config, callbacks) {\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.stats = { trequest: performance.now(), retry: 0 };\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n }\n }, {\n key: 'loadInternal',\n value: function loadInternal() {\n var xhr,\n context = this.context;\n\n if (typeof XDomainRequest !== 'undefined') {\n xhr = this.loader = new XDomainRequest();\n } else {\n xhr = this.loader = new XMLHttpRequest();\n }\n\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n\n xhr.open('GET', context.url, true);\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.responseType = context.responseType;\n var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n if (this.xhrSetup) {\n this.xhrSetup(xhr, context.url);\n }\n // setup timeout before we perform request\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), this.config.timeout);\n xhr.send();\n }\n }, {\n key: 'readystatechange',\n value: function readystatechange(event) {\n var xhr = event.currentTarget,\n readyState = xhr.readyState,\n stats = this.stats,\n context = this.context,\n config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n if (status >= 200 && status < 300) {\n stats.tload = Math.max(stats.tfirst, performance.now());\n var data = void 0,\n len = void 0;\n if (context.responseType === 'arraybuffer') {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n var response = { url: xhr.responseURL, data: data };\n this.callbacks.onSuccess(response, stats, context);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _logger.logger.error(status + ' while loading ' + context.url);\n this.callbacks.onError({ code: status, text: xhr.statusText }, context);\n } else {\n // retry\n _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...');\n // aborts and resets internal state\n this.destroy();\n // schedule retry\n this.retryTimeout = window.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout() {\n _logger.logger.warn('timeout while loading ' + this.context.url);\n this.callbacks.onTimeout(this.stats, this.context);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // last args is to provide on progress data\n onProgress(stats, this.context, null);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"45\":45}]},{},[33])(33)\n});\n//# sourceMappingURL=hls.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hls.js/dist/hls.js\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"video.js\",\"commonjs2\":\"video.js\",\"amd\":\"video.js\",\"root\":\"videojs\"}\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar Hls = require('hls.js');\n\n/**\n * hls.js source handler\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = new Hls(options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n\n return function() {\n var now = Date.now();\n\n if (!_recoverDecodingErrorDate || (now - _recoverDecodingErrorDate) > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n }\n else if (!_recoverAudioCodecErrorDate || (now - _recoverAudioCodecErrorDate) > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function(e) {\n var mediaError = e.currentTarget.error;\n\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n }\n else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n *\n */\n this.dispose = function() {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function() {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(Hls.Events.LEVEL_LOADED, function(event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(Hls.Events.ERROR, function(event, data) {\n if (data.fatal) {\n switch (data.type) {\n case Hls.ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case Hls.ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n\n Object.keys(Hls.Events).forEach(function(key) {\n var eventName = Hls.Events[key];\n hls.on(eventName, function(event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\n\nvar hlsTypeRE = /^application\\/(x-mpegURL|vnd\\.apple\\.mpegURL)$/i;\nvar hlsExtRE = /\\.m3u8/i;\n\nvar HlsSourceHandler = {\n canHandleSource: function(source) {\n if (source.skipContribHlsJs) {\n return '';\n }\n else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n }\n else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n }\n else {\n return '';\n }\n },\n handleSource: function(source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function(type) {\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n }\n};\n\nif (Hls.isSupported()) {\n var videojs = require('video.js'); // resolved UMD-wise through webpack\n\n if (videojs) {\n videojs.getComponent('Html5').registerSourceHandler(HlsSourceHandler, 0);\n }\n else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/videojs5.hlsjs.js\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 4d5c93c..e2d0ce2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "videojs-contrib-hls.js", - "version": "3.0.0", + "version": "3.0.1", "description": "hls.js plugin for videojs", "main": "dist/videojs-contrib-hlsjs.min.js", "directories": {