diff --git a/API.md b/API.md index 23bb5fbd2a5..d8ad23858ce 100644 --- a/API.md +++ b/API.md @@ -144,7 +144,7 @@ should be invoked to recover media error case Hls.ErrorTypes.NETWORK_ERROR: // try to recover network error console.log("fatal network error encountered, try to recover"); - hls.recoverNetworkError(); + hls.startLoad(); break; case Hls.ErrorTypes.MEDIA_ERROR: console.log("fatal media error encountered, try to recover"); diff --git a/design.md b/design.md index 8d723224af1..f3cc3ff9b5e 100644 --- a/design.md +++ b/design.md @@ -118,20 +118,20 @@ design idea is pretty simple : ## Error detection and Handling - - ```MANIFEST_LOAD_ERROR``` is raised by [src/loader/playlist-loader.js][] upon xhr failure detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.recoverNetworkError()``` could help recover it. - - ```MANIFEST_LOAD_TIMEOUT``` is raised by [src/loader/playlist-loader.js][] upon xhr timeout detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.recoverNetworkError()``` could help recover it. + - ```MANIFEST_LOAD_ERROR``` is raised by [src/loader/playlist-loader.js][] upon xhr failure detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.startLoad()``` could help recover it. + - ```MANIFEST_LOAD_TIMEOUT``` is raised by [src/loader/playlist-loader.js][] upon xhr timeout detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.startLoad()``` could help recover it. - ```MANIFEST_PARSING_ERROR``` is raised by [src/loader/playlist-loader.js][] if Manifest parsing fails (no EXTM3U delimiter, no levels found in Manifest, ...) - - ```LEVEL_LOAD_ERROR``` is raised by [src/loader/playlist-loader.js][] upon xhr failure detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.recoverNetworkError()``` could help recover it. - - ```LEVEL_LOAD_TIMEOUT``` is raised by [src/loader/playlist-loader.js][] upon xhr timeout detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.recoverNetworkError()``` could help recover it. + - ```LEVEL_LOAD_ERROR``` is raised by [src/loader/playlist-loader.js][] upon xhr failure detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.startLoad()``` could help recover it. + - ```LEVEL_LOAD_TIMEOUT``` is raised by [src/loader/playlist-loader.js][] upon xhr timeout detected by [src/utils/xhr-loader.js][]. this error is marked as fatal and will not be recovered automatically. a call to ```hls.startLoad()``` could help recover it. - ```LEVEL_SWITCH_ERROR``` is raised by [src/controller/level-controller.js][] if user tries to switch to an invalid level (invalid/out of range level id) - ```FRAG_LOAD_ERROR``` is raised by [src/loader/fragment-loader.js][] upon xhr failure detected by [src/utils/xhr-loader.js][]. - if auto level switch is enabled and loaded frag level is greater than 0, this error is not fatal: in that case [src/controller/level-controller.js][] will trigger an emergency switch down to level 0. - - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.recoverNetworkError()``` could help recover it. + - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.startLoad()``` could help recover it. - ```FRAG_LOOP_LOADING_ERROR``` is raised by [src/controller/buffer-controller.js][] upon detection of same fragment being requested in loop. this could happen with badly formatted fragments. - if auto level switch is enabled and loaded frag level is greater than 0, this error is not fatal: in that case [src/controller/level-controller.js][] will trigger an emergency switch down to level 0. - - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.recoverNetworkError()``` could help recover it. + - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.startLoad()``` could help recover it. - ```FRAG_LOAD_TIMEOUT``` is raised by [src/loader/fragment-loader.js][] upon xhr timeout detected by [src/utils/xhr-loader.js][]. - if auto level switch is enabled and loaded frag level is greater than 0, this error is not fatal: in that case [src/controller/level-controller.js][] will trigger an emergency switch down to level 0. - - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.recoverNetworkError()``` could help recover it. + - if frag level is 0 or auto level switch is disabled, this error is marked as fatal and a call to ```hls.startLoad()``` could help recover it. - ```FRAG_PARSING_ERROR``` is raised by [src/demux/tsdemuxer.js][] upon TS parsing error. this error is not fatal. - ```FRAG_APPENDING_ERROR``` is raised by [src/controller/buffer-controller.js][] after SourceBuffer appending error. this error is raised after 3 retries. this error is marked as fatal and a call to ```hls.recoverMediaError()``` could help recover it. diff --git a/dist/hls.js b/dist/hls.js index 0493da58d86..b9e2ea02b69 100644 --- a/dist/hls.js +++ b/dist/hls.js @@ -405,8 +405,6 @@ var AbrController = (function () { this.lastfetchlevel = data.frag.level; this.lastbw = stats.loaded * 8 / this.lastfetchduration; //console.log('fetchDuration:${this.lastfetchduration},bw:${(this.lastbw/1000).toFixed(0)}/${stats.aborted}'); - // unset forced auto level - this._nextAutoLevel = -1; } } @@ -501,19 +499,22 @@ var _helperLevelHelper2 = _interopRequireDefault(_helperLevelHelper); var _errors = require('../errors'); +var State = { + ERROR: -2, + STARTING: -1, + IDLE: 0, + LOADING: 1, + WAITING_LEVEL: 2, + PARSING: 3, + PARSED: 4, + APPENDING: 5, + BUFFER_FLUSHING: 6 +}; + var BufferController = (function () { function BufferController(hls) { _classCallCheck(this, BufferController); - this.ERROR = -2; - this.STARTING = -1; - this.IDLE = 0; - this.LOADING = 1; - this.WAITING_LEVEL = 2; - this.PARSING = 3; - this.PARSED = 4; - this.APPENDING = 5; - this.BUFFER_FLUSHING = 6; this.config = hls.config; this.hls = hls; // Source Buffer listeners @@ -546,7 +547,7 @@ var BufferController = (function () { hls.off(_events2['default'].MSE_DETACHING, this.onmsed0); hls.off(_events2['default'].MSE_DETACHED, this.onmsed); hls.off(_events2['default'].MANIFEST_PARSED, this.onmp); - this.state = this.IDLE; + this.state = State.IDLE; } }, { key: 'startLoad', @@ -559,10 +560,10 @@ var BufferController = (function () { _utilsLogger.logger.log('resuming video'); this.video.play(); } - this.state = this.IDLE; + this.state = State.IDLE; } else { this.lastCurrentTime = 0; - this.state = this.STARTING; + this.state = State.STARTING; } this.nextLoadPosition = this.startPosition = this.lastCurrentTime; this.tick(); @@ -629,25 +630,29 @@ var BufferController = (function () { }, { key: 'tick', value: function tick() { - var pos, level, levelDetails, fragIdx; + var pos, + level, + levelDetails, + fragIdx, + hls = this.hls; switch (this.state) { - case this.ERROR: + case State.ERROR: //don't do anything in error state to avoid breaking further ... break; - case this.STARTING: + case State.STARTING: // determine load level - this.startLevel = this.hls.startLevel; + this.startLevel = hls.startLevel; if (this.startLevel === -1) { // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level this.startLevel = 0; this.fragBitrateTest = true; } // set new level to playlist loader : this will trigger start level load - this.level = this.hls.nextLoadLevel = this.startLevel; - this.state = this.WAITING_LEVEL; + this.level = hls.nextLoadLevel = this.startLevel; + this.state = State.WAITING_LEVEL; this.loadedmetadata = false; break; - case this.IDLE: + case State.IDLE: // if video detached or unbound exit loop if (!this.video) { break; @@ -666,7 +671,7 @@ var BufferController = (function () { level = this.startLevel; } else { // we are not at playback start, get next load level from level Controller - level = this.hls.nextLoadLevel; + level = hls.nextLoadLevel; } var bufferInfo = this.bufferInfo(pos, 0.3), bufferLen = bufferInfo.len, @@ -682,12 +687,12 @@ var BufferController = (function () { // if buffer length is less than maxBufLen try to load a new fragment if (bufferLen < maxBufLen) { // set next load level : this will trigger a playlist load if needed - this.hls.nextLoadLevel = level; + hls.nextLoadLevel = level; this.level = level; levelDetails = this.levels[level].details; // if level info not retrieved yet, switch state and wait for level retrieval if (typeof levelDetails === 'undefined') { - this.state = this.WAITING_LEVEL; + this.state = State.WAITING_LEVEL; break; } // find fragment index, contiguous with end of buffer position @@ -759,7 +764,7 @@ var BufferController = (function () { } _utilsLogger.logger.log('Loading ' + _frag.sn + ' of [' + levelDetails.startSN + ' ,' + levelDetails.endSN + '],level ' + level + ', currentTime:' + pos + ',bufferEnd:' + bufferEnd.toFixed(3)); //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3)); - _frag.autoLevel = this.hls.autoLevelEnabled; + _frag.autoLevel = hls.autoLevelEnabled; if (this.levels.length > 1) { _frag.expectedLen = Math.round(_frag.duration * this.levels[level].bitrate / 8); _frag.trequest = new Date(); @@ -775,7 +780,7 @@ var BufferController = (function () { var maxThreshold = this.config.fragLoadingLoopThreshold; // if this frag has already been loaded 3 times, and if it has been reloaded recently if (_frag.loadCounter > maxThreshold && Math.abs(this.fragLoadIdx - _frag.loadIdx) < maxThreshold) { - this.hls.trigger(_events2['default'].ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: _frag }); + hls.trigger(_events2['default'].ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: _frag }); return; } } else { @@ -784,18 +789,18 @@ var BufferController = (function () { _frag.loadIdx = this.fragLoadIdx; this.fragCurrent = _frag; this.startFragmentRequested = true; - this.hls.trigger(_events2['default'].FRAG_LOADING, { frag: _frag }); - this.state = this.LOADING; + hls.trigger(_events2['default'].FRAG_LOADING, { frag: _frag }); + this.state = State.LOADING; } break; - case this.WAITING_LEVEL: + case State.WAITING_LEVEL: level = this.levels[this.level]; // check if playlist is already loaded if (level && level.details) { - this.state = this.IDLE; + this.state = State.IDLE; } break; - case this.LOADING: + case State.LOADING: /* monitor fragment retrieval time... we compute expected time of arrival of the complete fragment. @@ -816,7 +821,7 @@ var BufferController = (function () { pos = v.currentTime; var fragLoadedDelay = (frag.expectedLen - frag.loaded) / loadRate; var bufferStarvationDelay = this.bufferInfo(pos, 0.3).end - pos; - var fragLevelNextLoadedDelay = frag.duration * this.levels[this.hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps + var fragLevelNextLoadedDelay = frag.duration * this.levels[hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps /* if we have less than 2 frag duration in buffer and if frag loaded delay is greater than buffer starvation delay ... and also bigger than duration needed to load fragment at next level ...*/ if (bufferStarvationDelay < 2 * frag.duration && fragLoadedDelay > bufferStarvationDelay && fragLoadedDelay > fragLevelNextLoadedDelay) { @@ -825,18 +830,18 @@ var BufferController = (function () { _utilsLogger.logger.log('fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :' + fragLoadedDelay.toFixed(1) + '/' + bufferStarvationDelay.toFixed(1) + '/' + fragLevelNextLoadedDelay.toFixed(1)); //abort fragment loading frag.loader.abort(); - this.hls.trigger(_events2['default'].FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag }); + hls.trigger(_events2['default'].FRAG_LOAD_EMERGENCY_ABORTED, { frag: frag }); // switch back to IDLE state to request new fragment at lowest level - this.state = this.IDLE; + this.state = State.IDLE; } } } break; - case this.PARSING: + case State.PARSING: // nothing to do, wait for fragment being parsed break; - case this.PARSED: - case this.APPENDING: + case State.PARSED: + case State.APPENDING: if (this.sourceBuffer) { // if MP4 segment appending in progress nothing to do if (this.sourceBuffer.audio && this.sourceBuffer.audio.updating || this.sourceBuffer.video && this.sourceBuffer.video.updating) { @@ -864,22 +869,22 @@ var BufferController = (function () { if (this.appendError > this.config.appendErrorMaxRetry) { _utilsLogger.logger.log('fail ' + this.config.appendErrorMaxRetry + ' times to append segment in sourceBuffer'); event.fatal = true; - this.hls.trigger(_events2['default'].ERROR, event); - this.state = this.ERROR; + hls.trigger(_events2['default'].ERROR, event); + this.state = State.ERROR; return; } else { event.fatal = false; - this.hls.trigger(_events2['default'].ERROR, event); + hls.trigger(_events2['default'].ERROR, event); } } - this.state = this.APPENDING; + this.state = State.APPENDING; } } else { // sourceBuffer undefined, switch back to IDLE state - this.state = this.IDLE; + this.state = State.IDLE; } break; - case this.BUFFER_FLUSHING: + case State.BUFFER_FLUSHING: // loop through all buffer ranges to flush while (this.flushRange.length) { var range = this.flushRange[0]; @@ -898,7 +903,7 @@ var BufferController = (function () { this.immediateLevelSwitchEnd(); } // move to IDLE once flush complete. this should trigger new fragment loading - this.state = this.IDLE; + this.state = State.IDLE; // reset reference to frag this.fragPrevious = null; } @@ -1124,7 +1129,7 @@ var BufferController = (function () { this.flushBufferCounter = 0; this.flushRange.push({ start: 0, end: Number.POSITIVE_INFINITY }); // trigger a sourceBuffer flush - this.state = this.BUFFER_FLUSHING; + this.state = State.BUFFER_FLUSHING; // increase fragment load Index to avoid frag loop loading error after buffer flush this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold; // speed up switching, trigger timer function @@ -1182,12 +1187,18 @@ var BufferController = (function () { if (nextRange) { // flush position is the start position of this new buffer this.flushRange.push({ start: nextRange.start, end: Number.POSITIVE_INFINITY }); + // if we are here, we can also cancel any loading/demuxing in progress, as they are useless + var fragCurrent = this.fragCurrent; + if (fragCurrent && fragCurrent.loader) { + fragCurrent.loader.abort(); + } + this.fragCurrent = null; } } if (this.flushRange.length) { this.flushBufferCounter = 0; // trigger a sourceBuffer flush - this.state = this.BUFFER_FLUSHING; + this.state = State.BUFFER_FLUSHING; // increase fragment load Index to avoid frag loop loading error after buffer flush this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold; // speed up switching, trigger timer function @@ -1240,16 +1251,19 @@ var BufferController = (function () { }, { key: 'onVideoSeeking', value: function onVideoSeeking() { - if (this.state === this.LOADING) { + if (this.state === State.LOADING) { // check if currently loaded fragment is inside buffer. //if outside, cancel fragment loading, otherwise do nothing if (this.bufferInfo(this.video.currentTime, 0.3).len === 0) { _utilsLogger.logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load'); - this.fragCurrent.loader.abort(); - this.fragCurrent = null; + var fragCurrent = this.fragCurrent; + if (fragCurrent) { + fragCurrent.loader.abort(); + this.fragCurrent = null; + } this.fragPrevious = null; // switch to IDLE state to load new fragment - this.state = this.IDLE; + this.state = State.IDLE; } } if (this.video) { @@ -1354,8 +1368,8 @@ var BufferController = (function () { this.startLevelLoaded = true; } // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment - if (this.state === this.WAITING_LEVEL) { - this.state = this.IDLE; + if (this.state === State.WAITING_LEVEL) { + this.state = State.IDLE; } //trigger handler right now this.tick(); @@ -1364,30 +1378,32 @@ var BufferController = (function () { key: 'onFragLoaded', value: function onFragLoaded(event, data) { var fragCurrent = this.fragCurrent; - if (this.state === this.LOADING && fragCurrent && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) { + if (this.state === State.LOADING && fragCurrent && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) { if (this.fragBitrateTest === true) { // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo - this.state = this.IDLE; + this.state = State.IDLE; this.fragBitrateTest = false; data.stats.tparsed = data.stats.tbuffered = new Date(); this.hls.trigger(_events2['default'].FRAG_BUFFERED, { stats: data.stats, frag: fragCurrent }); } else { - this.state = this.PARSING; + this.state = State.PARSING; // transmux the MPEG-TS data to ISO-BMFF segments this.stats = data.stats; var currentLevel = this.levels[this.level], details = currentLevel.details, duration = details.totalduration, - start = fragCurrent.start; - _utilsLogger.logger.log('Demuxing ' + fragCurrent.sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + this.level); - this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, this.level, duration); + start = fragCurrent.start, + level = fragCurrent.level, + sn = fragCurrent.sn; + _utilsLogger.logger.log('Demuxing ' + sn + ' of [' + details.startSN + ' ,' + details.endSN + '],level ' + level); + this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, duration); } } } }, { key: 'onInitSegment', value: function onInitSegment(event, data) { - if (this.state === this.PARSING) { + if (this.state === State.PARSING) { // check if codecs have been explicitely defined in the master playlist for this level; // if yes use these ones instead of the ones parsed from the demux var audioCodec = this.levels[this.level].audioCodec, @@ -1404,7 +1420,8 @@ var BufferController = (function () { } // in case several audio codecs might be used, force HE-AAC for audio (some browsers don't support audio codec switch) //don't do it for mono streams ... - if (this.audiocodecswitch && data.audioChannelCount === 2 && navigator.userAgent.toLowerCase().indexOf('android') === -1 && navigator.userAgent.toLowerCase().indexOf('firefox') === -1) { + var ua = navigator.userAgent.toLowerCase(); + if (this.audiocodecswitch && data.audioChannelCount !== 1 && ua.indexOf('android') === -1 && ua.indexOf('firefox') === -1) { audioCodec = 'mp4a.40.5'; } if (!this.sourceBuffer) { @@ -1435,7 +1452,7 @@ var BufferController = (function () { }, { key: 'onFragParsing', value: function onFragParsing(event, data) { - if (this.state === this.PARSING) { + if (this.state === State.PARSING) { this.tparse2 = Date.now(); var level = this.levels[this.level], frag = this.fragCurrent; @@ -1457,8 +1474,8 @@ var BufferController = (function () { }, { key: 'onFragParsed', value: function onFragParsed() { - if (this.state === this.PARSING) { - this.state = this.PARSED; + if (this.state === State.PARSING) { + this.state = State.PARSED; this.stats.tparsed = new Date(); //trigger handler right now this.tick(); @@ -1476,7 +1493,7 @@ var BufferController = (function () { case _errors.ErrorDetails.LEVEL_LOAD_TIMEOUT: // if fatal error, stop processing, otherwise move to IDLE to retry loading _utilsLogger.logger.warn('buffer controller: ' + data.details + ' while loading frag,switch to ' + (data.fatal ? 'ERROR' : 'IDLE') + ' state ...'); - this.state = data.fatal ? this.ERROR : this.IDLE; + this.state = data.fatal ? State.ERROR : State.IDLE; break; default: break; @@ -1486,7 +1503,7 @@ var BufferController = (function () { key: 'onSBUpdateEnd', value: function onSBUpdateEnd() { //trigger handler right now - if (this.state === this.APPENDING && this.mp4segments.length === 0) { + if (this.state === State.APPENDING && this.mp4segments.length === 0) { var frag = this.fragCurrent, stats = this.stats; if (frag) { @@ -1495,7 +1512,7 @@ var BufferController = (function () { this.fragLastKbps = Math.round(8 * stats.length / (stats.tbuffered - stats.tfirst)); this.hls.trigger(_events2['default'].FRAG_BUFFERED, { stats: stats, frag: frag }); _utilsLogger.logger.log('video buffered : ' + this.timeRangesToString(this.video.buffered)); - this.state = this.IDLE; + this.state = State.IDLE; } var video = this.video; if (video) { @@ -1527,7 +1544,7 @@ var BufferController = (function () { key: 'onSBUpdateError', value: function onSBUpdateError(event) { _utilsLogger.logger.error('sourceBuffer error:' + event); - this.state = this.ERROR; + this.state = State.ERROR; this.hls.trigger(_events2['default'].ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_APPENDING_ERROR, fatal: true, frag: this.fragCurrent }); } }, { @@ -1719,7 +1736,12 @@ var LevelController = (function () { }, { key: 'onError', value: function onError(event, data) { + if (data.fatal) { + return; + } + var details = data.details, + hls = this.hls, levelId, level; // try to recover not fatal errors @@ -1751,7 +1773,7 @@ var LevelController = (function () { var recoverable = this._manualLevel === -1 && levelId; if (recoverable) { _utilsLogger.logger.warn('level controller,' + details + ': emergency switch-down for next fragment'); - this.hls.abrController.nextAutoLevel = 0; + hls.abrController.nextAutoLevel = 0; } else if (level && level.details && level.details.live) { _utilsLogger.logger.warn('level controller,' + details + ' on live stream, discard'); } else { @@ -1761,10 +1783,10 @@ var LevelController = (function () { if (this.timer) { clearInterval(this.timer); this.timer = null; - // redispatch same error but with fatal set to true - data.fatal = true; - this.hls.trigger(event, data); } + // redispatch same error but with fatal set to true + data.fatal = true; + hls.trigger(event, data); } } } @@ -3569,7 +3591,6 @@ var Hls = (function () { ms.addEventListener('sourceclose', this.onmsc); // link video and media Source video.src = URL.createObjectURL(ms); - video.addEventListener('error', this.onverror); } }, { key: 'detachVideo', diff --git a/dist/hls.js.map b/dist/hls.js.map index 5f28caed8af..d8b13ec0cbc 100644 --- a/dist/hls.js.map +++ b/dist/hls.js.map @@ -24,25 +24,25 @@ "src/utils/xhr-loader.js" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7SA;AACA;AACA;AACA;AACA;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CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;OACpB,MAAM;AACL,cAAM,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACxC,4BAAO,KAAK,CAAI,KAAK,CAAC,IAAI,uBAAkB,IAAI,CAAC,GAAG,CAAI,CAAC;AACzD,YAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;OACrB;KACF;;;WAEU,qBAAC,KAAK,EAAE;AACjB,0BAAO,IAAI,4BAA0B,IAAI,CAAC,GAAG,CAAI,CAAC;AAClD,UAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACnC;;;WAEW,sBAAC,KAAK,EAAE;AAClB,UAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACvB,UAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE;AACzB,aAAK,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;OAC3B;AACD,WAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAC5B,UAAI,IAAI,CAAC,UAAU,EAAE;AACnB,YAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;OAC/B;KACF;;;SA9FG,SAAS;;;qBAiGA,SAAS", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAI,CAAC,GAAG,CAAI,CAAC;AACzD,YAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;OACrB;KACF;;;WAEU,qBAAC,KAAK,EAAE;AACjB,0BAAO,IAAI,4BAA0B,IAAI,CAAC,GAAG,CAAI,CAAC;AAClD,UAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACnC;;;WAEW,sBAAC,KAAK,EAAE;AAClB,UAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACvB,UAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE;AACzB,aAAK,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;OAC3B;AACD,WAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAC5B,UAAI,IAAI,CAAC,UAAU,EAAE;AACnB,YAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;OAC/B;KACF;;;SA9FG,SAAS;;;qBAiGA,SAAS", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(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 {\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.listenerCount = function(emitter, type) {\n var ret;\n if (!emitter._events || !emitter._events[type])\n ret = 0;\n else if (isFunction(emitter._events[type]))\n ret = 1;\n else\n ret = emitter._events[type].length;\n return ret;\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", "var bundleFn = arguments[3];\nvar sources = arguments[4];\nvar cache = arguments[5];\n\nvar stringify = JSON.stringify;\n\nmodule.exports = function (fn) {\n var keys = [];\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 if (cache[key].exports === 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'],'require(' + stringify(wkey) + ')(self)'),\n scache\n ];\n \n var src = '(' + bundleFn + ')({'\n + Object.keys(sources).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 return new Worker(URL.createObjectURL(\n new Blob([src], { type: 'text/javascript' })\n ));\n};\n", - "/*\n * simple ABR Controller\n*/\n\nimport Event from '../events';\n\nclass AbrController {\n\n constructor(hls) {\n this.hls = hls;\n this.lastfetchlevel = 0;\n this._autoLevelCapping = -1;\n this._nextAutoLevel = -1;\n this.onflp = this.onFragmentLoadProgress.bind(this);\n hls.on(Event.FRAG_LOAD_PROGRESS, this.onflp);\n }\n\n destroy() {\n this.hls.off(Event.FRAG_LOAD_PROGRESS, this.onflp);\n }\n\n onFragmentLoadProgress(event, data) {\n var stats = data.stats;\n if (stats.aborted === undefined) {\n this.lastfetchduration = (new Date() - stats.trequest) / 1000;\n this.lastfetchlevel = data.frag.level;\n this.lastbw = (stats.loaded * 8) / this.lastfetchduration;\n //console.log('fetchDuration:${this.lastfetchduration},bw:${(this.lastbw/1000).toFixed(0)}/${stats.aborted}');\n // unset forced auto level\n this._nextAutoLevel =-1;\n }\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n\n get nextAutoLevel() {\n var lastbw = this.lastbw, hls = this.hls,adjustedbw, i, maxAutoLevel;\n if (this._autoLevelCapping === -1) {\n maxAutoLevel = hls.levels.length - 1;\n } else {\n maxAutoLevel = this._autoLevelCapping;\n }\n\n if (this._nextAutoLevel !== -1) {\n return Math.min(this._nextAutoLevel,maxAutoLevel);\n }\n\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 for (i = 0; i <= maxAutoLevel; i++) {\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 <= this.lastfetchlevel) {\n adjustedbw = 0.8 * lastbw;\n } else {\n adjustedbw = 0.7 * lastbw;\n }\n if (adjustedbw < hls.levels[i].bitrate) {\n return Math.max(0, i - 1);\n }\n }\n return i - 1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n", - "/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport Demuxer from '../demux/demuxer';\nimport LevelHelper from '../helper/level-helper';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\nclass BufferController {\n\n constructor(hls) {\n this.ERROR = -2;\n this.STARTING = -1;\n this.IDLE = 0;\n this.LOADING = 1;\n this.WAITING_LEVEL = 2;\n this.PARSING = 3;\n this.PARSED = 4;\n this.APPENDING = 5;\n this.BUFFER_FLUSHING = 6;\n this.config = hls.config;\n this.hls = hls;\n // Source Buffer listeners\n this.onsbue = this.onSBUpdateEnd.bind(this);\n this.onsbe = this.onSBUpdateError.bind(this);\n // internal listeners\n this.onmse = this.onMSEAttached.bind(this);\n this.onmsed0 = this.onMSEDetaching.bind(this);\n this.onmsed = this.onMSEDetached.bind(this);\n this.onmp = this.onManifestParsed.bind(this);\n this.onll = this.onLevelLoaded.bind(this);\n this.onfl = this.onFragLoaded.bind(this);\n this.onis = this.onInitSegment.bind(this);\n this.onfpg = this.onFragParsing.bind(this);\n this.onfp = this.onFragParsed.bind(this);\n this.onerr = this.onError.bind(this);\n this.ontick = this.tick.bind(this);\n hls.on(Event.MSE_ATTACHED, this.onmse);\n hls.on(Event.MSE_DETACHING, this.onmsed0);\n hls.on(Event.MSE_DETACHED, this.onmsed);\n hls.on(Event.MANIFEST_PARSED, this.onmp);\n }\n\n destroy() {\n this.stop();\n var hls = this.hls;\n hls.off(Event.MSE_ATTACHED, this.onmse);\n hls.off(Event.MSE_DETACHING, this.onmsed0);\n hls.off(Event.MSE_DETACHED, this.onmsed);\n hls.off(Event.MANIFEST_PARSED, this.onmp);\n this.state = this.IDLE;\n }\n\n startLoad() {\n if (this.levels && this.video) {\n this.startInternal();\n if (this.lastCurrentTime) {\n logger.log(`seeking @ ${this.lastCurrentTime}`);\n if (!this.lastPaused) {\n logger.log('resuming video');\n this.video.play();\n }\n this.state = this.IDLE;\n } else {\n this.lastCurrentTime = 0;\n this.state = this.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n logger.warn('cannot start loading as either manifest not parsed or video not attached');\n }\n }\n\n startInternal() {\n var hls = this.hls;\n this.stop();\n this.demuxer = new Demuxer(hls);\n this.timer = setInterval(this.ontick, 100);\n this.level = -1;\n hls.on(Event.FRAG_LOADED, this.onfl);\n hls.on(Event.FRAG_PARSING_INIT_SEGMENT, this.onis);\n hls.on(Event.FRAG_PARSING_DATA, this.onfpg);\n hls.on(Event.FRAG_PARSED, this.onfp);\n hls.on(Event.ERROR, this.onerr);\n hls.on(Event.LEVEL_LOADED, this.onll);\n }\n\n stop() {\n this.mp4segments = [];\n this.flushRange = [];\n this.bufferRange = [];\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.sourceBuffer) {\n for(var type in this.sourceBuffer) {\n var sb = this.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 }\n this.sourceBuffer = null;\n }\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n var hls = this.hls;\n hls.off(Event.FRAG_LOADED, this.onfl);\n hls.off(Event.FRAG_PARSED, this.onfp);\n hls.off(Event.FRAG_PARSING_DATA, this.onfpg);\n hls.off(Event.LEVEL_LOADED, this.onll);\n hls.off(Event.FRAG_PARSING_INIT_SEGMENT, this.onis);\n hls.off(Event.ERROR, this.onerr);\n }\n\n tick() {\n var pos, level, levelDetails, fragIdx;\n switch(this.state) {\n case this.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case this.STARTING:\n // determine load level\n this.startLevel = this.hls.startLevel;\n if (this.startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n this.startLevel = 0;\n this.fragBitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n this.level = this.hls.nextLoadLevel = this.startLevel;\n this.state = this.WAITING_LEVEL;\n this.loadedmetadata = false;\n break;\n case this.IDLE:\n // if video detached or unbound exit loop\n if (!this.video) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // ensure 60s of buffer upfront\n // if we have not yet loaded any fragment, start loading from start position\n if (this.loadedmetadata) {\n pos = this.video.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n if (this.startFragmentRequested === false) {\n level = this.startLevel;\n } else {\n // we are not at playback start, get next load level from level Controller\n level = this.hls.nextLoadLevel;\n }\n var bufferInfo = this.bufferInfo(pos,0.3), bufferLen = bufferInfo.len, bufferEnd = bufferInfo.end, maxBufLen;\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 ((this.levels[level]).hasOwnProperty('bitrate')) {\n maxBufLen = Math.max(8 * this.config.maxBufferSize / this.levels[level].bitrate, this.config.maxBufferLength);\n maxBufLen = Math.min(maxBufLen, this.config.maxMaxBufferLength);\n } else {\n maxBufLen = this.config.maxBufferLength;\n }\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen) {\n // set next load level : this will trigger a playlist load if needed\n this.hls.nextLoadLevel = level;\n this.level = level;\n levelDetails = this.levels[level].details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n if (typeof levelDetails === 'undefined') {\n this.state = this.WAITING_LEVEL;\n break;\n }\n // find fragment index, contiguous with end of buffer position\n let fragments = levelDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\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 // 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.video.seeking}`);\n if (bufferEnd < Math.max(start,end-this.config.liveMaxLatencyDurationCount*levelDetails.targetduration)) {\n this.seekAfterBuffered = start + Math.max(0, levelDetails.totalduration - this.config.liveSyncDurationCount * levelDetails.targetduration);\n logger.log(`buffer end: ${bufferEnd} is located too far from the end of live sliding playlist, media position will be reseted to: ${this.seekAfterBuffered.toFixed(3)}`);\n bufferEnd = this.seekAfterBuffered;\n }\n if (this.startFragmentRequested && !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 (this.fragPrevious) {\n var targetSN = this.fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n 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.round(fragLen / 2)];\n logger.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\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 if (bufferEnd > end) {\n // reach end of playlist\n break;\n }\n for (fragIdx = 0; fragIdx < fragLen; fragIdx++) {\n frag = fragments[fragIdx];\n start = frag.start;\n //logger.log('level/sn/sliding/start/end/bufEnd:${level}/${frag.sn}/${sliding.toFixed(3)}/${start.toFixed(3)}/${(start+frag.duration).toFixed(3)}/${bufferEnd.toFixed(3)}');\n // offset should be within fragment boundary\n if (start <= bufferEnd && (start + frag.duration) > bufferEnd) {\n break;\n }\n }\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (this.fragPrevious && frag.level === this.fragPrevious.level && frag.sn === this.fragPrevious.sn) {\n if (fragIdx === (fragLen-1)) {\n // we are at the end of the playlist and we already loaded last fragment, don't do anything\n break;\n } else {\n frag = fragments[fragIdx + 1];\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n }\n }\n logger.log(`Loading ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}, currentTime:${pos},bufferEnd:${bufferEnd.toFixed(3)}`);\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n frag.autoLevel = this.hls.autoLevelEnabled;\n if (this.levels.length > 1) {\n frag.expectedLen = Math.round(frag.duration * this.levels[level].bitrate / 8);\n frag.trequest = new Date();\n }\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 let maxThreshold = this.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 this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag});\n return;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragmentRequested = true;\n this.hls.trigger(Event.FRAG_LOADING, {frag: frag});\n this.state = this.LOADING;\n }\n break;\n case this.WAITING_LEVEL:\n level = this.levels[this.level];\n // check if playlist is already loaded\n if (level && level.details) {\n this.state = this.IDLE;\n }\n break;\n case this.LOADING:\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 let v = this.video,frag = this.fragCurrent;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded) AND autoswitching enabled AND not lowest level AND multiple levels */\n if (v && (!v.paused || this.loadedmetadata === false) && frag.autoLevel && this.level && this.levels.length > 1) {\n var requestDelay = new Date() - frag.trequest;\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > (500 * frag.duration)) {\n var loadRate = frag.loaded * 1000 / requestDelay; // byte/s\n if (frag.expectedLen < frag.loaded) {\n frag.expectedLen = frag.loaded;\n }\n pos = v.currentTime;\n var fragLoadedDelay = (frag.expectedLen - frag.loaded) / loadRate;\n var bufferStarvationDelay = this.bufferInfo(pos,0.3).end - pos;\n var fragLevelNextLoadedDelay = frag.duration * this.levels[this.hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps\n /* if we have less than 2 frag duration in buffer and if frag loaded delay is greater than buffer starvation delay\n ... and also bigger than duration needed to load fragment at next level ...*/\n if (bufferStarvationDelay < (2 * frag.duration) && fragLoadedDelay > bufferStarvationDelay && fragLoadedDelay > fragLevelNextLoadedDelay) {\n // abort fragment loading ...\n logger.warn('loading too slow, abort fragment loading');\n logger.log(`fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :${fragLoadedDelay.toFixed(1)}/${bufferStarvationDelay.toFixed(1)}/${fragLevelNextLoadedDelay.toFixed(1)}`);\n //abort fragment loading\n frag.loader.abort();\n this.hls.trigger(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag});\n // switch back to IDLE state to request new fragment at lowest level\n this.state = this.IDLE;\n }\n }\n }\n break;\n case this.PARSING:\n // nothing to do, wait for fragment being parsed\n break;\n case this.PARSED:\n case this.APPENDING:\n if (this.sourceBuffer) {\n // if MP4 segment appending in progress nothing to do\n if ((this.sourceBuffer.audio && this.sourceBuffer.audio.updating) ||\n (this.sourceBuffer.video && this.sourceBuffer.video.updating)) {\n //logger.log('sb append in progress');\n // check if any MP4 segments left to append\n } else if (this.mp4segments.length) {\n var segment = this.mp4segments.shift();\n try {\n //logger.log('appending ${segment.type} SB, size:${segment.data.length}');\n this.sourceBuffer[segment.type].appendBuffer(segment.data);\n this.appendError = 0;\n } catch(err) {\n // in case any error occured while appending, put back segment in mp4segments table\n logger.error(`error while trying to append buffer:${err.message},try appending later`);\n this.mp4segments.unshift(segment);\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n var event = {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_APPENDING_ERROR, 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 > this.config.appendErrorMaxRetry) {\n logger.log(`fail ${this.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n event.fatal = true;\n this.hls.trigger(Event.ERROR, event);\n this.state = this.ERROR;\n return;\n } else {\n event.fatal = false;\n this.hls.trigger(Event.ERROR, event);\n }\n }\n this.state = this.APPENDING;\n }\n } else {\n // sourceBuffer undefined, switch back to IDLE state\n this.state = this.IDLE;\n }\n break;\n case this.BUFFER_FLUSHING:\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)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n } else {\n // flush in progress, come back later\n break;\n }\n }\n if (this.flushRange.length === 0) {\n // handle end of immediate switching if needed\n if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n }\n // move to IDLE once flush complete. this should trigger new fragment loading\n this.state = this.IDLE;\n // reset reference to frag\n this.fragPrevious = null;\n }\n /* if not everything flushed, stay in BUFFER_FLUSHING state. we will come back here\n each time sourceBuffer updateend() callback will be triggered\n */\n break;\n default:\n break;\n }\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n bufferInfo(pos,maxHoleDuration) {\n var v = this.video,\n buffered = v.buffered,\n bufferLen,\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferStart, bufferEnd,bufferStartNext,\n i;\n var buffered2 = [];\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 //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if ((buffered2.length) && (buffered.start(i) - buffered2[buffered2.length - 1].end) < maxHoleDuration) {\n buffered2[buffered2.length - 1].end = buffered.end(i);\n } else {\n buffered2.push({start: buffered.start(i), end: buffered.end(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 + maxHoleDuration;\n bufferLen = bufferEnd - pos;\n } else if ((pos + maxHoleDuration) < start) {\n bufferStartNext = start;\n }\n }\n return {len: bufferLen, start: bufferStart, end: bufferEnd, nextStart : bufferStartNext};\n }\n\n getBufferRange(position) {\n var i, range;\n for (i = this.bufferRange.length - 1; i >=0; i--) {\n range = this.bufferRange[i];\n if (position >= range.start && position <= range.end) {\n return range;\n }\n }\n return null;\n }\n\n get currentLevel() {\n if (this.video) {\n var range = this.getBufferRange(this.video.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferRange() {\n if (this.video) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(this.video.currentTime));\n } else {\n return null;\n }\n }\n\n 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 get nextLevel() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n\n isBuffered(position) {\n var v = this.video, buffered = v.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 return false;\n }\n\n _checkFragmentChanged() {\n var rangeCurrent, currentTime, video = this.video;\n if (video && 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 (this.isBuffered(currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (this.isBuffered(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(Event.FRAG_CHANGED, {frag: fragPlaying});\n }\n // if stream is VOD (not live) and we reach End of Stream\n var levelDetails = this.levels[this.level].details;\n if (levelDetails && !levelDetails.live) {\n // are we playing last fragment ?\n if (fragPlaying.sn === levelDetails.endSN) {\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n logger.log('all media data available, signal endOfStream() to MediaSource');\n //Notify the media element that it now has all of the media data\n mediaSource.endOfStream();\n }\n }\n }\n }\n }\n }\n\n /*\n abort any buffer append in progress, and flush all buffered data\n return true once everything has been flushed.\n sourceBuffer.abort() and sourceBuffer.remove() are asynchronous operations\n the idea is to call this function from tick() timer and call it again until all resources have been cleaned\n the timer is rearmed upon sourceBuffer updateend() event, so this should be optimal\n */\n flushBuffer(startOffset, endOffset) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd;\n //logger.log('flushBuffer,pos/start/end: ' + this.video.currentTime + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping\n if (this.flushBufferCounter++ < (2 * this.bufferRange.length) && this.sourceBuffer) {\n for (var type in this.sourceBuffer) {\n sb = this.sourceBuffer[type];\n if (!sb.updating) {\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 (flushEnd - flushStart > 0.5) {\n logger.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.video.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n return false;\n }\n }\n }\n\n /* after successful buffer flushing, rebuild buffer Range array\n loop through existing buffer range and check if\n corresponding range is still buffered. only push to new array already buffered range\n */\n var newRange = [],range;\n for (i = 0; i < this.bufferRange.length; i++) {\n range = this.bufferRange[i];\n if (this.isBuffered((range.start + range.end) / 2)) {\n newRange.push(range);\n }\n }\n this.bufferRange = newRange;\n logger.log('buffer flushed');\n // everything flushed !\n return true;\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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n this.previouslyPaused = this.video.paused;\n this.video.pause();\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush everything\n this.flushBufferCounter = 0;\n this.flushRange.push({start: 0, end: Number.POSITIVE_INFINITY});\n // trigger a sourceBuffer flush\n this.state = this.BUFFER_FLUSHING;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // speed up switching, trigger timer function\n this.tick();\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime\n - resume the playback if needed\n */\n immediateLevelSwitchEnd() {\n this.immediateSwitch = false;\n this.video.currentTime -= 0.0001;\n if (!this.previouslyPaused) {\n this.video.play();\n }\n }\n\n 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 fetchdelay, currentRange, nextRange;\n currentRange = this.getBufferRange(this.video.currentTime);\n if (currentRange) {\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.flushRange.push({start: 0, end: currentRange.start - 1});\n }\n if (!this.video.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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(this.video.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 // flush position is the start position of this new buffer\n this.flushRange.push({start: nextRange.start, end: Number.POSITIVE_INFINITY});\n }\n }\n if (this.flushRange.length) {\n this.flushBufferCounter = 0;\n // trigger a sourceBuffer flush\n this.state = this.BUFFER_FLUSHING;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // speed up switching, trigger timer function\n this.tick();\n }\n }\n\n onMSEAttached(event, data) {\n var video = data.video;\n this.video = video;\n this.mediaSource = data.mediaSource;\n this.onvseeking = this.onVideoSeeking.bind(this);\n this.onvseeked = this.onVideoSeeked.bind(this);\n this.onvmetadata = this.onVideoMetadata.bind(this);\n this.onvended = this.onVideoEnded.bind(this);\n video.addEventListener('seeking', this.onvseeking);\n video.addEventListener('seeked', this.onvseeked);\n video.addEventListener('loadedmetadata', this.onvmetadata);\n video.addEventListener('ended', this.onvended);\n if(this.levels && this.config.autoStartLoad) {\n this.startLoad();\n }\n }\n\n onMSEDetaching() {\n var video = this.video;\n if (video && video.ended) {\n logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n }\n\n onMSEDetached() {\n // remove video listeners\n var video = this.video;\n if (video) {\n video.removeEventListener('seeking', this.onvseeking);\n video.removeEventListener('seeked', this.onvseeked);\n video.removeEventListener('loadedmetadata', this.onvmetadata);\n video.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvmetadata = null;\n }\n this.video = null;\n this.loadedmetadata = false;\n this.stop();\n }\n\n onVideoSeeking() {\n if (this.state === this.LOADING) {\n // check if currently loaded fragment is inside buffer.\n //if outside, cancel fragment loading, otherwise do nothing\n if (this.bufferInfo(this.video.currentTime,0.3).len === 0) {\n logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n this.fragCurrent.loader.abort();\n this.fragCurrent = null;\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = this.IDLE;\n }\n }\n if (this.video) {\n this.lastCurrentTime = this.video.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 onVideoSeeked() {\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onVideoMetadata() {\n if (this.video.currentTime !== this.startPosition) {\n this.video.currentTime = this.startPosition;\n }\n this.loadedmetadata = true;\n this.tick();\n }\n\n onVideoEnded() {\n logger.log('video ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestParsed(event, data) {\n var aac = false, heaac = false, codecs;\n data.levels.forEach(level => {\n // detect if we have different kind of audio codecs used amongst playlists\n codecs = level.codecs;\n if (codecs) {\n if (codecs.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codecs.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audiocodecswitch = (aac && heaac);\n if (this.audiocodecswitch) {\n logger.log('both AAC/HE-AAC audio found in levels; declaring audio codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragmentRequested = false;\n if (this.video && this.config.autoStartLoad) {\n this.startLoad();\n }\n }\n\n onLevelLoaded(event,data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration;\n\n logger.log(`level ${newLevelId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${newDetails.fragments[0].start.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n // compute start position\n if (this.startLevelLoaded === false) {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = Math.max(0, duration - this.config.liveSyncDurationCount * newDetails.targetduration);\n }\n this.nextLoadPosition = this.startPosition;\n this.startLevelLoaded = true;\n }\n // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === this.WAITING_LEVEL) {\n this.state = this.IDLE;\n }\n //trigger handler right now\n this.tick();\n }\n\n onFragLoaded(event, data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === this.LOADING &&\n fragCurrent &&\n data.frag.level === fragCurrent.level &&\n data.frag.sn === fragCurrent.sn) {\n if (this.fragBitrateTest === true) {\n // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo\n this.state = this.IDLE;\n this.fragBitrateTest = false;\n data.stats.tparsed = data.stats.tbuffered = new Date();\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: data.stats, frag: fragCurrent});\n } else {\n this.state = this.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var currentLevel = this.levels[this.level],\n details = currentLevel.details,\n duration = details.totalduration,\n start = fragCurrent.start;\n logger.log(`Demuxing ${fragCurrent.sn} of [${details.startSN} ,${details.endSN}],level ${this.level}`);\n this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, this.level, duration);\n }\n }\n }\n\n onInitSegment(event, data) {\n if (this.state === this.PARSING) {\n // check if codecs have been explicitely defined in the master playlist for this level;\n // if yes use these ones instead of the ones parsed from the demux\n var audioCodec = this.levels[this.level].audioCodec, videoCodec = this.levels[this.level].videoCodec, sb;\n //logger.log('playlist level A/V codecs:' + audioCodec + ',' + videoCodec);\n //logger.log('playlist codecs:' + codec);\n // if playlist does not specify codecs, use codecs found while parsing fragment\n if (audioCodec === undefined || data.audiocodec === undefined) {\n audioCodec = data.audioCodec;\n }\n if (videoCodec === undefined || data.videocodec === undefined) {\n videoCodec = data.videoCodec;\n }\n // in case several audio codecs might be used, force HE-AAC for audio (some browsers don't support audio codec switch)\n //don't do it for mono streams ...\n if (this.audiocodecswitch && data.audioChannelCount === 2 && navigator.userAgent.toLowerCase().indexOf('android') === -1 && navigator.userAgent.toLowerCase().indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n if (!this.sourceBuffer) {\n this.sourceBuffer = {};\n logger.log(`selected A/V codecs for sourceBuffers:${audioCodec},${videoCodec}`);\n // create source Buffer and link them to MediaSource\n if (audioCodec) {\n sb = this.sourceBuffer.audio = this.mediaSource.addSourceBuffer(`video/mp4;codecs=${audioCodec}`);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n }\n if (videoCodec) {\n sb = this.sourceBuffer.video = this.mediaSource.addSourceBuffer(`video/mp4;codecs=${videoCodec}`);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n }\n }\n if (audioCodec) {\n this.mp4segments.push({type: 'audio', data: data.audioMoov});\n }\n if(videoCodec) {\n this.mp4segments.push({type: 'video', data: data.videoMoov});\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsing(event, data) {\n if (this.state === this.PARSING) {\n this.tparse2 = Date.now();\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n logger.log(`parsed data, type/startPTS/endPTS/startDTS/endDTS/nb:${data.type}/${data.startPTS.toFixed(3)}/${data.endPTS.toFixed(3)}/${data.startDTS.toFixed(3)}/${data.endDTS.toFixed(3)}/${data.nb}`);\n var drift = LevelHelper.updateFragPTS(level.details,frag.sn,data.startPTS,data.endPTS);\n this.hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift});\n\n this.mp4segments.push({type: data.type, data: data.moof});\n this.mp4segments.push({type: data.type, data: data.mdat});\n this.nextLoadPosition = data.endPTS;\n this.bufferRange.push({type: data.type, start: data.startPTS, end: data.endPTS, frag: frag});\n\n //trigger handler right now\n this.tick();\n } else {\n logger.warn(`not in PARSING state, discarding ${event}`);\n }\n }\n\n onFragParsed() {\n if (this.state === this.PARSING) {\n this.state = this.PARSED;\n this.stats.tparsed = new Date();\n //trigger handler right now\n this.tick();\n }\n }\n\n onError(event, data) {\n switch(data.details) {\n // abort fragment loading on errors\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n logger.warn(`buffer controller: ${data.details} while loading frag,switch to ${data.fatal ? 'ERROR' : 'IDLE'} state ...`);\n this.state = data.fatal ? this.ERROR : this.IDLE;\n break;\n default:\n break;\n }\n }\n\n onSBUpdateEnd() {\n //trigger handler right now\n if (this.state === this.APPENDING && this.mp4segments.length === 0) {\n var frag = this.fragCurrent, stats = this.stats;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = new Date();\n this.fragLastKbps = Math.round(8 * stats.length / (stats.tbuffered - stats.tfirst));\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag});\n logger.log(`video buffered : ${this.timeRangesToString(this.video.buffered)}`);\n this.state = this.IDLE;\n }\n var video = this.video;\n if(video) {\n // seek back to a expected position after video buffered if needed\n if (this.seekAfterBuffered) {\n video.currentTime = this.seekAfterBuffered;\n } else {\n var currentTime = video.currentTime;\n var bufferInfo = this.bufferInfo(currentTime,0);\n // check if current time is buffered or not\n if(bufferInfo.len === 0) {\n // no buffer available @ currentTime, check if next buffer is close (in a 300 ms range)\n var nextBufferStart = bufferInfo.nextStart;\n if(nextBufferStart && (nextBufferStart - currentTime < 0.3)) {\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${currentTime} to ${nextBufferStart}`);\n video.currentTime = nextBufferStart;\n }\n }\n }\n }\n // reset this variable, whether it was set or not\n this.seekAfterBuffered = undefined;\n }\n this.tick();\n }\n\n onSBUpdateError(event) {\n logger.error(`sourceBuffer error:${event}`);\n this.state = this.ERROR;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_APPENDING_ERROR, fatal: true, frag: this.fragCurrent});\n }\n\n timeRangesToString(r) {\n var log = '', len = r.length;\n for (var i=0; i {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n if(level.audioCodec) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels.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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n\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 (i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n this.hls.trigger(Event.MANIFEST_PARSED, {levels: this._levels, firstLevel: this._firstLevel, stats: data.stats});\n return;\n }\n\n get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n if (this._level !== newLevel || this._levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n\n setLevelInternal(newLevel) {\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < this._levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this._level = newLevel;\n logger.log(`switching to level ${newLevel}`);\n this.hls.trigger(Event.LEVEL_SWITCH, {level: newLevel});\n var level = this._levels[newLevel];\n // check if we need to load playlist for this level\n if (level.details === undefined || level.details.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for level ${newLevel}`);\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(newLevel) {\n this._manualLevel = newLevel;\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n\n get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\n if (this._startLevel === undefined) {\n return this._firstLevel;\n } else {\n return this._startLevel;\n }\n }\n\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(event, data) {\n var details = data.details, levelId, level;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\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.urlId < (level.url.length - 1)) {\n level.urlId++;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: emergency switch-down for next fragment`);\n this.hls.abrController.nextAutoLevel = 0;\n } else if(level && level.details && level.details.live) {\n logger.warn(`level controller,${details} on live stream, discard`);\n } else {\n logger.error(`cannot recover ${details} error`);\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n // redispatch same error but with fatal set to true\n data.fatal = true;\n this.hls.trigger(event, data);\n }\n }\n }\n }\n }\n\n onLevelLoaded(event, data) {\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 tick() {\n var levelId = this._level;\n if (levelId !== undefined) {\n var level = this._levels[levelId], urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n\n nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n }\n}\n\nexport default LevelController;\n\n", + "/*\n * simple ABR Controller\n*/\n\nimport Event from '../events';\n\nclass AbrController {\n\n constructor(hls) {\n this.hls = hls;\n this.lastfetchlevel = 0;\n this._autoLevelCapping = -1;\n this._nextAutoLevel = -1;\n this.onflp = this.onFragmentLoadProgress.bind(this);\n hls.on(Event.FRAG_LOAD_PROGRESS, this.onflp);\n }\n\n destroy() {\n this.hls.off(Event.FRAG_LOAD_PROGRESS, this.onflp);\n }\n\n onFragmentLoadProgress(event, data) {\n var stats = data.stats;\n if (stats.aborted === undefined) {\n this.lastfetchduration = (new Date() - stats.trequest) / 1000;\n this.lastfetchlevel = data.frag.level;\n this.lastbw = (stats.loaded * 8) / this.lastfetchduration;\n //console.log('fetchDuration:${this.lastfetchduration},bw:${(this.lastbw/1000).toFixed(0)}/${stats.aborted}');\n }\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n this._autoLevelCapping = newLevel;\n }\n\n get nextAutoLevel() {\n var lastbw = this.lastbw, hls = this.hls,adjustedbw, i, maxAutoLevel;\n if (this._autoLevelCapping === -1) {\n maxAutoLevel = hls.levels.length - 1;\n } else {\n maxAutoLevel = this._autoLevelCapping;\n }\n\n if (this._nextAutoLevel !== -1) {\n return Math.min(this._nextAutoLevel,maxAutoLevel);\n }\n\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 for (i = 0; i <= maxAutoLevel; i++) {\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 <= this.lastfetchlevel) {\n adjustedbw = 0.8 * lastbw;\n } else {\n adjustedbw = 0.7 * lastbw;\n }\n if (adjustedbw < hls.levels[i].bitrate) {\n return Math.max(0, i - 1);\n }\n }\n return i - 1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n", + "/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport Demuxer from '../demux/demuxer';\nimport LevelHelper from '../helper/level-helper';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\nconst State = {\n ERROR : -2,\n STARTING : -1,\n IDLE : 0,\n LOADING : 1,\n WAITING_LEVEL : 2,\n PARSING : 3,\n PARSED : 4,\n APPENDING : 5,\n BUFFER_FLUSHING : 6\n};\n\nclass BufferController {\n\n constructor(hls) {\n this.config = hls.config;\n this.hls = hls;\n // Source Buffer listeners\n this.onsbue = this.onSBUpdateEnd.bind(this);\n this.onsbe = this.onSBUpdateError.bind(this);\n // internal listeners\n this.onmse = this.onMSEAttached.bind(this);\n this.onmsed0 = this.onMSEDetaching.bind(this);\n this.onmsed = this.onMSEDetached.bind(this);\n this.onmp = this.onManifestParsed.bind(this);\n this.onll = this.onLevelLoaded.bind(this);\n this.onfl = this.onFragLoaded.bind(this);\n this.onis = this.onInitSegment.bind(this);\n this.onfpg = this.onFragParsing.bind(this);\n this.onfp = this.onFragParsed.bind(this);\n this.onerr = this.onError.bind(this);\n this.ontick = this.tick.bind(this);\n hls.on(Event.MSE_ATTACHED, this.onmse);\n hls.on(Event.MSE_DETACHING, this.onmsed0);\n hls.on(Event.MSE_DETACHED, this.onmsed);\n hls.on(Event.MANIFEST_PARSED, this.onmp);\n }\n\n destroy() {\n this.stop();\n var hls = this.hls;\n hls.off(Event.MSE_ATTACHED, this.onmse);\n hls.off(Event.MSE_DETACHING, this.onmsed0);\n hls.off(Event.MSE_DETACHED, this.onmsed);\n hls.off(Event.MANIFEST_PARSED, this.onmp);\n this.state = State.IDLE;\n }\n\n startLoad() {\n if (this.levels && this.video) {\n this.startInternal();\n if (this.lastCurrentTime) {\n logger.log(`seeking @ ${this.lastCurrentTime}`);\n if (!this.lastPaused) {\n logger.log('resuming video');\n this.video.play();\n }\n this.state = State.IDLE;\n } else {\n this.lastCurrentTime = 0;\n this.state = State.STARTING;\n }\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime;\n this.tick();\n } else {\n logger.warn('cannot start loading as either manifest not parsed or video not attached');\n }\n }\n\n startInternal() {\n var hls = this.hls;\n this.stop();\n this.demuxer = new Demuxer(hls);\n this.timer = setInterval(this.ontick, 100);\n this.level = -1;\n hls.on(Event.FRAG_LOADED, this.onfl);\n hls.on(Event.FRAG_PARSING_INIT_SEGMENT, this.onis);\n hls.on(Event.FRAG_PARSING_DATA, this.onfpg);\n hls.on(Event.FRAG_PARSED, this.onfp);\n hls.on(Event.ERROR, this.onerr);\n hls.on(Event.LEVEL_LOADED, this.onll);\n }\n\n stop() {\n this.mp4segments = [];\n this.flushRange = [];\n this.bufferRange = [];\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.sourceBuffer) {\n for(var type in this.sourceBuffer) {\n var sb = this.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 }\n this.sourceBuffer = null;\n }\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = null;\n }\n var hls = this.hls;\n hls.off(Event.FRAG_LOADED, this.onfl);\n hls.off(Event.FRAG_PARSED, this.onfp);\n hls.off(Event.FRAG_PARSING_DATA, this.onfpg);\n hls.off(Event.LEVEL_LOADED, this.onll);\n hls.off(Event.FRAG_PARSING_INIT_SEGMENT, this.onis);\n hls.off(Event.ERROR, this.onerr);\n }\n\n tick() {\n var pos, level, levelDetails, fragIdx, hls = this.hls;\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.STARTING:\n // determine load level\n this.startLevel = hls.startLevel;\n if (this.startLevel === -1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n this.startLevel = 0;\n this.fragBitrateTest = true;\n }\n // set new level to playlist loader : this will trigger start level load\n this.level = hls.nextLoadLevel = this.startLevel;\n this.state = State.WAITING_LEVEL;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n // if video detached or unbound exit loop\n if (!this.video) {\n break;\n }\n // determine next candidate fragment to be loaded, based on current position and\n // end of buffer position\n // ensure 60s of buffer upfront\n // if we have not yet loaded any fragment, start loading from start position\n if (this.loadedmetadata) {\n pos = this.video.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n if (this.startFragmentRequested === false) {\n level = this.startLevel;\n } else {\n // we are not at playback start, get next load level from level Controller\n level = hls.nextLoadLevel;\n }\n var bufferInfo = this.bufferInfo(pos,0.3), bufferLen = bufferInfo.len, bufferEnd = bufferInfo.end, maxBufLen;\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 ((this.levels[level]).hasOwnProperty('bitrate')) {\n maxBufLen = Math.max(8 * this.config.maxBufferSize / this.levels[level].bitrate, this.config.maxBufferLength);\n maxBufLen = Math.min(maxBufLen, this.config.maxMaxBufferLength);\n } else {\n maxBufLen = this.config.maxBufferLength;\n }\n // if buffer length is less than maxBufLen try to load a new fragment\n if (bufferLen < maxBufLen) {\n // set next load level : this will trigger a playlist load if needed\n hls.nextLoadLevel = level;\n this.level = level;\n levelDetails = this.levels[level].details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n if (typeof levelDetails === 'undefined') {\n this.state = State.WAITING_LEVEL;\n break;\n }\n // find fragment index, contiguous with end of buffer position\n let fragments = levelDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\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 // 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.video.seeking}`);\n if (bufferEnd < Math.max(start,end-this.config.liveMaxLatencyDurationCount*levelDetails.targetduration)) {\n this.seekAfterBuffered = start + Math.max(0, levelDetails.totalduration - this.config.liveSyncDurationCount * levelDetails.targetduration);\n logger.log(`buffer end: ${bufferEnd} is located too far from the end of live sliding playlist, media position will be reseted to: ${this.seekAfterBuffered.toFixed(3)}`);\n bufferEnd = this.seekAfterBuffered;\n }\n if (this.startFragmentRequested && !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 (this.fragPrevious) {\n var targetSN = this.fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n frag = fragments[targetSN - levelDetails.startSN];\n 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.round(fragLen / 2)];\n logger.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\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 if (bufferEnd > end) {\n // reach end of playlist\n break;\n }\n for (fragIdx = 0; fragIdx < fragLen; fragIdx++) {\n frag = fragments[fragIdx];\n start = frag.start;\n //logger.log('level/sn/sliding/start/end/bufEnd:${level}/${frag.sn}/${sliding.toFixed(3)}/${start.toFixed(3)}/${(start+frag.duration).toFixed(3)}/${bufferEnd.toFixed(3)}');\n // offset should be within fragment boundary\n if (start <= bufferEnd && (start + frag.duration) > bufferEnd) {\n break;\n }\n }\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (this.fragPrevious && frag.level === this.fragPrevious.level && frag.sn === this.fragPrevious.sn) {\n if (fragIdx === (fragLen-1)) {\n // we are at the end of the playlist and we already loaded last fragment, don't do anything\n break;\n } else {\n frag = fragments[fragIdx + 1];\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n }\n }\n logger.log(`Loading ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}, currentTime:${pos},bufferEnd:${bufferEnd.toFixed(3)}`);\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n frag.autoLevel = hls.autoLevelEnabled;\n if (this.levels.length > 1) {\n frag.expectedLen = Math.round(frag.duration * this.levels[level].bitrate / 8);\n frag.trequest = new Date();\n }\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 let maxThreshold = this.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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag});\n return;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragmentRequested = true;\n hls.trigger(Event.FRAG_LOADING, {frag: frag});\n this.state = State.LOADING;\n }\n break;\n case State.WAITING_LEVEL:\n 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.LOADING:\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 let v = this.video,frag = this.fragCurrent;\n /* only monitor frag retrieval time if\n (video not paused OR first fragment being loaded) AND autoswitching enabled AND not lowest level AND multiple levels */\n if (v && (!v.paused || this.loadedmetadata === false) && frag.autoLevel && this.level && this.levels.length > 1) {\n var requestDelay = new Date() - frag.trequest;\n // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate\n if (requestDelay > (500 * frag.duration)) {\n var loadRate = frag.loaded * 1000 / requestDelay; // byte/s\n if (frag.expectedLen < frag.loaded) {\n frag.expectedLen = frag.loaded;\n }\n pos = v.currentTime;\n var fragLoadedDelay = (frag.expectedLen - frag.loaded) / loadRate;\n var bufferStarvationDelay = this.bufferInfo(pos,0.3).end - pos;\n var fragLevelNextLoadedDelay = frag.duration * this.levels[hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps\n /* if we have less than 2 frag duration in buffer and if frag loaded delay is greater than buffer starvation delay\n ... and also bigger than duration needed to load fragment at next level ...*/\n if (bufferStarvationDelay < (2 * frag.duration) && fragLoadedDelay > bufferStarvationDelay && fragLoadedDelay > fragLevelNextLoadedDelay) {\n // abort fragment loading ...\n logger.warn('loading too slow, abort fragment loading');\n logger.log(`fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :${fragLoadedDelay.toFixed(1)}/${bufferStarvationDelay.toFixed(1)}/${fragLevelNextLoadedDelay.toFixed(1)}`);\n //abort fragment loading\n frag.loader.abort();\n hls.trigger(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag});\n // switch back to IDLE state to request new fragment at lowest level\n this.state = State.IDLE;\n }\n }\n }\n break;\n case State.PARSING:\n // nothing to do, wait for fragment being parsed\n break;\n case State.PARSED:\n case State.APPENDING:\n if (this.sourceBuffer) {\n // if MP4 segment appending in progress nothing to do\n if ((this.sourceBuffer.audio && this.sourceBuffer.audio.updating) ||\n (this.sourceBuffer.video && this.sourceBuffer.video.updating)) {\n //logger.log('sb append in progress');\n // check if any MP4 segments left to append\n } else if (this.mp4segments.length) {\n var segment = this.mp4segments.shift();\n try {\n //logger.log('appending ${segment.type} SB, size:${segment.data.length}');\n this.sourceBuffer[segment.type].appendBuffer(segment.data);\n this.appendError = 0;\n } catch(err) {\n // in case any error occured while appending, put back segment in mp4segments table\n logger.error(`error while trying to append buffer:${err.message},try appending later`);\n this.mp4segments.unshift(segment);\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n var event = {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_APPENDING_ERROR, 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 > this.config.appendErrorMaxRetry) {\n logger.log(`fail ${this.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n event.fatal = true;\n hls.trigger(Event.ERROR, event);\n this.state = State.ERROR;\n return;\n } else {\n event.fatal = false;\n hls.trigger(Event.ERROR, event);\n }\n }\n this.state = State.APPENDING;\n }\n } else {\n // sourceBuffer undefined, switch back to IDLE state\n this.state = State.IDLE;\n }\n break;\n case State.BUFFER_FLUSHING:\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)) {\n // range flushed, remove from flush array\n this.flushRange.shift();\n } else {\n // flush in progress, come back later\n break;\n }\n }\n if (this.flushRange.length === 0) {\n // handle end of immediate switching if needed\n if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n }\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 /* if not everything flushed, stay in BUFFER_FLUSHING state. we will come back here\n each time sourceBuffer updateend() callback will be triggered\n */\n break;\n default:\n break;\n }\n // check/update current fragment\n this._checkFragmentChanged();\n }\n\n bufferInfo(pos,maxHoleDuration) {\n var v = this.video,\n buffered = v.buffered,\n bufferLen,\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferStart, bufferEnd,bufferStartNext,\n i;\n var buffered2 = [];\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 //logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if ((buffered2.length) && (buffered.start(i) - buffered2[buffered2.length - 1].end) < maxHoleDuration) {\n buffered2[buffered2.length - 1].end = buffered.end(i);\n } else {\n buffered2.push({start: buffered.start(i), end: buffered.end(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 + maxHoleDuration;\n bufferLen = bufferEnd - pos;\n } else if ((pos + maxHoleDuration) < start) {\n bufferStartNext = start;\n }\n }\n return {len: bufferLen, start: bufferStart, end: bufferEnd, nextStart : bufferStartNext};\n }\n\n getBufferRange(position) {\n var i, range;\n for (i = this.bufferRange.length - 1; i >=0; i--) {\n range = this.bufferRange[i];\n if (position >= range.start && position <= range.end) {\n return range;\n }\n }\n return null;\n }\n\n get currentLevel() {\n if (this.video) {\n var range = this.getBufferRange(this.video.currentTime);\n if (range) {\n return range.frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferRange() {\n if (this.video) {\n // first get end range of current fragment\n return this.followingBufferRange(this.getBufferRange(this.video.currentTime));\n } else {\n return null;\n }\n }\n\n 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 get nextLevel() {\n var range = this.nextBufferRange;\n if (range) {\n return range.frag.level;\n } else {\n return -1;\n }\n }\n\n isBuffered(position) {\n var v = this.video, buffered = v.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 return false;\n }\n\n _checkFragmentChanged() {\n var rangeCurrent, currentTime, video = this.video;\n if (video && 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 (this.isBuffered(currentTime)) {\n rangeCurrent = this.getBufferRange(currentTime);\n } else if (this.isBuffered(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(Event.FRAG_CHANGED, {frag: fragPlaying});\n }\n // if stream is VOD (not live) and we reach End of Stream\n var levelDetails = this.levels[this.level].details;\n if (levelDetails && !levelDetails.live) {\n // are we playing last fragment ?\n if (fragPlaying.sn === levelDetails.endSN) {\n var mediaSource = this.mediaSource;\n if (mediaSource && mediaSource.readyState === 'open') {\n logger.log('all media data available, signal endOfStream() to MediaSource');\n //Notify the media element that it now has all of the media data\n mediaSource.endOfStream();\n }\n }\n }\n }\n }\n }\n\n /*\n abort any buffer append in progress, and flush all buffered data\n return true once everything has been flushed.\n sourceBuffer.abort() and sourceBuffer.remove() are asynchronous operations\n the idea is to call this function from tick() timer and call it again until all resources have been cleaned\n the timer is rearmed upon sourceBuffer updateend() event, so this should be optimal\n */\n flushBuffer(startOffset, endOffset) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd;\n //logger.log('flushBuffer,pos/start/end: ' + this.video.currentTime + '/' + startOffset + '/' + endOffset);\n // safeguard to avoid infinite looping\n if (this.flushBufferCounter++ < (2 * this.bufferRange.length) && this.sourceBuffer) {\n for (var type in this.sourceBuffer) {\n sb = this.sourceBuffer[type];\n if (!sb.updating) {\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 (flushEnd - flushStart > 0.5) {\n logger.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.video.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n return false;\n }\n }\n }\n\n /* after successful buffer flushing, rebuild buffer Range array\n loop through existing buffer range and check if\n corresponding range is still buffered. only push to new array already buffered range\n */\n var newRange = [],range;\n for (i = 0; i < this.bufferRange.length; i++) {\n range = this.bufferRange[i];\n if (this.isBuffered((range.start + range.end) / 2)) {\n newRange.push(range);\n }\n }\n this.bufferRange = newRange;\n logger.log('buffer flushed');\n // everything flushed !\n return true;\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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n this.previouslyPaused = this.video.paused;\n this.video.pause();\n }\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && fragCurrent.loader) {\n fragCurrent.loader.abort();\n }\n this.fragCurrent = null;\n // flush everything\n this.flushBufferCounter = 0;\n this.flushRange.push({start: 0, end: Number.POSITIVE_INFINITY});\n // trigger a sourceBuffer flush\n this.state = State.BUFFER_FLUSHING;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // speed up switching, trigger timer function\n this.tick();\n }\n\n /*\n on immediate level switch end, after new fragment has been buffered :\n - nudge video decoder by slightly adjusting video currentTime\n - resume the playback if needed\n */\n immediateLevelSwitchEnd() {\n this.immediateSwitch = false;\n this.video.currentTime -= 0.0001;\n if (!this.previouslyPaused) {\n this.video.play();\n }\n }\n\n 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 fetchdelay, currentRange, nextRange;\n currentRange = this.getBufferRange(this.video.currentTime);\n if (currentRange) {\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.flushRange.push({start: 0, end: currentRange.start - 1});\n }\n if (!this.video.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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(this.video.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 // flush position is the start position of this new buffer\n this.flushRange.push({start: nextRange.start, end: Number.POSITIVE_INFINITY});\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 }\n }\n if (this.flushRange.length) {\n this.flushBufferCounter = 0;\n // trigger a sourceBuffer flush\n this.state = State.BUFFER_FLUSHING;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // speed up switching, trigger timer function\n this.tick();\n }\n }\n\n onMSEAttached(event, data) {\n var video = data.video;\n this.video = video;\n this.mediaSource = data.mediaSource;\n this.onvseeking = this.onVideoSeeking.bind(this);\n this.onvseeked = this.onVideoSeeked.bind(this);\n this.onvmetadata = this.onVideoMetadata.bind(this);\n this.onvended = this.onVideoEnded.bind(this);\n video.addEventListener('seeking', this.onvseeking);\n video.addEventListener('seeked', this.onvseeked);\n video.addEventListener('loadedmetadata', this.onvmetadata);\n video.addEventListener('ended', this.onvended);\n if(this.levels && this.config.autoStartLoad) {\n this.startLoad();\n }\n }\n\n onMSEDetaching() {\n var video = this.video;\n if (video && video.ended) {\n logger.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n }\n\n onMSEDetached() {\n // remove video listeners\n var video = this.video;\n if (video) {\n video.removeEventListener('seeking', this.onvseeking);\n video.removeEventListener('seeked', this.onvseeked);\n video.removeEventListener('loadedmetadata', this.onvmetadata);\n video.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvseeked = this.onvmetadata = null;\n }\n this.video = null;\n this.loadedmetadata = false;\n this.stop();\n }\n\n onVideoSeeking() {\n if (this.state === State.LOADING) {\n // check if currently loaded fragment is inside buffer.\n //if outside, cancel fragment loading, otherwise do nothing\n if (this.bufferInfo(this.video.currentTime,0.3).len === 0) {\n logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n var fragCurrent = this.fragCurrent;\n if (fragCurrent) {\n fragCurrent.loader.abort();\n this.fragCurrent = null;\n }\n this.fragPrevious = null;\n // switch to IDLE state to load new fragment\n this.state = State.IDLE;\n }\n }\n if (this.video) {\n this.lastCurrentTime = this.video.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 onVideoSeeked() {\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onVideoMetadata() {\n if (this.video.currentTime !== this.startPosition) {\n this.video.currentTime = this.startPosition;\n }\n this.loadedmetadata = true;\n this.tick();\n }\n\n onVideoEnded() {\n logger.log('video ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestParsed(event, data) {\n var aac = false, heaac = false, codecs;\n data.levels.forEach(level => {\n // detect if we have different kind of audio codecs used amongst playlists\n codecs = level.codecs;\n if (codecs) {\n if (codecs.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codecs.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audiocodecswitch = (aac && heaac);\n if (this.audiocodecswitch) {\n logger.log('both AAC/HE-AAC audio found in levels; declaring audio codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startLevelLoaded = false;\n this.startFragmentRequested = false;\n if (this.video && this.config.autoStartLoad) {\n this.startLoad();\n }\n }\n\n onLevelLoaded(event,data) {\n var newDetails = data.details,\n newLevelId = data.level,\n curLevel = this.levels[newLevelId],\n duration = newDetails.totalduration;\n\n logger.log(`level ${newLevelId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = curLevel.details;\n if (curDetails) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${newDetails.fragments[0].start.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.LEVEL_UPDATED, { details: newDetails, level: newLevelId });\n\n // compute start position\n if (this.startLevelLoaded === false) {\n // if live playlist, set start position to be fragment N-this.config.liveSyncDurationCount (usually 3)\n if (newDetails.live) {\n this.startPosition = Math.max(0, duration - this.config.liveSyncDurationCount * newDetails.targetduration);\n }\n this.nextLoadPosition = this.startPosition;\n this.startLevelLoaded = true;\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 onFragLoaded(event, data) {\n var fragCurrent = this.fragCurrent;\n if (this.state === State.LOADING &&\n fragCurrent &&\n data.frag.level === fragCurrent.level &&\n data.frag.sn === fragCurrent.sn) {\n if (this.fragBitrateTest === true) {\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.fragBitrateTest = false;\n data.stats.tparsed = data.stats.tbuffered = new Date();\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: data.stats, frag: fragCurrent});\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.stats = data.stats;\n var currentLevel = this.levels[this.level],\n details = currentLevel.details,\n duration = details.totalduration,\n start = fragCurrent.start,\n level = fragCurrent.level,\n sn = fragCurrent.sn;\n logger.log(`Demuxing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}`);\n this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, duration);\n }\n }\n }\n\n onInitSegment(event, data) {\n if (this.state === State.PARSING) {\n // check if codecs have been explicitely defined in the master playlist for this level;\n // if yes use these ones instead of the ones parsed from the demux\n var audioCodec = this.levels[this.level].audioCodec, videoCodec = this.levels[this.level].videoCodec, sb;\n //logger.log('playlist level A/V codecs:' + audioCodec + ',' + videoCodec);\n //logger.log('playlist codecs:' + codec);\n // if playlist does not specify codecs, use codecs found while parsing fragment\n if (audioCodec === undefined || data.audiocodec === undefined) {\n audioCodec = data.audioCodec;\n }\n if (videoCodec === undefined || data.videocodec === undefined) {\n videoCodec = data.videoCodec;\n }\n // in case several audio codecs might be used, force HE-AAC for audio (some browsers don't support audio codec switch)\n //don't do it for mono streams ...\n var ua = navigator.userAgent.toLowerCase();\n if (this.audiocodecswitch &&\n data.audioChannelCount !== 1 &&\n ua.indexOf('android') === -1 &&\n ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n if (!this.sourceBuffer) {\n this.sourceBuffer = {};\n logger.log(`selected A/V codecs for sourceBuffers:${audioCodec},${videoCodec}`);\n // create source Buffer and link them to MediaSource\n if (audioCodec) {\n sb = this.sourceBuffer.audio = this.mediaSource.addSourceBuffer(`video/mp4;codecs=${audioCodec}`);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n }\n if (videoCodec) {\n sb = this.sourceBuffer.video = this.mediaSource.addSourceBuffer(`video/mp4;codecs=${videoCodec}`);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n }\n }\n if (audioCodec) {\n this.mp4segments.push({type: 'audio', data: data.audioMoov});\n }\n if(videoCodec) {\n this.mp4segments.push({type: 'video', data: data.videoMoov});\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsing(event, data) {\n if (this.state === State.PARSING) {\n this.tparse2 = Date.now();\n var level = this.levels[this.level],\n frag = this.fragCurrent;\n logger.log(`parsed data, type/startPTS/endPTS/startDTS/endDTS/nb:${data.type}/${data.startPTS.toFixed(3)}/${data.endPTS.toFixed(3)}/${data.startDTS.toFixed(3)}/${data.endDTS.toFixed(3)}/${data.nb}`);\n var drift = LevelHelper.updateFragPTS(level.details,frag.sn,data.startPTS,data.endPTS);\n this.hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift});\n\n this.mp4segments.push({type: data.type, data: data.moof});\n this.mp4segments.push({type: data.type, data: data.mdat});\n this.nextLoadPosition = data.endPTS;\n this.bufferRange.push({type: data.type, start: data.startPTS, end: data.endPTS, frag: frag});\n\n //trigger handler right now\n this.tick();\n } else {\n logger.warn(`not in PARSING state, discarding ${event}`);\n }\n }\n\n onFragParsed() {\n if (this.state === State.PARSING) {\n this.state = State.PARSED;\n this.stats.tparsed = new Date();\n //trigger handler right now\n this.tick();\n }\n }\n\n onError(event, data) {\n switch(data.details) {\n // abort fragment loading on errors\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n // if fatal error, stop processing, otherwise move to IDLE to retry loading\n logger.warn(`buffer controller: ${data.details} while loading frag,switch to ${data.fatal ? 'ERROR' : 'IDLE'} state ...`);\n this.state = data.fatal ? State.ERROR : State.IDLE;\n break;\n default:\n break;\n }\n }\n\n onSBUpdateEnd() {\n //trigger handler right now\n if (this.state === State.APPENDING && this.mp4segments.length === 0) {\n var frag = this.fragCurrent, stats = this.stats;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = new Date();\n this.fragLastKbps = Math.round(8 * stats.length / (stats.tbuffered - stats.tfirst));\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag});\n logger.log(`video buffered : ${this.timeRangesToString(this.video.buffered)}`);\n this.state = State.IDLE;\n }\n var video = this.video;\n if(video) {\n // seek back to a expected position after video buffered if needed\n if (this.seekAfterBuffered) {\n video.currentTime = this.seekAfterBuffered;\n } else {\n var currentTime = video.currentTime;\n var bufferInfo = this.bufferInfo(currentTime,0);\n // check if current time is buffered or not\n if(bufferInfo.len === 0) {\n // no buffer available @ currentTime, check if next buffer is close (in a 300 ms range)\n var nextBufferStart = bufferInfo.nextStart;\n if(nextBufferStart && (nextBufferStart - currentTime < 0.3)) {\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${currentTime} to ${nextBufferStart}`);\n video.currentTime = nextBufferStart;\n }\n }\n }\n }\n // reset this variable, whether it was set or not\n this.seekAfterBuffered = undefined;\n }\n this.tick();\n }\n\n onSBUpdateError(event) {\n logger.error(`sourceBuffer error:${event}`);\n this.state = State.ERROR;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_APPENDING_ERROR, fatal: true, frag: this.fragCurrent});\n }\n\n timeRangesToString(r) {\n var log = '', len = r.length;\n for (var i=0; i {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n if(level.audioCodec) {\n audioCodecFound = true;\n }\n var redundantLevelId = bitrateSet[level.bitrate];\n if (redundantLevelId === undefined) {\n bitrateSet[level.bitrate] = levels.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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n\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 (i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n this.hls.trigger(Event.MANIFEST_PARSED, {levels: this._levels, firstLevel: this._firstLevel, stats: data.stats});\n return;\n }\n\n get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n if (this._level !== newLevel || this._levels[newLevel].details === undefined) {\n this.setLevelInternal(newLevel);\n }\n }\n\n setLevelInternal(newLevel) {\n // check if level idx is valid\n if (newLevel >= 0 && newLevel < this._levels.length) {\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n this._level = newLevel;\n logger.log(`switching to level ${newLevel}`);\n this.hls.trigger(Event.LEVEL_SWITCH, {level: newLevel});\n var level = this._levels[newLevel];\n // check if we need to load playlist for this level\n if (level.details === undefined || level.details.live === true) {\n // level not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for level ${newLevel}`);\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n this.hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(newLevel) {\n this._manualLevel = newLevel;\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n\n get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\n if (this._startLevel === undefined) {\n return this._firstLevel;\n } else {\n return this._startLevel;\n }\n }\n\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(event, data) {\n if(data.fatal) {\n return;\n }\n\n var details = data.details, hls = this.hls, levelId, level;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\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.urlId < (level.url.length - 1)) {\n level.urlId++;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: emergency switch-down for next fragment`);\n hls.abrController.nextAutoLevel = 0;\n } else if(level && level.details && level.details.live) {\n logger.warn(`level controller,${details} on live stream, discard`);\n } else {\n logger.error(`cannot recover ${details} error`);\n this._level = undefined;\n // stopping live reloading timer if any\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n // redispatch same error but with fatal set to true\n data.fatal = true;\n hls.trigger(event, data);\n }\n }\n }\n }\n\n onLevelLoaded(event, data) {\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 tick() {\n var levelId = this._level;\n if (levelId !== undefined) {\n var level = this._levels[levelId], urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n\n nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.abrController.nextAutoLevel;\n }\n }\n}\n\nexport default LevelController;\n\n", "/* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nimport Event from '../events';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport TSDemuxer from '../demux/tsdemuxer';\n\nclass DemuxerInline {\n\n constructor(hls,remuxer) {\n this.hls = hls;\n this.remuxer = remuxer;\n }\n\n destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n\n push(data, audioCodec, videoCodec, timeOffset, cc, level, duration) {\n var demuxer = this.demuxer;\n if (!demuxer) {\n // probe for content type\n if(TSDemuxer.probe(data)) {\n demuxer = this.demuxer = new TSDemuxer(this.hls,this.remuxer);\n } else {\n this.hls.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found'});\n return;\n }\n }\n demuxer.push(data,audioCodec,videoCodec,timeOffset,cc,level,duration);\n }\n\n remux() {\n var demuxer = this.demuxer;\n if(demuxer) {\n demuxer.remux();\n }\n }\n}\n\nexport default DemuxerInline;\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 \n import DemuxerInline from '../demux/demuxer-inline';\n import Event from '../events';\n import EventEmitter from 'events';\n import MP4Remuxer from '../remux/mp4-remuxer';\n\nvar DemuxerWorker = function (self) {\n // observer setup\n var observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n self.addEventListener('message', function (ev) {\n //console.log('demuxer cmd:' + ev.data.cmd);\n switch (ev.data.cmd) {\n case 'init':\n self.demuxer = new DemuxerInline(observer,MP4Remuxer);\n break;\n case 'demux':\n self.demuxer.push(new Uint8Array(ev.data.data), ev.data.audioCodec, ev.data.videoCodec, ev.data.timeOffset, ev.data.cc, ev.data.level, ev.data.duration);\n self.demuxer.remux();\n break;\n default:\n break;\n }\n });\n\n // listen to events triggered by TS Demuxer\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, function(ev, data) {\n var objData = {event: ev};\n var objTransferable = [];\n if (data.audioCodec) {\n objData.audioCodec = data.audioCodec;\n objData.audioMoov = data.audioMoov.buffer;\n objData.audioChannelCount = data.audioChannelCount;\n objTransferable.push(objData.audioMoov);\n }\n if (data.videoCodec) {\n objData.videoCodec = data.videoCodec;\n objData.videoMoov = data.videoMoov.buffer;\n objData.videoWidth = data.videoWidth;\n objData.videoHeight = data.videoHeight;\n objTransferable.push(objData.videoMoov);\n }\n // pass moov as transferable object (no copy)\n self.postMessage(objData,objTransferable);\n });\n\n observer.on(Event.FRAG_PARSING_DATA, function(ev, data) {\n var objData = {event: ev, type: data.type, startPTS: data.startPTS, endPTS: data.endPTS, startDTS: data.startDTS, endDTS: data.endDTS, moof: data.moof.buffer, mdat: data.mdat.buffer, nb: data.nb};\n // pass moof/mdat data as transferable object (no copy)\n self.postMessage(objData, [objData.moof, objData.mdat]);\n });\n\n observer.on(Event.FRAG_PARSED, function(event) {\n self.postMessage({event: event});\n });\n\n observer.on(Event.ERROR, function(event, data) {\n self.postMessage({event: event, data: data});\n });\n\n observer.on(Event.FRAG_PARSING_METADATA, function(event, data) {\n var objData = {event: event, samples: data.samples};\n self.postMessage(objData);\n });\n};\n\nexport default DemuxerWorker;\n\n", "import Event from '../events';\nimport DemuxerInline from '../demux/demuxer-inline';\nimport DemuxerWorker from '../demux/demuxer-worker';\nimport {logger} from '../utils/logger';\nimport MP4Remuxer from '../remux/mp4-remuxer';\n\nclass Demuxer {\n\n constructor(hls) {\n this.hls = hls;\n if (hls.config.enableWorker && (typeof(Worker) !== 'undefined')) {\n logger.log('demuxing in webworker');\n try {\n var work = require('webworkify');\n this.w = work(DemuxerWorker);\n this.onwmsg = this.onWorkerMessage.bind(this);\n this.w.addEventListener('message', this.onwmsg);\n this.w.postMessage({cmd: 'init'});\n } catch(err) {\n logger.error('error while initializing DemuxerWorker, fallback on DemuxerInline');\n this.demuxer = new DemuxerInline(hls,MP4Remuxer);\n }\n } else {\n this.demuxer = new DemuxerInline(hls,MP4Remuxer);\n }\n this.demuxInitialized = true;\n }\n\n destroy() {\n if (this.w) {\n this.w.removeEventListener('message', this.onwmsg);\n this.w.terminate();\n this.w = null;\n } else {\n this.demuxer.destroy();\n }\n }\n\n push(data, audioCodec, videoCodec, timeOffset, cc, level, duration) {\n if (this.w) {\n // post fragment payload as transferable objects (no copy)\n this.w.postMessage({cmd: 'demux', data: data, audioCodec: audioCodec, videoCodec: videoCodec, timeOffset: timeOffset, cc: cc, level: level, duration: duration}, [data]);\n } else {\n this.demuxer.push(new Uint8Array(data), audioCodec, videoCodec, timeOffset, cc, level, duration);\n this.demuxer.remux();\n }\n }\n\n onWorkerMessage(ev) {\n //console.log('onWorkerMessage:' + ev.data.event);\n switch(ev.data.event) {\n case Event.FRAG_PARSING_INIT_SEGMENT:\n var obj = {};\n if (ev.data.audioMoov) {\n obj.audioMoov = new Uint8Array(ev.data.audioMoov);\n obj.audioCodec = ev.data.audioCodec;\n obj.audioChannelCount = ev.data.audioChannelCount;\n }\n if (ev.data.videoMoov) {\n obj.videoMoov = new Uint8Array(ev.data.videoMoov);\n obj.videoCodec = ev.data.videoCodec;\n obj.videoWidth = ev.data.videoWidth;\n obj.videoHeight = ev.data.videoHeight;\n }\n this.hls.trigger(Event.FRAG_PARSING_INIT_SEGMENT, obj);\n break;\n case Event.FRAG_PARSING_DATA:\n this.hls.trigger(Event.FRAG_PARSING_DATA,{\n moof: new Uint8Array(ev.data.moof),\n mdat: new Uint8Array(ev.data.mdat),\n startPTS: ev.data.startPTS,\n endPTS: ev.data.endPTS,\n startDTS: ev.data.startDTS,\n endDTS: ev.data.endDTS,\n type: ev.data.type,\n nb: ev.data.nb\n });\n break;\n case Event.FRAG_PARSING_METADATA:\n this.hls.trigger(Event.FRAG_PARSING_METADATA, {\n samples: ev.data.samples\n });\n break;\n default:\n this.hls.trigger(ev.data.event, ev.data.data);\n break;\n }\n }\n}\n\nexport default Demuxer;\n\n", "/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n*/\n\nimport {logger} from '../utils/logger';\n\nclass ExpGolomb {\n\n constructor(data) {\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = this.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 loadWord() {\n var\n position = this.data.byteLength - this.bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, this.bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(this.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 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 readBits(size) {\n var\n bits = Math.min(this.bitsAvailable, size), // :uint\n valu = this.word >>> (32 - bits); // :uint\n if (size > 32) {\n 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) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n 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 skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n 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 readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n readUByte() {\n return this.readBits(8);\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 skipScalingList(count) {\n var\n 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 readSPS() {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,profileCompat,levelIdc,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i;\n this.readUByte();\n profileIdc = this.readUByte(); // profile_idc\n profileCompat = this.readBits(5); // constraint_set[0-4]_flag, u(5)\n this.skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = this.readUByte(); //level_idc u(8)\n this.skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 ||\n profileIdc === 110 ||\n profileIdc === 122 ||\n profileIdc === 144) {\n var chromaFormatIdc = this.readUEG();\n if (chromaFormatIdc === 3) {\n this.skipBits(1); // separate_colour_plane_flag\n }\n this.skipUEG(); // bit_depth_luma_minus8\n this.skipUEG(); // bit_depth_chroma_minus8\n this.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (this.readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (this.readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n this.skipScalingList(16);\n } else {\n this.skipScalingList(64);\n }\n }\n }\n }\n }\n this.skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = this.readUEG();\n if (picOrderCntType === 0) {\n this.readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n this.skipBits(1); // delta_pic_order_always_zero_flag\n this.skipEG(); // offset_for_non_ref_pic\n this.skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = this.readUEG();\n for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n this.skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n this.skipUEG(); // max_num_ref_frames\n this.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = this.readUEG();\n picHeightInMapUnitsMinus1 = this.readUEG();\n frameMbsOnlyFlag = this.readBits(1);\n if (frameMbsOnlyFlag === 0) {\n this.skipBits(1); // mb_adaptive_frame_field_flag\n }\n this.skipBits(1); // direct_8x8_inference_flag\n if (this.readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = this.readUEG();\n frameCropRightOffset = this.readUEG();\n frameCropTopOffset = this.readUEG();\n frameCropBottomOffset = this.readUEG();\n }\n return {\n profileIdc : profileIdc,\n profileCompat : profileCompat,\n levelIdc : levelIdc,\n width: ((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2,\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - (frameCropTopOffset * 2) - (frameCropBottomOffset * 2)\n };\n }\n\n 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\nexport default ExpGolomb;\n", "/**\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 Event from '../events';\n import ExpGolomb from './exp-golomb';\n// import Hex from '../utils/hex';\n import {logger} from '../utils/logger';\n import {ErrorTypes, ErrorDetails} from '../errors';\n\n class TSDemuxer {\n\n constructor(observer,remuxerClass) {\n this.observer = observer;\n this.remuxerClass = remuxerClass;\n this.lastCC = 0;\n this.PES_TIMESCALE = 90000;\n this.remuxer = new this.remuxerClass(observer);\n }\n\n static 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 switchLevel() {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = {type: 'video', id :-1, sequenceNumber: 0, samples : [], len : 0, nbNalu : 0};\n this._aacTrack = {type: 'audio', id :-1, sequenceNumber: 0, samples : [], len : 0};\n this._id3Track = {type: 'id3', id :-1, sequenceNumber: 0, samples : [], len : 0};\n this.remuxer.switchLevel();\n }\n\n insertDiscontinuity() {\n this.switchLevel();\n this.remuxer.insertDiscontinuity();\n }\n\n // feed incoming data to the front of the parsing pipeline\n push(data, audioCodec, videoCodec, timeOffset, cc, level, duration) {\n var avcData, aacData, id3Data,\n start, len = data.length, stt, pid, atf, offset;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this.timeOffset = timeOffset;\n this._duration = duration;\n if (cc !== this.lastCC) {\n logger.log('discontinuity detected');\n this.insertDiscontinuity();\n this.lastCC = cc;\n } else if (level !== this.lastLevel) {\n logger.log('level switch detected');\n this.switchLevel();\n this.lastLevel = level;\n }\n var pmtParsed = this.pmtParsed,\n avcId = this._avcTrack.id,\n aacId = this._aacTrack.id,\n id3Id = this._id3Track.id;\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 if (pmtParsed) {\n if (pid === avcId) {\n if (stt) {\n if (avcData) {\n this._parseAVCPES(this._parsePES(avcData));\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 } else if (pid === aacId) {\n if (stt) {\n if (aacData) {\n this._parseAACPES(this._parsePES(aacData));\n }\n aacData = {data: [], size: 0};\n }\n if (aacData) {\n aacData.data.push(data.subarray(offset, start + 188));\n aacData.size += start + 188 - offset;\n }\n } else if (pid === id3Id) {\n if (stt) {\n if (id3Data) {\n this._parseID3PES(this._parsePES(id3Data));\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 }\n } else {\n if (stt) {\n offset += data[offset] + 1;\n }\n if (pid === 0) {\n this._parsePAT(data, offset);\n } else if (pid === this._pmtId) {\n this._parsePMT(data, offset);\n pmtParsed = this.pmtParsed = true;\n avcId = this._avcTrack.id;\n aacId = this._aacTrack.id;\n id3Id = this._id3Track.id;\n }\n }\n } else {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'TS packet did not start with 0x47'});\n }\n }\n // parse last PES packet\n if (avcData) {\n this._parseAVCPES(this._parsePES(avcData));\n }\n if (aacData) {\n this._parseAACPES(this._parsePES(aacData));\n }\n if (id3Data) {\n this._parseID3PES(this._parsePES(id3Data));\n }\n }\n\n remux() {\n this.remuxer.remux(this._aacTrack,this._avcTrack, this._id3Track, this.timeOffset);\n }\n\n destroy() {\n this.switchLevel();\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n\n _parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n this._pmtId = (data[offset + 10] & 0x1F) << 8 | data[offset + 11];\n //logger.log('PMT PID:' + this._pmtId);\n }\n\n _parsePMT(data, offset) {\n var sectionLength, tableEnd, programInfoLength, pid;\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 this._aacTrack.id = pid;\n break;\n // Packetized metadata (ID3)\n case 0x15:\n //logger.log('ID3 PID:' + pid);\n this._id3Track.id = pid;\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 this._avcTrack.id = pid;\n break;\n default:\n 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 }\n\n _parsePES(stream) {\n var i = 0, frag, pesFlags, pesPrefix, pesLen, pesHdrLen, pesData, pesPts, pesDts, payloadStartOffset;\n //retrieve PTS/DTS from first fragment\n frag = stream.data[0];\n pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\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 } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n payloadStartOffset = pesHdrLen + 9;\n // trim PES header\n stream.data[0] = stream.data[0].subarray(payloadStartOffset);\n stream.size -= payloadStartOffset;\n //reassemble PES packet\n pesData = new Uint8Array(stream.size);\n // reassemble the packet\n while (stream.data.length) {\n frag = stream.data.shift();\n pesData.set(frag, i);\n i += frag.byteLength;\n }\n return {data: pesData, pts: pesPts, dts: pesDts, len: pesLen};\n } else {\n return null;\n }\n }\n\n _parseAVCPES(pes) {\n var units,track = this._avcTrack, avcSample, key = false;\n units = this._parseAVCNALu(pes.data);\n // no NALu found\n if (units.length === 0 & this._avcTrack.samples.length > 0) {\n // append pes.data to previous NAL unit\n var lastavcSample = this._avcTrack.samples[this._avcTrack.samples.length - 1];\n var lastUnit = lastavcSample.units.units[lastavcSample.units.units.length - 1];\n var tmp = new Uint8Array(lastUnit.data.byteLength + pes.data.byteLength);\n tmp.set(lastUnit.data, 0);\n tmp.set(pes.data, lastUnit.data.byteLength);\n lastUnit.data = tmp;\n lastavcSample.units.length += pes.data.byteLength;\n this._avcTrack.len += pes.data.byteLength;\n }\n //free pes.data to save up some memory\n pes.data = null;\n //var debugString = '';\n units.units.forEach(unit => {\n switch(unit.type) {\n //NDR\n // case 1:\n // debugString += 'NDR ';\n // break;\n //IDR\n case 5:\n //debugString += 'IDR ';\n key = true;\n break;\n //case 6:\n // debugString += 'SEI ';\n // break;\n //SPS\n case 7:\n //debugString += 'SPS ';\n if(!track.sps) {\n var expGolombDecoder = new ExpGolomb(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.profileIdc = config.profileIdc;\n track.profileCompat = config.profileCompat;\n track.levelIdc = config.levelIdc;\n track.sps = [unit.data];\n track.timescale = this.remuxer.timescale;\n track.duration = this.remuxer.timescale * this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (var 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 //debugString += 'PPS ';\n if (!track.pps) {\n track.pps = [unit.data];\n }\n break;\n //case 9:\n // debugString += 'AUD ';\n default:\n break;\n }\n });\n //logger.log(debugString);\n //build sample from PES\n // Annex B to MP4 conversion to be done\n if (units.length) {\n // only push AVC sample if keyframe already found. browsers expect a keyframe at first to start decoding\n if (key === true || track.sps ) {\n avcSample = {units: units, pts: pes.pts, dts: pes.dts, key: key};\n this._avcTrack.samples.push(avcSample);\n this._avcTrack.len += units.length;\n this._avcTrack.nbNalu += units.units.length;\n }\n }\n }\n\n\n _parseAVCNALu(array) {\n var i = 0, len = array.byteLength, value, overflow, state = 0;\n var units = [], unit, unitType, lastUnitStart, lastUnitType, length = 0;\n //logger.log('PES:' + Hex.hexDump(array));\n while (i < len) {\n value = array[i++];\n // finding 3 or 4-byte start codes (00 00 01 OR 00 00 00 01)\n switch (state) {\n case 0:\n if (value === 0) {\n state = 1;\n }\n break;\n case 1:\n if( value === 0) {\n state = 2;\n } else {\n state = 0;\n }\n break;\n case 2:\n case 3:\n if( value === 0) {\n state = 3;\n } else if (value === 1) {\n unitType = array[i] & 0x1f;\n //logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n if (lastUnitStart) {\n unit = {data: array.subarray(lastUnitStart, i - state - 1), type: lastUnitType};\n length += i - state - 1 - lastUnitStart;\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\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) {\n //logger.log('first NALU found with overflow:' + overflow);\n if (this._avcTrack.samples.length) {\n var lastavcSample = this._avcTrack.samples[this._avcTrack.samples.length - 1];\n var lastUnit = lastavcSample.units.units[lastavcSample.units.units.length - 1];\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 lastavcSample.units.length += overflow;\n this._avcTrack.len += overflow;\n }\n }\n }\n lastUnitStart = i;\n lastUnitType = unitType;\n if (unitType === 1 || unitType === 5) {\n // OPTI !!! if IDR/NDR unit, consider it is last NALu\n i = len;\n }\n state = 0;\n } else {\n state = 0;\n }\n break;\n default:\n break;\n }\n }\n if (lastUnitStart) {\n unit = {data: array.subarray(lastUnitStart, len), type: lastUnitType};\n length += len - lastUnitStart;\n units.push(unit);\n //logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n }\n return {units: units , length: length};\n }\n\n _parseAACPES(pes) {\n var track = this._aacTrack, aacSample, data = pes.data, config, adtsFrameSize, adtsStartOffset, adtsHeaderLen, stamp, nbSamples, len;\n if (this.aacOverFlow) {\n var tmp = new Uint8Array(this.aacOverFlow.byteLength + data.byteLength);\n tmp.set(this.aacOverFlow, 0);\n tmp.set(data, this.aacOverFlow.byteLength);\n data = tmp;\n }\n // look for ADTS header (0xFFFx)\n for (adtsStartOffset = 0, len = data.length; adtsStartOffset < len - 1; adtsStartOffset++) {\n if ((data[adtsStartOffset] === 0xff) && (data[adtsStartOffset+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 (adtsStartOffset) {\n var reason, fatal;\n if (adtsStartOffset < len - 1) {\n reason = `AAC PES did not start with ADTS header,offset:${adtsStartOffset}`;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason});\n if (fatal) {\n return;\n }\n }\n if (!track.audiosamplerate) {\n config = this._ADTStoAudioConfig(data, adtsStartOffset, this.audioCodec);\n track.config = config.config;\n track.audiosamplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.timescale = this.remuxer.timescale;\n track.duration = this.remuxer.timescale * this._duration;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n nbSamples = 0;\n while ((adtsStartOffset + 5) < len) {\n // retrieve frame size\n adtsFrameSize = ((data[adtsStartOffset + 3] & 0x03) << 11);\n // byte 4\n adtsFrameSize |= (data[adtsStartOffset + 4] << 3);\n // byte 5\n adtsFrameSize |= ((data[adtsStartOffset + 5] & 0xE0) >>> 5);\n adtsHeaderLen = (!!(data[adtsStartOffset + 1] & 0x01) ? 7 : 9);\n adtsFrameSize -= adtsHeaderLen;\n stamp = Math.round(pes.pts + nbSamples * 1024 * this.PES_TIMESCALE / track.audiosamplerate);\n //stamp = pes.pts;\n //console.log('AAC frame, offset/length/pts:' + (adtsStartOffset+7) + '/' + adtsFrameSize + '/' + stamp.toFixed(0));\n if (adtsStartOffset + adtsHeaderLen + adtsFrameSize <= len) {\n aacSample = {unit: data.subarray(adtsStartOffset + adtsHeaderLen, adtsStartOffset + adtsHeaderLen + adtsFrameSize), pts: stamp, dts: stamp};\n this._aacTrack.samples.push(aacSample);\n this._aacTrack.len += adtsFrameSize;\n adtsStartOffset += adtsFrameSize + adtsHeaderLen;\n nbSamples++;\n } else {\n break;\n }\n }\n if (adtsStartOffset < len) {\n this.aacOverFlow = data.subarray(adtsStartOffset, len);\n } else {\n this.aacOverFlow = null;\n }\n }\n\n _ADTStoAudioConfig(data, offset, audioCodec) {\n var adtsObjectType, // :int\n adtsSampleingIndex, // :int\n adtsExtensionSampleingIndex, // :int\n adtsChanelConfig, // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n adtsSampleingRates = [\n 96000, 88200,\n 64000, 48000,\n 44100, 32000,\n 24000, 22050,\n 16000, 12000,\n 11025, 8000,\n 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 this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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.log(`manifest codec:${audioCodec},ADTS data:type:${adtsObjectType},sampleingIndex:${adtsSampleingIndex}[${adtsSampleingRates[adtsSampleingIndex]}kHz],channelConfig:${adtsChanelConfig}`);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (userAgent.indexOf('firefox') !== -1) {\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 ...)\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 (manifest codec not specified AND frequency less than 24kHz)\n if ((audioCodec && 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 OR nb channel is 1)\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && (adtsSampleingIndex >= 6 || 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)};\n }\n\n _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n}\n\nexport default TSDemuxer;\n\n", - "export var ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'hlsNetworkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'hlsMediaError',\n // Identifier for all other errors\n OTHER_ERROR: 'hlsOtherError'\n};\n\nexport var ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : XHR response}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : XHR response}\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 playlist load error - data: { url : faulty URL, response : XHR response}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for playlist load timeout - data: { url : faulty URL, response : XHR response}\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 fragment load error - data: { frag : fragment object, response : XHR response}\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 parsing error event - data: parsing error description\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a fragment appending error event - data: appending error description\n FRAG_APPENDING_ERROR: 'fragAppendingError'\n};\n", + "export const ErrorTypes = {\n // Identifier for a network error (loading error / timeout ...)\n NETWORK_ERROR: 'hlsNetworkError',\n // Identifier for a media Error (video/parsing/mediasource error)\n MEDIA_ERROR: 'hlsMediaError',\n // Identifier for all other errors\n OTHER_ERROR: 'hlsOtherError'\n};\n\nexport const ErrorDetails = {\n // Identifier for a manifest load error - data: { url : faulty URL, response : XHR response}\n MANIFEST_LOAD_ERROR: 'manifestLoadError',\n // Identifier for a manifest load timeout - data: { url : faulty URL, response : XHR response}\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 playlist load error - data: { url : faulty URL, response : XHR response}\n LEVEL_LOAD_ERROR: 'levelLoadError',\n // Identifier for playlist load timeout - data: { url : faulty URL, response : XHR response}\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 fragment load error - data: { frag : fragment object, response : XHR response}\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 parsing error event - data: parsing error description\n FRAG_PARSING_ERROR: 'fragParsingError',\n // Identifier for a fragment appending error event - data: appending error description\n FRAG_APPENDING_ERROR: 'fragAppendingError'\n};\n", "export default {\n // fired when MediaSource has been succesfully attached to video element - data: { video, mediaSource }\n MSE_ATTACHED: 'hlsMediaSourceAttached',\n // fired before detaching MediaSource from video element - data: { }\n MSE_DETACHING: 'hlsMediaSourceDetaching',\n // fired when MediaSource has been detached from video element - data: { }\n MSE_DETACHED: 'hlsMediaSourceDetached',\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] , 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: 'hlsPTSUpdated',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCH: 'hlsLevelSwitch',\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 Init Segment has been extracted from fragment - data: { moov : moov MP4 box, codecs : codecs found while parsing fragment}\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing id3 is completed - data: { samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFraParsingMetadata',\n // fired when moof/mdat have been extracted from fragment - data: { moof : moof MP4 box, mdat : mdat MP4 box}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: undefined\n FRAG_PARSED: 'hlsFragParsed',\n // fired when fragment remuxed MP4 boxes have all been appended into SourceBuffer - data: { frag : fragment object, stats : { trequest, tfirst, tload, tparsed, tbuffered, length} }\n FRAG_BUFFERED: 'hlsFragBuffered',\n // fired when fragment matching with current video position is changing - data : { frag : fragment object }\n FRAG_CHANGED: 'hlsFragChanged',\n // Identifier for a FPS drop event - data: {curentDropped, currentDecoded, totalDroppedFrames}\n FPS_DROP: 'hlsFPSDrop',\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 MSE_DETACHED as one could want to detach and reattach a video to the instance of hls.js to handle mid-rolls for example\n DESTROYING: 'hlsDestroying',\n};\n", "/**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n*/\n\nimport {logger} from '../utils/logger';\n\nclass LevelHelper {\n\n static 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 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 if(ccOffset) {\n 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.updateFragPTS(newDetails,PTSFrag.sn,PTSFrag.startPTS,PTSFrag.endPTS);\n } else {\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 // 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 static updateFragPTS(details,sn,startPTS,endPTS) {\n var fragIdx, fragments, frag, i;\n // exit if sn out of range\n if (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 startPTS = Math.max(startPTS,frag.startPTS);\n endPTS = Math.min(endPTS, frag.endPTS);\n }\n \n var drift = startPTS - frag.start;\n \n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\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 static updatePTS(fragments,fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],fragTo = fragments[toIdx], 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.error(`negative duration computed for ${fragFrom}, 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.error(`negative duration computed for ${fragTo}, 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\nexport default LevelHelper;\n", - "/**\n * HLS interface\n */\n'use strict';\n\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport LevelController from './controller/level-controller';\n//import FPSController from './controller/fps-controller';\nimport {logger, enableLogs} from './utils/logger';\nimport XhrLoader from './utils/xhr-loader';\nimport EventEmitter from 'events';\n\nclass Hls {\n\n static isSupported() {\n return (window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"'));\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n constructor(config = {}) {\n var configDefault = {\n autoStartLoad: true,\n debug: false,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n liveSyncDurationCount:3,\n liveMaxLatencyDurationCount: Infinity,\n maxMaxBufferLength: 600,\n enableWorker: true,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 1,\n fragLoadingRetryDelay: 1000,\n fragLoadingLoopThreshold: 3,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 200,\n loader: XhrLoader,\n abrController : AbrController\n };\n for (var prop in configDefault) {\n if (prop in config) { continue; }\n config[prop] = configDefault[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js configuration: \"liveMaxLatencyDurationCount\" must be strictly superior to \"liveSyncDurationCount\" in player configuration');\n }\n\n enableLogs(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...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 PlaylistLoader(this);\n this.fragmentLoader = new FragmentLoader(this);\n this.levelController = new LevelController(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new BufferController(this);\n //this.fpsController = new FPSController(this);\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.bufferController.destroy();\n //this.fpsController.destroy();\n this.url = null;\n this.detachVideo();\n this.observer.removeAllListeners();\n }\n\n attachVideo(video) {\n logger.log('attachVideo');\n this.video = video;\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 video.src = URL.createObjectURL(ms);\n video.addEventListener('error', this.onverror);\n }\n\n detachVideo() {\n logger.log('detachVideo');\n var video = this.video;\n logger.log('trigger MSE_DETACHING');\n this.trigger(Event.MSE_DETACHING);\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n ms.endOfStream();\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n // unlink MediaSource from video tag\n video.src = '';\n this.mediaSource = null;\n logger.log('trigger MSE_DETACHED');\n this.trigger(Event.MSE_DETACHED);\n }\n this.onmso = this.onmse = this.onmsc = null;\n if (video) {\n this.video = null;\n }\n }\n\n loadSource(url) {\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad() {\n logger.log('startLoad');\n this.bufferController.startLoad();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var video = this.video;\n this.detachVideo();\n this.attachVideo(video);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.bufferController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n logger.log(`set currentLevel:${newLevel}`);\n this.loadLevel = newLevel;\n this.bufferController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n get nextLevel() {\n return this.bufferController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n logger.log(`set nextLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n this.bufferController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel();\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.level = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return this.levelController.firstLevel;\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n 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 get autoLevelCapping() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.trigger(Event.MSE_ATTACHED, {video: this.video, mediaSource: this.mediaSource});\n // once received, don't listen anymore to sourceopen event\n this.mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n\n onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n}\n\nexport default Hls;\n", + "/**\n * HLS interface\n */\n'use strict';\n\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport LevelController from './controller/level-controller';\n//import FPSController from './controller/fps-controller';\nimport {logger, enableLogs} from './utils/logger';\nimport XhrLoader from './utils/xhr-loader';\nimport EventEmitter from 'events';\n\nclass Hls {\n\n static isSupported() {\n return (window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"'));\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n constructor(config = {}) {\n var configDefault = {\n autoStartLoad: true,\n debug: false,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n liveSyncDurationCount:3,\n liveMaxLatencyDurationCount: Infinity,\n maxMaxBufferLength: 600,\n enableWorker: true,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 1,\n fragLoadingRetryDelay: 1000,\n fragLoadingLoopThreshold: 3,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 1,\n manifestLoadingRetryDelay: 1000,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 200,\n loader: XhrLoader,\n abrController : AbrController\n };\n for (var prop in configDefault) {\n if (prop in config) { continue; }\n config[prop] = configDefault[prop];\n }\n\n if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {\n throw new Error('Illegal hls.js configuration: \"liveMaxLatencyDurationCount\" must be strictly superior to \"liveSyncDurationCount\" in player configuration');\n }\n\n enableLogs(config.debug);\n this.config = config;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...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 PlaylistLoader(this);\n this.fragmentLoader = new FragmentLoader(this);\n this.levelController = new LevelController(this);\n this.abrController = new config.abrController(this);\n this.bufferController = new BufferController(this);\n //this.fpsController = new FPSController(this);\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.playlistLoader.destroy();\n this.fragmentLoader.destroy();\n this.levelController.destroy();\n this.bufferController.destroy();\n //this.fpsController.destroy();\n this.url = null;\n this.detachVideo();\n this.observer.removeAllListeners();\n }\n\n attachVideo(video) {\n logger.log('attachVideo');\n this.video = video;\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 video.src = URL.createObjectURL(ms);\n }\n\n detachVideo() {\n logger.log('detachVideo');\n var video = this.video;\n logger.log('trigger MSE_DETACHING');\n this.trigger(Event.MSE_DETACHING);\n var ms = this.mediaSource;\n if (ms) {\n if (ms.readyState === 'open') {\n ms.endOfStream();\n }\n ms.removeEventListener('sourceopen', this.onmso);\n ms.removeEventListener('sourceended', this.onmse);\n ms.removeEventListener('sourceclose', this.onmsc);\n // unlink MediaSource from video tag\n video.src = '';\n this.mediaSource = null;\n logger.log('trigger MSE_DETACHED');\n this.trigger(Event.MSE_DETACHED);\n }\n this.onmso = this.onmse = this.onmsc = null;\n if (video) {\n this.video = null;\n }\n }\n\n loadSource(url) {\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad() {\n logger.log('startLoad');\n this.bufferController.startLoad();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var video = this.video;\n this.detachVideo();\n this.attachVideo(video);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.bufferController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n logger.log(`set currentLevel:${newLevel}`);\n this.loadLevel = newLevel;\n this.bufferController.immediateLevelSwitch();\n }\n\n /** Return next playback quality level (quality level of next fragment) **/\n get nextLevel() {\n return this.bufferController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n logger.log(`set nextLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n this.bufferController.nextLevelSwitch();\n }\n\n /** Return the quality level of current/last loaded fragment **/\n get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel();\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.level = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return this.levelController.firstLevel;\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n 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 get autoLevelCapping() {\n return this.abrController.autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this.abrController.autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.trigger(Event.MSE_ATTACHED, {video: this.video, mediaSource: this.mediaSource});\n // once received, don't listen anymore to sourceopen event\n this.mediaSource.removeEventListener('sourceopen', this.onmso);\n }\n\n onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n}\n\nexport default Hls;\n", "/*\n * Fragment Loader\n*/\n\nimport Event from '../events';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\nclass FragmentLoader {\n\n constructor(hls) {\n this.hls = hls;\n this.onfl = this.onFragLoading.bind(this);\n hls.on(Event.FRAG_LOADING, this.onfl);\n }\n\n destroy() {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n this.hls.off(Event.FRAG_LOADING, this.onfl);\n }\n\n onFragLoading(event, data) {\n var frag = data.frag;\n this.frag = frag;\n this.frag.loaded = 0;\n var config = this.hls.config;\n frag.loader = this.loader = new config.loader(config);\n this.loader.load(frag.url, 'arraybuffer', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.fragLoadingTimeOut, config.fragLoadingMaxRetry, config.fragLoadingRetryDelay, this.loadprogress.bind(this), frag);\n }\n\n loadsuccess(event, stats) {\n var payload = event.currentTarget.response;\n stats.length = payload.byteLength;\n // detach fragment loader on load success\n this.frag.loader = undefined;\n this.hls.trigger(Event.FRAG_LOADED, {payload: payload, frag: this.frag, stats: stats});\n }\n\n loaderror(event) {\n this.loader.abort();\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: this.frag, response: event});\n }\n\n loadtimeout() {\n this.loader.abort();\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: this.frag});\n }\n\n loadprogress(event, stats) {\n this.frag.loaded = stats.loaded;\n this.hls.trigger(Event.FRAG_LOAD_PROGRESS, {frag: this.frag, stats: stats});\n }\n}\n\nexport default FragmentLoader;\n", "/**\n * Playlist Loader\n*/\n\nimport Event from '../events';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n//import {logger} from '../utils/logger';\n\nclass PlaylistLoader {\n\n constructor(hls) {\n this.hls = hls;\n this.onml = this.onManifestLoading.bind(this);\n this.onll = this.onLevelLoading.bind(this);\n hls.on(Event.MANIFEST_LOADING, this.onml);\n hls.on(Event.LEVEL_LOADING, this.onll);\n }\n\n destroy() {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n this.url = this.id = null;\n this.hls.off(Event.MANIFEST_LOADING, this.onml);\n this.hls.off(Event.LEVEL_LOADING, this.onll);\n }\n\n onManifestLoading(event, data) {\n this.load(data.url, null);\n }\n\n onLevelLoading(event, data) {\n this.load(data.url, data.level, data.id);\n }\n\n load(url, id1, id2) {\n var config = this.hls.config;\n this.url = url;\n this.id = id1;\n this.id2 = id2;\n this.loader = new config.loader(config);\n this.loader.load(url, '', this.loadsuccess.bind(this), this.loaderror.bind(this), this.loadtimeout.bind(this), config.manifestLoadingTimeOut, config.manifestLoadingMaxRetry, config.manifestLoadingRetryDelay);\n }\n\n resolve(url, baseUrl) {\n var doc = document,\n oldBase = doc.getElementsByTagName('base')[0],\n oldHref = oldBase && oldBase.href,\n docHead = doc.head || doc.getElementsByTagName('head')[0],\n ourBase = oldBase || docHead.appendChild(doc.createElement('base')),\n resolver = doc.createElement('a'),\n resolvedUrl;\n ourBase.href = baseUrl;\n resolver.href = url;\n resolvedUrl = resolver.href; // browser magic at work here\n if (oldBase) { oldBase.href = oldHref; }\n else { docHead.removeChild(ourBase); }\n return resolvedUrl;\n }\n\n parseMasterPlaylist(string, baseurl) {\n var levels = [], level = {}, result, codecs, codec;\n // https://regex101.com is your friend\n var re = /#EXT-X-STREAM-INF:([^\\n\\r]*(BAND)WIDTH=(\\d+))?([^\\n\\r]*(CODECS)=\\\"([^\\\"\\n\\r]*)\\\",?)?([^\\n\\r]*(RES)OLUTION=(\\d+)x(\\d+))?([^\\n\\r]*(NAME)=\\\"(.*)\\\")?[^\\n\\r]*[\\r\\n]+([^\\r\\n]+)/g;\n while ((result = re.exec(string)) != null){\n result.shift();\n result = result.filter(function(n) { return (n !== undefined); });\n level.url = this.resolve(result.pop(), baseurl);\n while (result.length > 0) {\n switch (result.shift()) {\n case 'RES':\n level.width = parseInt(result.shift());\n level.height = parseInt(result.shift());\n break;\n case 'BAND':\n level.bitrate = parseInt(result.shift());\n break;\n case 'NAME':\n level.name = result.shift();\n break;\n case 'CODECS':\n codecs = result.shift().split(',');\n while (codecs.length > 0) {\n codec = codecs.shift();\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else {\n level.audioCodec = codec;\n }\n }\n break;\n default:\n break;\n }\n }\n levels.push(level);\n level = {};\n }\n return levels;\n }\n\n avc1toavcoti(codec) {\n var result, avcdata = codec.split('.');\n if (avcdata.length > 2) {\n result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('00' + parseInt(avcdata.shift()).toString(16)).substr(-4);\n } else {\n result = codec;\n }\n return result;\n }\n\n parseLevelPlaylist(string, baseurl, id) {\n var currentSN = 0, totalduration = 0, level = {url: baseurl, fragments: [], live: true, startSN: 0}, result, regexp, cc = 0, frag, byteRangeEndOffset, byteRangeStartOffset;\n regexp = /(?:#EXT-X-(MEDIA-SEQUENCE):(\\d+))|(?:#EXT-X-(TARGETDURATION):(\\d+))|(?:#EXT(INF):([\\d\\.]+)[^\\r\\n]*([\\r\\n]+[^#|\\r\\n]+)?)|(?:#EXT-X-(BYTERANGE):([\\d]+[@[\\d]*)]*[\\r\\n]+([^#|\\r\\n]+)?|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))/g;\n while ((result = regexp.exec(string)) !== null) {\n result.shift();\n result = result.filter(function(n) { return (n !== undefined); });\n switch (result[0]) {\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(result[1]);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(result[1]);\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n break;\n case 'BYTERANGE':\n var params = result[1].split('@');\n if (params.length === 1) {\n byteRangeStartOffset = byteRangeEndOffset;\n } else {\n byteRangeStartOffset = parseInt(params[1]);\n }\n byteRangeEndOffset = parseInt(params[0]) + byteRangeStartOffset;\n frag = level.fragments.length ? level.fragments[level.fragments.length - 1] : null;\n if (frag && !frag.url) {\n frag.byteRangeStartOffset = byteRangeStartOffset;\n frag.byteRangeEndOffset = byteRangeEndOffset;\n frag.url = this.resolve(result[2], baseurl);\n }\n break;\n case 'INF':\n var duration = parseFloat(result[1]);\n if (!isNaN(duration)) {\n level.fragments.push({url: result[2] ? this.resolve(result[2], baseurl) : null, duration: duration, start: totalduration, sn: currentSN++, level: id, cc: cc, byteRangeStartOffset: byteRangeStartOffset, byteRangeEndOffset: byteRangeEndOffset});\n totalduration += duration;\n byteRangeStartOffset = null;\n }\n break;\n default:\n break;\n }\n }\n //logger.log('found ' + level.fragments.length + ' fragments');\n level.totalduration = totalduration;\n level.endSN = currentSN - 1;\n return level;\n }\n\n loadsuccess(event, stats) {\n var string = event.currentTarget.responseText, url = event.currentTarget.responseURL, id = this.id, id2 = this.id2, hls = this.hls, levels;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n if (url === undefined) {\n // fallback to initial URL\n url = this.url;\n }\n stats.tload = new Date();\n stats.mtime = new Date(event.currentTarget.getResponseHeader('Last-Modified'));\n if (string.indexOf('#EXTM3U') === 0) {\n if (string.indexOf('#EXTINF:') > 0) {\n // 1 level playlist\n // if first request, fire manifest loaded event, level will be reloaded afterwards\n // (this is to have a uniform logic for 1 level/multilevel playlists)\n if (this.id === null) {\n hls.trigger(Event.MANIFEST_LOADED, {levels: [{url: url}], url: url, stats: stats});\n } else {\n hls.trigger(Event.LEVEL_LOADED, {details: this.parseLevelPlaylist(string, url, id), level: id, id: id2, stats: stats});\n }\n } else {\n levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n hls.trigger(Event.MANIFEST_LOADED, {levels: levels, url: url, stats: stats});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest'});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter'});\n }\n }\n\n loaderror(event) {\n var details, fatal;\n if (this.id === null) {\n details = ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n } else {\n details = ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n }\n this.loader.abort();\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: this.url, loader: this.loader, response: event.currentTarget, level: this.id, id: this.id2});\n }\n\n loadtimeout() {\n var details, fatal;\n if (this.id === null) {\n details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n } else {\n details = ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n }\n this.loader.abort();\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: this.url, loader: this.loader, level: this.id, id: this.id2});\n }\n}\n\nexport default PlaylistLoader;\n", "/**\n * Generate MP4 Box\n*/\n\nclass MP4 {\n static 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 mvex: [],\n mvhd: [],\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] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n MP4.MAJOR_BRAND = new Uint8Array([\n 'i'.charCodeAt(0),\n 's'.charCodeAt(0),\n 'o'.charCodeAt(0),\n 'm'.charCodeAt(0)\n ]);\n\n MP4.AVC1_BRAND = new Uint8Array([\n 'a'.charCodeAt(0),\n 'v'.charCodeAt(0),\n 'c'.charCodeAt(0),\n '1'.charCodeAt(0)\n ]);\n\n MP4.MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n\n MP4.VIDEO_HDLR = new Uint8Array([\n 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,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n MP4.AUDIO_HDLR = new Uint8Array([\n 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,\n 0x64, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n 'video': MP4.VIDEO_HDLR,\n 'audio': MP4.AUDIO_HDLR\n };\n\n MP4.DREF = new Uint8Array([\n 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 MP4.STCO = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n MP4.STSC = MP4.STCO;\n MP4.STTS = MP4.STCO;\n MP4.STSZ = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00, // sample_count\n ]);\n MP4.VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]);// entry_count\n\n MP4.FTYP = MP4.box(MP4.types.ftyp, MP4.MAJOR_BRAND, MP4.MINOR_VERSION, MP4.MAJOR_BRAND, MP4.AVC1_BRAND);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, MP4.DREF));\n }\n\n static box(type) {\n var\n payload = Array.prototype.slice.call(arguments, 1),\n size = 0,\n i = payload.length,\n result,\n view;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer);\n view.setUint32(0, result.byteLength);\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n }\n\n static hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n\n static mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n\n static mdhd(timescale, duration) {\n return MP4.box(MP4.types.mdhd, new Uint8Array([\n 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,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (duration >> 24),\n (duration >> 16) & 0xFF,\n (duration >> 8) & 0xFF,\n duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]));\n }\n\n static 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 static mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber >> 24),\n (sequenceNumber >> 16) & 0xFF,\n (sequenceNumber >> 8) & 0xFF,\n sequenceNumber & 0xFF, // sequence_number\n ]));\n }\n\n static 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 static 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 static moov(tracks) {\n var\n 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 static mvex(tracks) {\n var\n 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 static mvhd(timescale,duration) {\n var\n bytes = new Uint8Array([\n 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,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (duration >> 24) & 0xFF,\n (duration >> 16) & 0xFF,\n (duration >> 8) & 0xFF,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 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 static sdtp(track) {\n var\n 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) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n\n static 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 static avc1(track) {\n var sps = [], pps = [], i;\n // assemble the SPSs\n for (i = 0; i < track.sps.length; i++) {\n sps.push((track.sps[i].byteLength >>> 8) & 0xFF);\n sps.push((track.sps[i].byteLength & 0xFF)); // sequenceParameterSetLength\n sps = sps.concat(Array.prototype.slice.call(track.sps[i])); // SPS\n }\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n pps.push((track.pps[i].byteLength >>> 8) & 0xFF);\n pps.push((track.pps[i].byteLength & 0xFF));\n pps = pps.concat(Array.prototype.slice.call(track.pps[i]));\n }\n return MP4.box(MP4.types.avc1, new Uint8Array([\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width >> 8) & 0xFF,\n track.width & 0xff, // width\n (track.height >> 8) & 0xFF,\n track.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 0x13,\n 0x76, 0x69, 0x64, 0x65,\n 0x6f, 0x6a, 0x73, 0x2d,\n 0x63, 0x6f, 0x6e, 0x74,\n 0x72, 0x69, 0x62, 0x2d,\n 0x68, 0x6c, 0x73, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n MP4.box(MP4.types.avcC, new Uint8Array([\n 0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompat, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([\n track.sps.length // numOfSequenceParameterSets\n ]).concat(sps).concat([\n track.pps.length // numOfPictureParameterSets\n ]).concat(pps))), // \"PPS\"\n MP4.box(MP4.types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])) // avgBitrate\n );\n }\n\n static esds(track) {\n return new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n\n 0x03, // descriptor_type\n 0x17+track.config.length, // length\n 0x00, 0x01, //es_id\n 0x00, // stream_priority\n\n 0x04, // descriptor_type\n 0x0f+track.config.length, // 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([track.config.length]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n }\n\n static mp4a(track) {\n return MP4.box(MP4.types.mp4a, new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (track.audiosamplerate >> 8) & 0xFF,\n track.audiosamplerate & 0xff, //\n 0x00, 0x00]),\n MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n\n static stsd(track) {\n if (track.type === 'audio') {\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 static tkhd(track) {\n return MP4.box(MP4.types.tkhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id >> 24) & 0xFF,\n (track.id >> 16) & 0xFF,\n (track.id >> 8) & 0xFF,\n track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration >> 24),\n (track.duration >> 16) & 0xFF,\n (track.duration >> 8) & 0xFF,\n track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width >> 8) & 0xFF,\n track.width & 0xFF,\n 0x00, 0x00, // width\n (track.height >> 8) & 0xFF,\n track.height & 0xFF,\n 0x00, 0x00 // height\n ]));\n }\n\n static traf(track,baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track);\n return MP4.box(MP4.types.traf,\n MP4.box(MP4.types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id >> 24),\n (track.id >> 16) & 0XFF,\n (track.id >> 8) & 0XFF,\n (track.id & 0xFF) // track_ID\n ])),\n MP4.box(MP4.types.tfdt, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (baseMediaDecodeTime >>24),\n (baseMediaDecodeTime >> 16) & 0XFF,\n (baseMediaDecodeTime >> 8) & 0XFF,\n (baseMediaDecodeTime & 0xFF) // baseMediaDecodeTime\n ])),\n MP4.trun(track,\n sampleDependencyTable.length +\n 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 static trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n\n static trex(track) {\n return MP4.box(MP4.types.trex, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id >> 24),\n (track.id >> 16) & 0XFF,\n (track.id >> 8) & 0XFF,\n (track.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 static trun(track, offset) {\n var samples, sample, i, array;\n samples = track.samples || [];\n array = new Uint8Array(12 + (16 * samples.length));\n offset += 8 + array.byteLength;\n array.set([\n 0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n (samples.length >>> 24) & 0xFF,\n (samples.length >>> 16) & 0xFF,\n (samples.length >>> 8) & 0xFF,\n samples.length & 0xFF, // sample_count\n (offset >>> 24) & 0xFF,\n (offset >>> 16) & 0xFF,\n (offset >>> 8) & 0xFF,\n offset & 0xFF // data_offset\n ],0);\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n array.set([\n (sample.duration >>> 24) & 0xFF,\n (sample.duration >>> 16) & 0xFF,\n (sample.duration >>> 8) & 0xFF,\n sample.duration & 0xFF, // sample_duration\n (sample.size >>> 24) & 0xFF,\n (sample.size >>> 16) & 0xFF,\n (sample.size >>> 8) & 0xFF,\n sample.size & 0xFF, // sample_size\n (sample.flags.isLeading << 2) | sample.flags.dependsOn,\n (sample.flags.isDependedOn << 6) |\n (sample.flags.hasRedundancy << 4) |\n (sample.flags.paddingValue << 1) |\n sample.flags.isNonSync,\n sample.flags.degradPrio & 0xF0 << 8,\n sample.flags.degradPrio & 0x0F, // sample_flags\n (sample.cts >>> 24) & 0xFF,\n (sample.cts >>> 16) & 0xFF,\n (sample.cts >>> 8) & 0xFF,\n sample.cts & 0xFF // sample_composition_time_offset\n ],12+16*i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n\n static initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks), 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\nexport default MP4;\n", diff --git a/dist/hls.min.js b/dist/hls.min.js index 49927ed7789..2188fa60e8f 100644 --- a/dist/hls.min.js +++ b/dist/hls.min.js @@ -1,3 +1,3 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Hls=t()}}(function(){return function a(e,t,i){function r(s,d){if(!t[s]){if(!e[s]){var l="function"==typeof require&&require;if(!d&&l)return l(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var o=t[s]={exports:{}};e[s][0].call(o.exports,function(t){var i=e[s][1][t];return r(i?i:t)},o,o.exports,a,e,t,i)}return t[s].exports}for(var n="function"==typeof require&&require,s=0;se||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},e.prototype.emit=function(u){var o,s,n,a,e,l;if(this._events||(this._events={}),"error"===u&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(o=arguments[1],o instanceof Error)throw o;throw TypeError('Uncaught, unspecified "error" event.')}if(s=this._events[u],r(s))return!1;if(t(s))switch(arguments.length){case 1:s.call(this);break;case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,a=new Array(n-1),e=1;n>e;e++)a[e-1]=arguments[e];s.apply(this,a)}else if(i(s)){for(n=arguments.length,a=new Array(n-1),e=1;n>e;e++)a[e-1]=arguments[e];for(l=s.slice(),n=l.length,e=0;n>e;e++)l[e].apply(this,a)}return!0},e.prototype.addListener=function(s,n){var a;if(!t(n))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",s,t(n.listener)?n.listener:n),this._events[s]?i(this._events[s])?this._events[s].push(n):this._events[s]=[this._events[s],n]:this._events[s]=n,i(this._events[s])&&!this._events[s].warned){var a;a=r(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,a&&a>0&&this._events[s].length>a&&(this._events[s].warned=!0,"function"==typeof console.trace)}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(r,e){function i(){this.removeListener(r,i),s||(s=!0,e.apply(this,arguments))}if(!t(e))throw TypeError("listener must be a function");var s=!1;return i.listener=e,this.on(r,i),this},e.prototype.removeListener=function(s,r){var e,a,o,n;if(!t(r))throw TypeError("listener must be a function");if(!this._events||!this._events[s])return this;if(e=this._events[s],o=e.length,a=-1,e===r||t(e.listener)&&e.listener===r)delete this._events[s],this._events.removeListener&&this.emit("removeListener",s,r);else if(i(e)){for(n=o;n-->0;)if(e[n]===r||e[n].listener&&e[n].listener===r){a=n;break}if(0>a)return this;1===e.length?(e.length=0,delete this._events[s]):e.splice(a,1),this._events.removeListener&&this.emit("removeListener",s,r)}return this},e.prototype.removeAllListeners=function(e){var r,i;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(r in this._events)"removeListener"!==r&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[e],t(i))this.removeListener(e,i);else for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},e.prototype.listeners=function(e){var i;return i=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e.listenerCount=function(e,i){var r;return r=e._events&&e._events[i]?t(e._events[i])?1:e._events[i].length:0}},{}],2:[function(n,r,a){var s=arguments[3],e=arguments[4],i=arguments[5],t=JSON.stringify;r.exports=function(u){for(var r,o=Object.keys(i),n=0,l=o.length;l>n;n++){var a=o[n];if(i[a].exports===u){r=a;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},n=0,l=o.length;l>n;n++){var a=o[n];d[a]=a}e[r]=[Function(["require","module","exports"],"("+u+")(self)"),d]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),f={};f[r]=r,e[h]=[Function(["require"],"require("+t(r)+")(self)"),f];var c="("+s+")({"+Object.keys(e).map(function(i){return t(i)+":["+e[i][0]+","+t(e[i][1])+"]"}).join(",")+"},{},["+t(h)+"])",v=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(v.createObjectURL(new Blob([c],{type:"text/javascript"})))}},{}],3:[function(i,r,e){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function e(r,i){for(var t=0;t=e;e++)if(i=e<=this.lastfetchlevel?.8*r:.7*r,ik){if(this.hls.nextLoadLevel=a,this.level=a,n=this.levels[a].details,"undefined"==typeof n){this.state=this.WAITING_LEVEL;break}var o=n.fragments,f=o.length,u=o[0].start,A=o[f-1].start+o[f-1].duration,r=void 0;if(n.live){if(l=n.startSN&&g<=n.endSN&&(r=o[g-n.startSN],e.logger.log("live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=o[Math.round(f/2)],e.logger.log("live playlist, switching playlist, unknown, load middle frag : "+r.sn))}}else u>l&&(r=o[0]);if(!r){if(l>A)break;for(h=0;f>h&&(r=o[h],u=r.start,!(l>=u&&u+r.duration>l));h++);if(this.fragPrevious&&r.level===this.fragPrevious.level&&r.sn===this.fragPrevious.sn){if(h===f-1)break;r=o[h+1],e.logger.log("SN just loaded, load next one: "+r.sn)}}if(e.logger.log("Loading "+r.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+a+", currentTime:"+d+",bufferEnd:"+l.toFixed(3)),r.autoLevel=this.hls.autoLevelEnabled,this.levels.length>1&&(r.expectedLen=Math.round(r.duration*this.levels[a].bitrate/8),r.trequest=new Date),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,r.loadCounter){r.loadCounter++;var b=this.config.fragLoadingLoopThreshold;if(r.loadCounter>b&&Math.abs(this.fragLoadIdx-r.loadIdx)1){var T=new Date-s.trequest;if(T>500*s.duration){var _=1e3*s.loaded/T;s.expectedLeny&&m>R&&(e.logger.warn("loading too slow, abort fragment loading"),e.logger.log("fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :"+m.toFixed(1)+"/"+y.toFixed(1)+"/"+R.toFixed(1)),s.loader.abort(),this.hls.trigger(t.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s}),this.state=this.IDLE)}}break;case this.PARSING:break;case this.PARSED:case this.APPENDING:if(this.sourceBuffer){if(this.sourceBuffer.audio&&this.sourceBuffer.audio.updating||this.sourceBuffer.video&&this.sourceBuffer.video.updating);else if(this.mp4segments.length){var E=this.mp4segments.shift();try{this.sourceBuffer[E.type].appendBuffer(E.data),this.appendError=0}catch(r){e.logger.error("error while trying to append buffer:"+r.message+",try appending later"),this.mp4segments.unshift(E),this.appendError?this.appendError++:this.appendError=1;var v={type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_APPENDING_ERROR,frag:this.fragCurrent};if(this.appendError>this.config.appendErrorMaxRetry)return e.logger.log("fail "+this.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0,this.hls.trigger(t.default.ERROR,v),void(this.state=this.ERROR);v.fatal=!1,this.hls.trigger(t.default.ERROR,v)}this.state=this.APPENDING}}else this.state=this.IDLE;break;case this.BUFFER_FLUSHING:for(;this.flushRange.length;){var L=this.flushRange[0];if(!this.flushBuffer(L.start,L.end))break;this.flushRange.shift()}0===this.flushRange.length&&(this.immediateSwitch&&this.immediateLevelSwitchEnd(),this.state=this.IDLE,this.fragPrevious=null)}this._checkFragmentChanged()}},{key:"bufferInfo",value:function(i,n){var l,o,s,u,e,h=this.video,r=h.buffered,t=[];for(e=0;e=a&&d>i?(o=a,s=d+n,l=s-i):a>i+n&&(u=a)}return{len:l,start:o,end:s,nextStart:u}}},{key:"getBufferRange",value:function(i){var e,t;for(e=this.bufferRange.length-1;e>=0;e--)if(t=this.bufferRange[e],i>=t.start&&i<=t.end)return t;return null}},{key:"followingBufferRange",value:function(e){return e?this.getBufferRange(e.end+.5):null}},{key:"isBuffered",value:function(i){for(var r=this.video,t=r.buffered,e=0;e=t.start(e)&&i<=t.end(e))return!0;return!1}},{key:"_checkFragmentChanged",value:function(){var r,i,s=this.video;if(s&&s.seeking===!1&&(i=s.currentTime,i>s.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=i),this.isBuffered(i)?r=this.getBufferRange(i):this.isBuffered(i+.1)&&(r=this.getBufferRange(i+.1)),r)){var n=r.frag;n!==this.fragPlaying&&(this.fragPlaying=n,this.hls.trigger(t.default.FRAG_CHANGED,{frag:n}));var a=this.levels[this.level].details;if(a&&!a.live&&n.sn===a.endSN){var o=this.mediaSource;o&&"open"===o.readyState&&(e.logger.log("all media data available, signal endOfStream() to MediaSource"),o.endOfStream())}}}},{key:"flushBuffer",value:function(d,l){var i,t,o,a,r,s;if(this.flushBufferCounter++<2*this.bufferRange.length&&this.sourceBuffer)for(var u in this.sourceBuffer){if(i=this.sourceBuffer[u],i.updating)return!1;for(t=0;t.5)return e.logger.log("flush "+u+" ["+r+","+s+"], of ["+o+","+a+"], pos:"+this.video.currentTime),i.remove(r,s),!1}var n,h=[];for(t=0;ts-a&&(e.logger.log("adjust currentTime from "+a+" to "+s),r.currentTime=s)}}this.seekAfterBuffered=void 0}this.tick()}},{key:"onSBUpdateError",value:function(r){e.logger.error("sourceBuffer error:"+r),this.state=this.ERROR,this.hls.trigger(t.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_APPENDING_ERROR,fatal:!0,frag:this.fragCurrent})}},{key:"timeRangesToString",value:function(t){for(var i="",r=t.length,e=0;r>e;e++)i+="["+t.start(e)+","+t.end(e)+"]";return i}},{key:"currentLevel",get:function(){if(this.video){var e=this.getBufferRange(this.video.currentTime);if(e)return e.frag.level}return-1}},{key:"nextBufferRange",get:function(){return this.video?this.followingBufferRange(this.getBufferRange(this.video.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferRange;return e?e.frag.level:-1}}]),r}();n.default=v,c.exports=n.default},{"../demux/demuxer":8,"../errors":11,"../events":12,"../helper/level-helper":13,"../utils/logger":19}],5:[function(r,n,s){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var d=function(){function e(r,i){for(var t=0;t=0&&r1?i-1:0),e=1;i>e;e++)s[e-1]=arguments[e];t.emit.apply(t,[r,r].concat(s))},t.off=function(s){for(var i=arguments.length,r=Array(i>1?i-1:0),e=1;i>e;e++)r[e-1]=arguments[e];t.removeListener.apply(t,[s].concat(r))},i.addEventListener("message",function(e){switch(e.data.cmd){case"init":i.demuxer=new n.default(t,h.default);break;case"demux":i.demuxer.push(new Uint8Array(e.data.data),e.data.audioCodec,e.data.videoCodec,e.data.timeOffset,e.data.cc,e.data.level,e.data.duration), -i.demuxer.remux()}}),t.on(e.default.FRAG_PARSING_INIT_SEGMENT,function(s,t){var e={event:s},r=[];t.audioCodec&&(e.audioCodec=t.audioCodec,e.audioMoov=t.audioMoov.buffer,e.audioChannelCount=t.audioChannelCount,r.push(e.audioMoov)),t.videoCodec&&(e.videoCodec=t.videoCodec,e.videoMoov=t.videoMoov.buffer,e.videoWidth=t.videoWidth,e.videoHeight=t.videoHeight,r.push(e.videoMoov)),i.postMessage(e,r)}),t.on(e.default.FRAG_PARSING_DATA,function(r,e){var t={event:r,type:e.type,startPTS:e.startPTS,endPTS:e.endPTS,startDTS:e.startDTS,endDTS:e.endDTS,moof:e.moof.buffer,mdat:e.mdat.buffer,nb:e.nb};i.postMessage(t,[t.moof,t.mdat])}),t.on(e.default.FRAG_PARSED,function(e){i.postMessage({event:e})}),t.on(e.default.ERROR,function(e,t){i.postMessage({event:e,data:t})}),t.on(e.default.FRAG_PARSING_METADATA,function(e,t){var r={event:e,samples:t.samples};i.postMessage(r)})};r.default=o,a.exports=r.default},{"../demux/demuxer-inline":6,"../events":12,"../remux/mp4-remuxer":18,events:1}],8:[function(e,l,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var f=function(){function e(r,i){for(var t=0;te?(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(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0?i<>>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:"skipScalingList",value:function(s){var t,r,i=8,e=8;for(t=0;s>t;t++)0!==e&&(r=this.readEG(),e=(i+r+256)%256),i=0===e?i:e}},{key:"readSPS",value:function(){var t,o,l,r,s,n,i,v,e,u=0,d=0,h=0,f=0;if(this.readUByte(),t=this.readUByte(),o=this.readBits(5),this.skipBits(3),l=this.readUByte(),this.skipUEG(),100===t||110===t||122===t||144===t){var c=this.readUEG();if(3===c&&this.skipBits(1),this.skipUEG(),this.skipUEG(),this.skipBits(1),this.readBoolean())for(v=3!==c?8:12,e=0;v>e;e++)this.readBoolean()&&(6>e?this.skipScalingList(16):this.skipScalingList(64))}this.skipUEG();var a=this.readUEG();if(0===a)this.readUEG();else if(1===a)for(this.skipBits(1),this.skipEG(),this.skipEG(),r=this.readUEG(),e=0;r>e;e++)this.skipEG();return this.skipUEG(),this.skipBits(1),s=this.readUEG(),n=this.readUEG(),i=this.readBits(1),0===i&&this.skipBits(1),this.skipBits(1),this.readBoolean()&&(u=this.readUEG(),d=this.readUEG(),h=this.readUEG(),f=this.readUEG()),{profileIdc:t,profileCompat:o,levelIdc:l,width:16*(s+1)-2*u-2*d,height:(2-i)*(n+1)*16-2*h-2*f}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();e.default=a,i.exports=e.default},{"../utils/logger":19}],10:[function(i,a,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var h=function(){function e(r,i){for(var t=0;ti;i+=188)if(71===r[i]){if(d=!!(64&r[i+1]),u=((31&r[i+1])<<8)+r[i+2],p=(48&r[i+3])>>4,p>1){if(n=i+5+r[i+4],n===i+188)continue}else n=i+4;m?u===c?(d&&(a&&this._parseAVCPES(this._parsePES(a)),a={data:[],size:0}),a&&(a.data.push(r.subarray(n,i+188)),a.size+=i+188-n)):u===f?(d&&(o&&this._parseAACPES(this._parsePES(o)),o={data:[],size:0}),o&&(o.data.push(r.subarray(n,i+188)),o.size+=i+188-n)):u===g&&(d&&(l&&this._parseID3PES(this._parsePES(l)),l={data:[],size:0}),l&&(l.data.push(r.subarray(n,i+188)),l.size+=i+188-n)):(d&&(n+=r[n]+1),0===u?this._parsePAT(r,n):u===this._pmtId&&(this._parsePMT(r,n),m=this.pmtParsed=!0,c=this._avcTrack.id,f=this._aacTrack.id,g=this._id3Track.id))}else this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});a&&this._parseAVCPES(this._parsePES(a)),o&&this._parseAACPES(this._parsePES(o)),l&&this._parseID3PES(this._parsePES(l))}},{key:"remux",value:function(){this.remuxer.remux(this._aacTrack,this._avcTrack,this._id3Track,this.timeOffset)}},{key:"destroy",value:function(){this.switchLevel(),this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){this._pmtId=(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(i,e){var s,n,a,r;for(s=(15&i[e+1])<<8|i[e+2],n=e+3+s-4,a=(15&i[e+10])<<8|i[e+11],e+=12+a;n>e;){switch(r=(31&i[e+1])<<8|i[e+2],i[e]){case 15:this._aacTrack.id=r;break;case 21:this._id3Track.id=r;break;case 27:this._avcTrack.id=r;break;default:t.logger.log("unkown stream type:"+i[e])}e+=((15&i[e+3])<<8|i[e+4])+5}}},{key:"_parsePES",value:function(t){var e,s,u,o,d,n,i,r,a,l=0;if(e=t.data[0],u=(e[0]<<16)+(e[1]<<8)+e[2],1===u){for(o=(e[4]<<8)+e[5],s=e[7],192&s&&(i=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,i>4294967295&&(i-=8589934592),64&s?(r=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,r>4294967295&&(r-=8589934592)):r=i),d=e[8],a=d+9,t.data[0]=t.data[0].subarray(a),t.size-=a,n=new Uint8Array(t.size);t.data.length;)e=t.data.shift(),n.set(e,l),l+=e.byteLength;return{data:n,pts:i,dts:r,len:o}}return null}},{key:"_parseAVCPES",value:function(t){var i,l,s=this,e=this._avcTrack,n=!1;if(i=this._parseAVCNALu(t.data),0===i.length&this._avcTrack.samples.length>0){var a=this._avcTrack.samples[this._avcTrack.samples.length-1],r=a.units.units[a.units.units.length-1],o=new Uint8Array(r.data.byteLength+t.data.byteLength);o.set(r.data,0),o.set(t.data,r.data.byteLength),r.data=o,a.units.length+=t.data.byteLength,this._avcTrack.len+=t.data.byteLength}t.data=null,i.units.forEach(function(t){switch(t.type){case 5:n=!0;break;case 7:if(!e.sps){var l=new u.default(t.data),i=l.readSPS();e.width=i.width,e.height=i.height,e.profileIdc=i.profileIdc,e.profileCompat=i.profileCompat,e.levelIdc=i.levelIdc,e.sps=[t.data],e.timescale=s.remuxer.timescale,e.duration=s.remuxer.timescale*s._duration;for(var d=t.data.subarray(1,4),o="avc1.",a=0;3>a;a++){var r=d[a].toString(16);r.length<2&&(r="0"+r),o+=r}e.codec=o}break;case 8:e.pps||(e.pps=[t.data])}}),i.length&&(n===!0||e.sps)&&(l={units:i,pts:t.pts,dts:t.dts,key:n},this._avcTrack.samples.push(l),this._avcTrack.len+=i.length,this._avcTrack.nbNalu+=i.units.length)}},{key:"_parseAVCNALu",value:function(r){for(var n,s,l,a,i,d,t=0,o=r.byteLength,e=0,h=[],f=0;o>t;)switch(n=r[t++],e){case 0:0===n&&(e=1);break;case 1:e=0===n?2:0;break;case 2:case 3:if(0===n)e=3;else if(1===n){if(a=31&r[t],i)l={data:r.subarray(i,t-e-1),type:d},f+=t-e-1-i,h.push(l);else if(s=t-e-1,s&&this._avcTrack.samples.length){var c=this._avcTrack.samples[this._avcTrack.samples.length-1],u=c.units.units[c.units.units.length-1],v=new Uint8Array(u.data.byteLength+s);v.set(u.data,0),v.set(r.subarray(0,s),u.data.byteLength),u.data=v,c.units.length+=s,this._avcTrack.len+=s}i=t,d=a,(1===a||5===a)&&(t=o),e=0}else e=0}return i&&(l={data:r.subarray(i,o),type:d},f+=o-i,h.push(l)),{units:h,length:f}}},{key:"_parseAACPES",value:function(p){var g,o,a,i,u,f,h,l,n=this._aacTrack,r=p.data;if(this.aacOverFlow){var v=new Uint8Array(this.aacOverFlow.byteLength+r.byteLength);v.set(this.aacOverFlow,0),v.set(r,this.aacOverFlow.byteLength),r=v}for(i=0,l=r.length;l-1>i&&(255!==r[i]||240!==(240&r[i+1]));i++);if(i){var c,d;if(l-1>i?(c="AAC PES did not start with ADTS header,offset:"+i,d=!1):(c="no ADTS header found in AAC PES",d=!0),this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:d,reason:c}),d)return}for(n.audiosamplerate||(o=this._ADTStoAudioConfig(r,i,this.audioCodec),n.config=o.config,n.audiosamplerate=o.samplerate,n.channelCount=o.channelCount,n.codec=o.codec,n.timescale=this.remuxer.timescale,n.duration=this.remuxer.timescale*this._duration,t.logger.log("parsed codec:"+n.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)),h=0;l>i+5&&(a=(3&r[i+3])<<11,a|=r[i+4]<<3,a|=(224&r[i+5])>>>5,u=1&r[i+1]?7:9,a-=u,f=Math.round(p.pts+1024*h*this.PES_TIMESCALE/n.audiosamplerate),l>=i+u+a);)g={unit:r.subarray(i+u,i+u+a),pts:f,dts:f},this._aacTrack.samples.push(g),this._aacTrack.len+=a,i+=a+u,h++;l>i?this.aacOverFlow=r.subarray(i,l):this.aacOverFlow=null}},{key:"_ADTStoAudioConfig",value:function(u,d,o){var n,i,a,l,r,f=navigator.userAgent.toLowerCase(),h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return n=((192&u[d+2])>>>6)+1,i=(60&u[d+2])>>>2,i>h.length-1?void this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+i}):(l=(1&u[d+2])<<2,l|=(192&u[d+3])>>>6,t.logger.log("manifest codec:"+o+",ADTS data:type:"+n+",sampleingIndex:"+i+"["+h[i]+"kHz],channelConfig:"+l),-1!==f.indexOf("firefox")?i>=6?(n=5,r=new Array(4),a=i-3):(n=2,r=new Array(2),a=i):-1!==f.indexOf("android")?(n=2,r=new Array(2),a=i):(n=5,r=new Array(4),o&&-1!==o.indexOf("mp4a.40.5")||!o&&i>=6?a=i-3:(o&&-1!==o.indexOf("mp4a.40.2")&&(i>=6||1===l)&&(n=2,r=new Array(2)),a=i)),r[0]=n<<3,r[0]|=(14&i)>>1,r[1]|=(1&i)<<7,r[1]|=l<<3,5===n&&(r[1]|=(14&a)>>1,r[2]=(1&a)<<7,r[2]|=8,r[3]=0),{config:r,samplerate:h[i],channelCount:l,codec:"mp4a.40."+n})}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]?!0:!1}}]),i}();r.default=o,a.exports=r.default},{"../errors":11,"../events":12,"../utils/logger":19,"./exp-golomb":9}],11:[function(r,s,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t={NETWORK_ERROR:"hlsNetworkError",MEDIA_ERROR:"hlsMediaError",OTHER_ERROR:"hlsOtherError"};e.ErrorTypes=t;var i={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_PARSING_ERROR:"fragParsingError",FRAG_APPENDING_ERROR:"fragAppendingError"};e.ErrorDetails=i},{}],12:[function(i,t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={MSE_ATTACHED:"hlsMediaSourceAttached",MSE_DETACHING:"hlsMediaSourceDetaching",MSE_DETACHED:"hlsMediaSourceDetached",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsPTSUpdated",LEVEL_SWITCH:"hlsLevelSwitch",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_METADATA:"hlsFraParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFPSDrop",ERROR:"hlsError",DESTROYING:"hlsDestroying"},t.exports=e.default},{}],13:[function(i,r,e){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(r,i){for(var t=0;td)return void(r.PTSKnown=!1);for(var i=c;d>=i;i++){var l=f[h+i],s=o[i];u=l.cc-s.cc,isNaN(l.startPTS)||(s.start=s.startPTS=l.startPTS,s.endPTS=l.endPTS,s.duration=l.duration,a=s)}if(u)for(t.logger.log("discontinuity sliding from playlist, take drift into account"),i=0;ir.endSN)return 0;o=l-r.startSN,n=r.fragments,i=n[o],isNaN(i.startPTS)||(s=Math.max(s,i.startPTS),a=Math.min(a,i.endPTS));var u=s-i.start;for(i.start=i.startPTS=s,i.endPTS=a,i.duration=a-s,t=o;t>0;t--)e.updatePTS(n,t,t-1);for(t=o;tr?i.start=e.start+e.duration:i.start=e.start-i.duration:s>r?(e.duration=n-e.start,e.duration<0&&t.logger.error("negative duration computed for "+e+", there should be some duration drift between playlist and fragment!")):(i.duration=e.start-n,i.duration<0&&t.logger.error("negative duration computed for "+i+", there should be some duration drift between playlist and fragment!"))}}]),e}();e.default=a,r.exports=e.default},{"../utils/logger":19}],14:[function(t,f,s){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var n=function(){function e(r,i){for(var t=0;t1?t-1:0),e=1;t>e;e++)s[e-1]=arguments[e];i.emit.apply(i,[r,r].concat(s))},i.off=function(s){for(var t=arguments.length,r=Array(t>1?t-1:0),e=1;t>e;e++)r[e-1]=arguments[e];i.removeListener.apply(i,[s].concat(r))},this.on=i.on.bind(i),this.off=i.off.bind(i),this.trigger=i.trigger.bind(i),this.playlistLoader=new d.default(this),this.fragmentLoader=new R.default(this),this.levelController=new y.default(this),this.abrController=new r.abrController(this),this.bufferController=new p.default(this)}return n(t,null,[{key:"isSupported",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"Events",get:function(){return r.default}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}}]),n(t,[{key:"destroy",value:function(){e.logger.log("destroy"),this.trigger(r.default.DESTROYING),this.playlistLoader.destroy(),this.fragmentLoader.destroy(),this.levelController.destroy(),this.bufferController.destroy(),this.url=null,this.detachVideo(),this.observer.removeAllListeners()}},{key:"attachVideo",value:function(i){e.logger.log("attachVideo"),this.video=i;var t=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),t.addEventListener("sourceopen",this.onmso),t.addEventListener("sourceended",this.onmse),t.addEventListener("sourceclose",this.onmsc),i.src=URL.createObjectURL(t),i.addEventListener("error",this.onverror)}},{key:"detachVideo",value:function(){e.logger.log("detachVideo");var i=this.video;e.logger.log("trigger MSE_DETACHING"),this.trigger(r.default.MSE_DETACHING);var t=this.mediaSource;t&&("open"===t.readyState&&t.endOfStream(),t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),i.src="",this.mediaSource=null,e.logger.log("trigger MSE_DETACHED"),this.trigger(r.default.MSE_DETACHED)),this.onmso=this.onmse=this.onmsc=null,i&&(this.video=null)}},{key:"loadSource",value:function(t){e.logger.log("loadSource:"+t),this.url=t,this.trigger(r.default.MANIFEST_LOADING,{url:t})}},{key:"startLoad",value:function(){e.logger.log("startLoad"),this.bufferController.startLoad()}},{key:"recoverMediaError",value:function(){e.logger.log("recoverMediaError");var t=this.video;this.detachVideo(),this.attachVideo(t)}},{key:"onMediaSourceOpen",value:function(){e.logger.log("media source opened"),this.trigger(r.default.MSE_ATTACHED,{video:this.video,mediaSource:this.mediaSource}),this.mediaSource.removeEventListener("sourceopen",this.onmso)}},{key:"onMediaSourceClose",value:function(){e.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){e.logger.log("media source ended")}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.bufferController.currentLevel},set:function(t){e.logger.log("set currentLevel:"+t),this.loadLevel=t,this.bufferController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.bufferController.nextLevel},set:function(t){e.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.bufferController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){e.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel()},set:function(e){this.levelController.level=e}},{key:"firstLevel",get:function(){return this.levelController.firstLevel},set:function(t){e.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){e.logger.log("set startLevel:"+t),this.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this.abrController.autoLevelCapping},set:function(t){e.logger.log("set autoLevelCapping:"+t),this.abrController.autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}}]),t}();s.default=l,f.exports=s.default},{"./controller/abr-controller":3,"./controller/buffer-controller":4,"./controller/level-controller":5,"./errors":11,"./events":12,"./loader/fragment-loader":15,"./loader/playlist-loader":16,"./utils/logger":19,"./utils/xhr-loader":20,events:1}],15:[function(r,s,i){"use strict";function n(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(i,"__esModule",{value:!0});var o=function(){function e(r,i){for(var t=0;t0;)switch(e.shift()){case"RES":t.width=parseInt(e.shift()),t.height=parseInt(e.shift());break;case"BAND":t.bitrate=parseInt(e.shift());break;case"NAME":t.name=e.shift();break;case"CODECS":for(r=e.shift().split(",");r.length>0;)i=r.shift(),-1!==i.indexOf("avc1")?t.videoCodec=this.avc1toavcoti(i):t.audioCodec=i}s.push(t),t={}}return s}},{key:"avc1toavcoti",value:function(i){var e,t=i.split(".");return t.length>2?(e=t.shift()+".",e+=parseInt(t.shift()).toString(16),e+=("00"+parseInt(t.shift()).toString(16)).substr(-4)):e=i,e}},{key:"parseLevelPlaylist",value:function(c,o,f){var e,d,i,s,r,l=0,u=0,t={url:o,fragments:[],live:!0,startSN:0},h=0;for(d=/(?:#EXT-X-(MEDIA-SEQUENCE):(\d+))|(?:#EXT-X-(TARGETDURATION):(\d+))|(?:#EXT(INF):([\d\.]+)[^\r\n]*([\r\n]+[^#|\r\n]+)?)|(?:#EXT-X-(BYTERANGE):([\d]+[@[\d]*)]*[\r\n]+([^#|\r\n]+)?|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))/g;null!==(e=d.exec(c));)switch(e.shift(),e=e.filter(function(e){return void 0!==e}),e[0]){case"MEDIA-SEQUENCE":l=t.startSN=parseInt(e[1]);break;case"TARGETDURATION":t.targetduration=parseFloat(e[1]);break;case"ENDLIST":t.live=!1;break;case"DIS":h++;break;case"BYTERANGE":var a=e[1].split("@");r=1===a.length?s:parseInt(a[1]),s=parseInt(a[0])+r,i=t.fragments.length?t.fragments[t.fragments.length-1]:null,i&&!i.url&&(i.byteRangeStartOffset=r,i.byteRangeEndOffset=s,i.url=this.resolve(e[2],o));break;case"INF":var n=parseFloat(e[1]);isNaN(n)||(t.fragments.push({url:e[2]?this.resolve(e[2],o):null,duration:n,start:u,sn:l++,level:f,cc:h,byteRangeStartOffset:r,byteRangeEndOffset:s}),u+=n,r=null)}return t.totalduration=u,t.endSN=l-1,t}},{key:"loadsuccess",value:function(a,r){var o,n=a.currentTarget.responseText,i=a.currentTarget.responseURL,l=this.id,u=this.id2,s=this.hls;void 0===i&&(i=this.url),r.tload=new Date,r.mtime=new Date(a.currentTarget.getResponseHeader("Last-Modified")),0===n.indexOf("#EXTM3U")?n.indexOf("#EXTINF:")>0?null===this.id?s.trigger(e.default.MANIFEST_LOADED,{levels:[{url:i}],url:i,stats:r}):s.trigger(e.default.LEVEL_LOADED,{details:this.parseLevelPlaylist(n,i,l),level:l,id:u,stats:r}):(o=this.parseMasterPlaylist(n,i),o.length?s.trigger(e.default.MANIFEST_LOADED,{levels:o,url:i,stats:r}):s.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:t.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no level found in manifest"})):s.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:t.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(s){var i,r;null===this.id?(i=t.ErrorDetails.MANIFEST_LOAD_ERROR,r=!0):(i=t.ErrorDetails.LEVEL_LOAD_ERROR,r=!1),this.loader.abort(),this.hls.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:i,fatal:r,url:this.url,loader:this.loader,response:s.currentTarget,level:this.id,id:this.id2})}},{key:"loadtimeout",value:function(){var i,r;null===this.id?(i=t.ErrorDetails.MANIFEST_LOAD_TIMEOUT,r=!0):(i=t.ErrorDetails.LEVEL_LOAD_TIMEOUT,r=!1),this.loader.abort(),this.hls.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:i,fatal:r,url:this.url,loader:this.loader,level:this.id,id:this.id2})}}]),i}(); -i.default=u,s.exports=i.default},{"../errors":11,"../events":12}],17:[function(n,t,e){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(r,i){for(var t=0;t>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,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,i,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,i))}},{key:"moov",value:function(t){for(var i=t.length,r=[];i--;)r[i]=e.trak(t[i]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))}},{key:"mvex",value:function(i){for(var t=i.length,r=[];t--;)r[t]=e.trex(i[t]);return e.box.apply(null,[e.types.mvex].concat(r))}},{key:"mvhd",value:function(t,i){var r=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,i>>24&255,i>>16&255,i>>8&255,255&i,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,r)}},{key:"sdtp",value:function(n){var i,t,r=n.samples||[],s=new Uint8Array(4+r.length);for(t=0;t>>8&255),r.push(255&t.sps[i].byteLength),r=r.concat(Array.prototype.slice.call(t.sps[i]));for(i=0;i>>8&255),s.push(255&t.pps[i].byteLength),s=s.concat(Array.prototype.slice.call(t.pps[i]));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,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e.box(e.types.avcC,new Uint8Array([1,t.profileIdc,t.profileCompat,t.levelIdc,255].concat([t.sps.length]).concat(r).concat([t.pps.length]).concat(s))),e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(e){return new Uint8Array([0,0,0,0,3,23+e.config.length,0,1,0,4,15+e.config.length,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e.config.length]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){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,t.audiosamplerate>>8&255,255&t.audiosamplerate,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t.id>>24&255,t.id>>16&255,t.id>>8&255,255&t.id,0,0,0,0,t.duration>>24,t.duration>>16&255,t.duration>>8&255,255&t.duration,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,t.width>>8&255,255&t.width,0,0,t.height>>8&255,255&t.height,0,0]))}},{key:"traf",value:function(t,i){var r=e.sdtp(t);return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t.id>>24,t.id>>16&255,t.id>>8&255,255&t.id])),e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.trun(t,r.length+16+16+8+16+8+8),r)}},{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){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t.id>>24,t.id>>16&255,t.id>>8&255,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(a,r){var i,t,s,n;for(i=a.samples||[],n=new Uint8Array(12+16*i.length),r+=8+n.byteLength,n.set([0,0,15,1,i.length>>>24&255,i.length>>>16&255,i.length>>>8&255,255&i.length,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),s=0;s>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,t.size>>>24&255,t.size>>>16&255,t.size>>>8&255,255&t.size,t.flags.isLeading<<2|t.flags.dependsOn,t.flags.isDependedOn<<6|t.flags.hasRedundancy<<4|t.flags.paddingValue<<1|t.flags.isNonSync,61440&t.flags.degradPrio,15&t.flags.degradPrio,t.cts>>>24&255,t.cts>>>16&255,t.cts>>>8&255,255&t.cts],12+16*s);return e.box(e.types.trun,n)}},{key:"initSegment",value:function(r){e.types||e.init();var t,i=e.moov(r);return t=new Uint8Array(e.FTYP.byteLength+i.byteLength),t.set(e.FTYP),t.set(i,e.FTYP.byteLength),t}}]),e}();e.default=s,t.exports=e.default},{}],18:[function(r,h,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var d=function(){function e(r,i){for(var t=0;tA)l>1?i.logger.log("AVC:"+l+" ms hole between fragments detected,filling it"):-1>l&&i.logger.log("AVC:"+-l+" ms overlapping between fragments detected"),A&&(r=this.nextAvcDts,a=Math.max(a-l,r),i.logger.log("Video/PTS/DTS adjusted:"+a+"/"+r));else{var m=h*T;if(Math.abs(m-r)>3600*h){var S=m-r;r=m,a=r,this._initPTS-=S,this._initDTS-=S}}}b=Math.max(0,a),E=Math.max(0,r)}s={size:y,duration:0,cts:(a-r)/d,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0}},u.key===!0?(s.flags.dependsOn=2,s.flags.isNonSync=0):(s.flags.dependsOn=1,s.flags.isNonSync=1),o.push(s),v=r}o.length>=2&&(s.duration=o[o.length-2].duration),this.nextAvcDts=r+s.duration*d,n.len=0,n.nbNalu=0,navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(o[0].flags.dependsOn=2,o[0].flags.isNonSync=0),n.samples=o,R=t.default.moof(n.sequenceNumber++,E/d,n),n.samples=[],this.observer.trigger(e.default.FRAG_PARSING_DATA,{moof:R,mdat:f,startPTS:b/h,endPTS:(a+d*s.duration)/h,startDTS:E/h,endDTS:(r+d*s.duration)/h,type:"video",nb:o.length})}},{key:"remuxAudio",value:function(n,S){var A,f,a,c,u,b,_,m,d,p,g,r,s,L=8,o=this.PES_TIMESCALE,v=this.PES2MP4SCALEFACTOR,l=[];for(u=new Uint8Array(n.len+8),A=new DataView(u.buffer),A.setUint32(0,u.byteLength),u.set(t.default.types.mdat,4);n.samples.length;){if(f=n.samples.shift(),c=f.unit,u.set(c,L),L+=c.byteLength,p=f.pts-this._initDTS,g=f.dts-this._initDTS,void 0!==d)r=this._PTSNormalize(p,d),s=this._PTSNormalize(g,d),a.duration=(s-d)/v,a.duration<0&&(a.duration=0);else{if(r=this._PTSNormalize(p,this.nextAacPts),s=this._PTSNormalize(g,this.nextAacPts),this.nextAacPts&&this.nextAacPts!==r){var h=Math.round(1e3*(r-this.nextAacPts)/o),E=Math.abs(h);if(E>1&&300>E)h>0?i.logger.log("AAC:"+h+" ms hole between fragments detected,filling it"):i.logger.log("AAC:"+-h+" ms overlapping between fragments detected"),r=s=this.nextAacPts,i.logger.log("Audio/PTS/DTS adjusted:"+r+"/"+s);else if(E){var y=o*S;if(Math.abs(y-r)>3600*o){var R=y-r;r=y,s=r,this._initPTS-=R,this._initDTS-=R}}}_=Math.max(0,r),m=Math.max(0,s)}a={size:c.byteLength,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},l.push(a),d=s}l.length>=2&&(a.duration=l[l.length-2].duration),this.nextAacPts=r+v*a.duration,n.len=0,n.samples=l,b=t.default.moof(n.sequenceNumber++,m/v,n),n.samples=[],this.observer.trigger(e.default.FRAG_PARSING_DATA,{moof:b,mdat:u,startPTS:_/o,endPTS:this.nextAacPts/o,startDTS:m/o,endDTS:(s+v*a.duration)/o,type:"audio",nb:l.length})}},{key:"remuxID3",value:function(i,s){var t,n=i.samples.length;if(n){for(var r=0;n>r;r++)t=i.samples[r],t.pts=(t.pts-this._initPTS)/this.PES_TIMESCALE,t.dts=(t.dts-this._initDTS)/this.PES_TIMESCALE;this.observer.trigger(e.default.FRAG_PARSING_METADATA,{samples:i.samples})}i.samples=[],s=s}},{key:"_PTSNormalize",value:function(e,t){var i;if(void 0===t)return e;for(i=e>t?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=i;return e}},{key:"timescale",get:function(){return this.MP4_TIMESCALE}}]),r}();s.default=o,h.exports=s.default},{"../errors":11,"../events":12,"../remux/mp4-generator":17,"../utils/logger":19}],19:[function(a,o,i){"use strict";function t(){}Object.defineProperty(i,"__esModule",{value:!0});var r={log:t,warn:t,info:t,error:t},e=r,s=function(i){if(i===!0||"object"==typeof i){e.log=i.log?i.log.bind(i):void 0,e.info=i.info?i.info.bind(i):void 0,e.error=i.error?i.error.bind(i):void 0,e.warn=i.warn?i.warn.bind(i):void 0;try{e.log()}catch(i){e.log=t,e.info=t,e.error=t,e.warn=t}}else e=r};i.enableLogs=s;var n=e;i.logger=n},{}],20:[function(i,r,e){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(r,i){for(var t=0;te||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},e.prototype.emit=function(u){var o,s,a,n,e,l;if(this._events||(this._events={}),"error"===u&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if(o=arguments[1],o instanceof Error)throw o;throw TypeError('Uncaught, unspecified "error" event.')}if(s=this._events[u],i(s))return!1;if(t(s))switch(arguments.length){case 1:s.call(this);break;case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:for(a=arguments.length,n=new Array(a-1),e=1;a>e;e++)n[e-1]=arguments[e];s.apply(this,n)}else if(r(s)){for(a=arguments.length,n=new Array(a-1),e=1;a>e;e++)n[e-1]=arguments[e];for(l=s.slice(),a=l.length,e=0;a>e;e++)l[e].apply(this,n)}return!0},e.prototype.addListener=function(s,a){var n;if(!t(a))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",s,t(a.listener)?a.listener:a),this._events[s]?r(this._events[s])?this._events[s].push(a):this._events[s]=[this._events[s],a]:this._events[s]=a,r(this._events[s])&&!this._events[s].warned){var n;n=i(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[s].length>n&&(this._events[s].warned=!0,"function"==typeof console.trace)}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(i,e){function r(){this.removeListener(i,r),s||(s=!0,e.apply(this,arguments))}if(!t(e))throw TypeError("listener must be a function");var s=!1;return r.listener=e,this.on(i,r),this},e.prototype.removeListener=function(s,i){var e,n,o,a;if(!t(i))throw TypeError("listener must be a function");if(!this._events||!this._events[s])return this;if(e=this._events[s],o=e.length,n=-1,e===i||t(e.listener)&&e.listener===i)delete this._events[s],this._events.removeListener&&this.emit("removeListener",s,i);else if(r(e)){for(a=o;a-->0;)if(e[a]===i||e[a].listener&&e[a].listener===i){n=a;break}if(0>n)return this;1===e.length?(e.length=0,delete this._events[s]):e.splice(n,1),this._events.removeListener&&this.emit("removeListener",s,i)}return this},e.prototype.removeAllListeners=function(e){var i,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(i in this._events)"removeListener"!==i&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],t(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},e.prototype.listeners=function(e){var r;return r=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e.listenerCount=function(e,r){var i;return i=e._events&&e._events[r]?t(e._events[r])?1:e._events[r].length:0}},{}],2:[function(a,i,n){var s=arguments[3],e=arguments[4],r=arguments[5],t=JSON.stringify;i.exports=function(u){for(var i,o=Object.keys(r),a=0,l=o.length;l>a;a++){var n=o[a];if(r[n].exports===u){i=n;break}}if(!i){i=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},a=0,l=o.length;l>a;a++){var n=o[a];d[n]=n}e[i]=[Function(["require","module","exports"],"("+u+")(self)"),d]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),f={};f[i]=i,e[h]=[Function(["require"],"require("+t(i)+")(self)"),f];var c="("+s+")({"+Object.keys(e).map(function(r){return t(r)+":["+e[r][0]+","+t(e[r][1])+"]"}).join(",")+"},{},["+t(h)+"])",v=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(v.createObjectURL(new Blob([c],{type:"text/javascript"})))}},{}],3:[function(r,i,e){"use strict";function s(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(e,"__esModule",{value:!0});var n=function(){function e(i,r){for(var t=0;t=e;e++)if(r=e<=this.lastfetchlevel?.8*i:.7*i,rw){if(o.nextLoadLevel=l,this.level=l,n=this.levels[l].details,"undefined"==typeof n){this.state=e.WAITING_LEVEL;break}var u=n.fragments,v=u.length,h=u[0].start,S=u[v-1].start+u[v-1].duration,s=void 0;if(n.live){if(d=n.startSN&&m<=n.endSN&&(s=u[m-n.startSN],t.logger.log("live playlist, switching playlist, load frag with next SN: "+s.sn))}s||(s=u[Math.round(v/2)],t.logger.log("live playlist, switching playlist, unknown, load middle frag : "+s.sn))}}else h>d&&(s=u[0]);if(!s){if(d>S)break;for(f=0;v>f&&(s=u[f],h=s.start,!(d>=h&&h+s.duration>d));f++);if(this.fragPrevious&&s.level===this.fragPrevious.level&&s.sn===this.fragPrevious.sn){if(f===v-1)break;s=u[f+1],t.logger.log("SN just loaded, load next one: "+s.sn)}}if(t.logger.log("Loading "+s.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+l+", currentTime:"+c+",bufferEnd:"+d.toFixed(3)),s.autoLevel=o.autoLevelEnabled,this.levels.length>1&&(s.expectedLen=Math.round(s.duration*this.levels[l].bitrate/8),s.trequest=new Date),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,s.loadCounter){s.loadCounter++;var R=this.config.fragLoadingLoopThreshold;if(s.loadCounter>R&&Math.abs(this.fragLoadIdx-s.loadIdx)1){var D=new Date-a.trequest;if(D>500*a.duration){var A=1e3*a.loaded/D;a.expectedLen_&&E>T&&(t.logger.warn("loading too slow, abort fragment loading"),t.logger.log("fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :"+E.toFixed(1)+"/"+_.toFixed(1)+"/"+T.toFixed(1)),a.loader.abort(),o.trigger(r.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a}),this.state=e.IDLE)}}break;case e.PARSING:break;case e.PARSED:case e.APPENDING:if(this.sourceBuffer){if(this.sourceBuffer.audio&&this.sourceBuffer.audio.updating||this.sourceBuffer.video&&this.sourceBuffer.video.updating);else if(this.mp4segments.length){var L=this.mp4segments.shift();try{this.sourceBuffer[L.type].appendBuffer(L.data),this.appendError=0}catch(s){t.logger.error("error while trying to append buffer:"+s.message+",try appending later"),this.mp4segments.unshift(L),this.appendError?this.appendError++:this.appendError=1;var p={type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_APPENDING_ERROR,frag:this.fragCurrent};if(this.appendError>this.config.appendErrorMaxRetry)return t.logger.log("fail "+this.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),p.fatal=!0,o.trigger(r.default.ERROR,p),void(this.state=e.ERROR);p.fatal=!1,o.trigger(r.default.ERROR,p)}this.state=e.APPENDING}}else this.state=e.IDLE;break;case e.BUFFER_FLUSHING:for(;this.flushRange.length;){var b=this.flushRange[0];if(!this.flushBuffer(b.start,b.end))break;this.flushRange.shift()}0===this.flushRange.length&&(this.immediateSwitch&&this.immediateLevelSwitchEnd(),this.state=e.IDLE,this.fragPrevious=null)}this._checkFragmentChanged()}},{key:"bufferInfo",value:function(r,a){var l,o,s,u,e,h=this.video,i=h.buffered,t=[];for(e=0;e=n&&d>r?(o=n,s=d+a,l=s-r):n>r+a&&(u=n)}return{len:l,start:o,end:s,nextStart:u}}},{key:"getBufferRange",value:function(r){var e,t;for(e=this.bufferRange.length-1;e>=0;e--)if(t=this.bufferRange[e],r>=t.start&&r<=t.end)return t;return null}},{key:"followingBufferRange",value:function(e){return e?this.getBufferRange(e.end+.5):null}},{key:"isBuffered",value:function(r){for(var i=this.video,t=i.buffered,e=0;e=t.start(e)&&r<=t.end(e))return!0;return!1}},{key:"_checkFragmentChanged",value:function(){var i,e,s=this.video;if(s&&s.seeking===!1&&(e=s.currentTime,e>s.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),this.isBuffered(e)?i=this.getBufferRange(e):this.isBuffered(e+.1)&&(i=this.getBufferRange(e+.1)),i)){var a=i.frag;a!==this.fragPlaying&&(this.fragPlaying=a,this.hls.trigger(r.default.FRAG_CHANGED,{frag:a}));var n=this.levels[this.level].details;if(n&&!n.live&&a.sn===n.endSN){var o=this.mediaSource;o&&"open"===o.readyState&&(t.logger.log("all media data available, signal endOfStream() to MediaSource"),o.endOfStream())}}}},{key:"flushBuffer",value:function(d,l){var r,e,o,n,i,s;if(this.flushBufferCounter++<2*this.bufferRange.length&&this.sourceBuffer)for(var u in this.sourceBuffer){if(r=this.sourceBuffer[u],r.updating)return!1;for(e=0;e.5)return t.logger.log("flush "+u+" ["+i+","+s+"], of ["+o+","+n+"], pos:"+this.video.currentTime),r.remove(i,s),!1}var a,h=[];for(e=0;ea-o&&(t.logger.log("adjust currentTime from "+o+" to "+a),s.currentTime=a)}}this.seekAfterBuffered=void 0}this.tick()}},{key:"onSBUpdateError",value:function(s){t.logger.error("sourceBuffer error:"+s),this.state=e.ERROR,this.hls.trigger(r.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_APPENDING_ERROR,fatal:!0,frag:this.fragCurrent})}},{key:"timeRangesToString",value:function(t){for(var r="",i=t.length,e=0;i>e;e++)r+="["+t.start(e)+","+t.end(e)+"]";return r}},{key:"currentLevel",get:function(){if(this.video){var e=this.getBufferRange(this.video.currentTime);if(e)return e.frag.level}return-1}},{key:"nextBufferRange",get:function(){return this.video?this.followingBufferRange(this.getBufferRange(this.video.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferRange;return e?e.frag.level:-1}}]),s}();n.default=g,v.exports=n.default},{"../demux/demuxer":8,"../errors":11,"../events":12,"../helper/level-helper":13,"../utils/logger":19}],5:[function(i,a,s){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var d=function(){function e(i,r){for(var t=0;t=0&&i1?r-1:0),e=1;r>e;e++)s[e-1]=arguments[e];t.emit.apply(t,[i,i].concat(s))},t.off=function(s){for(var r=arguments.length,i=Array(r>1?r-1:0),e=1;r>e;e++)i[e-1]=arguments[e];t.removeListener.apply(t,[s].concat(i))},r.addEventListener("message",function(e){switch(e.data.cmd){case"init":r.demuxer=new a.default(t,h.default);break;case"demux":r.demuxer.push(new Uint8Array(e.data.data),e.data.audioCodec,e.data.videoCodec,e.data.timeOffset,e.data.cc,e.data.level,e.data.duration),r.demuxer.remux()}}),t.on(e.default.FRAG_PARSING_INIT_SEGMENT,function(s,t){var e={event:s},i=[];t.audioCodec&&(e.audioCodec=t.audioCodec,e.audioMoov=t.audioMoov.buffer, +e.audioChannelCount=t.audioChannelCount,i.push(e.audioMoov)),t.videoCodec&&(e.videoCodec=t.videoCodec,e.videoMoov=t.videoMoov.buffer,e.videoWidth=t.videoWidth,e.videoHeight=t.videoHeight,i.push(e.videoMoov)),r.postMessage(e,i)}),t.on(e.default.FRAG_PARSING_DATA,function(i,e){var t={event:i,type:e.type,startPTS:e.startPTS,endPTS:e.endPTS,startDTS:e.startDTS,endDTS:e.endDTS,moof:e.moof.buffer,mdat:e.mdat.buffer,nb:e.nb};r.postMessage(t,[t.moof,t.mdat])}),t.on(e.default.FRAG_PARSED,function(e){r.postMessage({event:e})}),t.on(e.default.ERROR,function(e,t){r.postMessage({event:e,data:t})}),t.on(e.default.FRAG_PARSING_METADATA,function(e,t){var i={event:e,samples:t.samples};r.postMessage(i)})};i.default=o,n.exports=i.default},{"../demux/demuxer-inline":6,"../events":12,"../remux/mp4-remuxer":18,events:1}],8:[function(e,l,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var f=function(){function e(i,r){for(var t=0;te?(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(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0?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:"skipScalingList",value:function(s){var t,i,r=8,e=8;for(t=0;s>t;t++)0!==e&&(i=this.readEG(),e=(r+i+256)%256),r=0===e?r:e}},{key:"readSPS",value:function(){var t,o,l,i,s,a,r,v,e,u=0,d=0,h=0,f=0;if(this.readUByte(),t=this.readUByte(),o=this.readBits(5),this.skipBits(3),l=this.readUByte(),this.skipUEG(),100===t||110===t||122===t||144===t){var c=this.readUEG();if(3===c&&this.skipBits(1),this.skipUEG(),this.skipUEG(),this.skipBits(1),this.readBoolean())for(v=3!==c?8:12,e=0;v>e;e++)this.readBoolean()&&(6>e?this.skipScalingList(16):this.skipScalingList(64))}this.skipUEG();var n=this.readUEG();if(0===n)this.readUEG();else if(1===n)for(this.skipBits(1),this.skipEG(),this.skipEG(),i=this.readUEG(),e=0;i>e;e++)this.skipEG();return this.skipUEG(),this.skipBits(1),s=this.readUEG(),a=this.readUEG(),r=this.readBits(1),0===r&&this.skipBits(1),this.skipBits(1),this.readBoolean()&&(u=this.readUEG(),d=this.readUEG(),h=this.readUEG(),f=this.readUEG()),{profileIdc:t,profileCompat:o,levelIdc:l,width:16*(s+1)-2*u-2*d,height:(2-r)*(a+1)*16-2*h-2*f}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();e.default=n,r.exports=e.default},{"../utils/logger":19}],10:[function(r,n,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var h=function(){function e(i,r){for(var t=0;tr;r+=188)if(71===i[r]){if(d=!!(64&i[r+1]),u=((31&i[r+1])<<8)+i[r+2],p=(48&i[r+3])>>4,p>1){if(a=r+5+i[r+4],a===r+188)continue}else a=r+4;m?u===c?(d&&(n&&this._parseAVCPES(this._parsePES(n)),n={data:[],size:0}),n&&(n.data.push(i.subarray(a,r+188)),n.size+=r+188-a)):u===f?(d&&(o&&this._parseAACPES(this._parsePES(o)),o={data:[],size:0}),o&&(o.data.push(i.subarray(a,r+188)),o.size+=r+188-a)):u===g&&(d&&(l&&this._parseID3PES(this._parsePES(l)),l={data:[],size:0}),l&&(l.data.push(i.subarray(a,r+188)),l.size+=r+188-a)):(d&&(a+=i[a]+1),0===u?this._parsePAT(i,a):u===this._pmtId&&(this._parsePMT(i,a),m=this.pmtParsed=!0,c=this._avcTrack.id,f=this._aacTrack.id,g=this._id3Track.id))}else this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});n&&this._parseAVCPES(this._parsePES(n)),o&&this._parseAACPES(this._parsePES(o)),l&&this._parseID3PES(this._parsePES(l))}},{key:"remux",value:function(){this.remuxer.remux(this._aacTrack,this._avcTrack,this._id3Track,this.timeOffset)}},{key:"destroy",value:function(){this.switchLevel(),this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){this._pmtId=(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(r,e){var s,a,n,i;for(s=(15&r[e+1])<<8|r[e+2],a=e+3+s-4,n=(15&r[e+10])<<8|r[e+11],e+=12+n;a>e;){switch(i=(31&r[e+1])<<8|r[e+2],r[e]){case 15:this._aacTrack.id=i;break;case 21:this._id3Track.id=i;break;case 27:this._avcTrack.id=i;break;default:t.logger.log("unkown stream type:"+r[e])}e+=((15&r[e+3])<<8|r[e+4])+5}}},{key:"_parsePES",value:function(t){var e,s,u,o,d,a,r,i,n,l=0;if(e=t.data[0],u=(e[0]<<16)+(e[1]<<8)+e[2],1===u){for(o=(e[4]<<8)+e[5],s=e[7],192&s&&(r=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,r>4294967295&&(r-=8589934592),64&s?(i=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,i>4294967295&&(i-=8589934592)):i=r),d=e[8],n=d+9,t.data[0]=t.data[0].subarray(n),t.size-=n,a=new Uint8Array(t.size);t.data.length;)e=t.data.shift(),a.set(e,l),l+=e.byteLength;return{data:a,pts:r,dts:i,len:o}}return null}},{key:"_parseAVCPES",value:function(t){var r,l,s=this,e=this._avcTrack,a=!1;if(r=this._parseAVCNALu(t.data),0===r.length&this._avcTrack.samples.length>0){var n=this._avcTrack.samples[this._avcTrack.samples.length-1],i=n.units.units[n.units.units.length-1],o=new Uint8Array(i.data.byteLength+t.data.byteLength);o.set(i.data,0),o.set(t.data,i.data.byteLength),i.data=o,n.units.length+=t.data.byteLength,this._avcTrack.len+=t.data.byteLength}t.data=null,r.units.forEach(function(t){switch(t.type){case 5:a=!0;break;case 7:if(!e.sps){var l=new u.default(t.data),r=l.readSPS();e.width=r.width,e.height=r.height,e.profileIdc=r.profileIdc,e.profileCompat=r.profileCompat,e.levelIdc=r.levelIdc,e.sps=[t.data],e.timescale=s.remuxer.timescale,e.duration=s.remuxer.timescale*s._duration;for(var d=t.data.subarray(1,4),o="avc1.",n=0;3>n;n++){var i=d[n].toString(16);i.length<2&&(i="0"+i),o+=i}e.codec=o}break;case 8:e.pps||(e.pps=[t.data])}}),r.length&&(a===!0||e.sps)&&(l={units:r,pts:t.pts,dts:t.dts,key:a},this._avcTrack.samples.push(l),this._avcTrack.len+=r.length,this._avcTrack.nbNalu+=r.units.length)}},{key:"_parseAVCNALu",value:function(i){for(var a,s,l,n,r,d,t=0,o=i.byteLength,e=0,h=[],f=0;o>t;)switch(a=i[t++],e){case 0:0===a&&(e=1);break;case 1:e=0===a?2:0;break;case 2:case 3:if(0===a)e=3;else if(1===a){if(n=31&i[t],r)l={data:i.subarray(r,t-e-1),type:d},f+=t-e-1-r,h.push(l);else if(s=t-e-1,s&&this._avcTrack.samples.length){var c=this._avcTrack.samples[this._avcTrack.samples.length-1],u=c.units.units[c.units.units.length-1],v=new Uint8Array(u.data.byteLength+s);v.set(u.data,0),v.set(i.subarray(0,s),u.data.byteLength),u.data=v,c.units.length+=s,this._avcTrack.len+=s}r=t,d=n,(1===n||5===n)&&(t=o),e=0}else e=0}return r&&(l={data:i.subarray(r,o),type:d},f+=o-r,h.push(l)),{units:h,length:f}}},{key:"_parseAACPES",value:function(p){var g,o,n,r,u,f,h,l,a=this._aacTrack,i=p.data;if(this.aacOverFlow){var v=new Uint8Array(this.aacOverFlow.byteLength+i.byteLength);v.set(this.aacOverFlow,0),v.set(i,this.aacOverFlow.byteLength),i=v}for(r=0,l=i.length;l-1>r&&(255!==i[r]||240!==(240&i[r+1]));r++);if(r){var c,d;if(l-1>r?(c="AAC PES did not start with ADTS header,offset:"+r,d=!1):(c="no ADTS header found in AAC PES",d=!0),this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:d,reason:c}),d)return}for(a.audiosamplerate||(o=this._ADTStoAudioConfig(i,r,this.audioCodec),a.config=o.config,a.audiosamplerate=o.samplerate,a.channelCount=o.channelCount,a.codec=o.codec,a.timescale=this.remuxer.timescale,a.duration=this.remuxer.timescale*this._duration,t.logger.log("parsed codec:"+a.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)),h=0;l>r+5&&(n=(3&i[r+3])<<11,n|=i[r+4]<<3,n|=(224&i[r+5])>>>5,u=1&i[r+1]?7:9,n-=u,f=Math.round(p.pts+1024*h*this.PES_TIMESCALE/a.audiosamplerate),l>=r+u+n);)g={unit:i.subarray(r+u,r+u+n),pts:f,dts:f},this._aacTrack.samples.push(g),this._aacTrack.len+=n,r+=n+u,h++;l>r?this.aacOverFlow=i.subarray(r,l):this.aacOverFlow=null}},{key:"_ADTStoAudioConfig",value:function(u,d,o){var a,r,n,l,i,f=navigator.userAgent.toLowerCase(),h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return a=((192&u[d+2])>>>6)+1,r=(60&u[d+2])>>>2,r>h.length-1?void this.observer.trigger(s.default.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+r}):(l=(1&u[d+2])<<2,l|=(192&u[d+3])>>>6,t.logger.log("manifest codec:"+o+",ADTS data:type:"+a+",sampleingIndex:"+r+"["+h[r]+"kHz],channelConfig:"+l),-1!==f.indexOf("firefox")?r>=6?(a=5,i=new Array(4),n=r-3):(a=2,i=new Array(2),n=r):-1!==f.indexOf("android")?(a=2,i=new Array(2),n=r):(a=5,i=new Array(4),o&&-1!==o.indexOf("mp4a.40.5")||!o&&r>=6?n=r-3:(o&&-1!==o.indexOf("mp4a.40.2")&&(r>=6||1===l)&&(a=2,i=new Array(2)),n=r)),i[0]=a<<3,i[0]|=(14&r)>>1,i[1]|=(1&r)<<7,i[1]|=l<<3,5===a&&(i[1]|=(14&n)>>1,i[2]=(1&n)<<7,i[2]|=8,i[3]=0),{config:i,samplerate:h[r],channelCount:l,codec:"mp4a.40."+a})}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]?!0:!1}}]),r}();i.default=o,n.exports=i.default},{"../errors":11,"../events":12,"../utils/logger":19,"./exp-golomb":9}],11:[function(i,s,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t={NETWORK_ERROR:"hlsNetworkError",MEDIA_ERROR:"hlsMediaError",OTHER_ERROR:"hlsOtherError"};e.ErrorTypes=t;var r={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_PARSING_ERROR:"fragParsingError",FRAG_APPENDING_ERROR:"fragAppendingError"};e.ErrorDetails=r},{}],12:[function(r,t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={MSE_ATTACHED:"hlsMediaSourceAttached",MSE_DETACHING:"hlsMediaSourceDetaching",MSE_DETACHED:"hlsMediaSourceDetached",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsPTSUpdated",LEVEL_SWITCH:"hlsLevelSwitch",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_METADATA:"hlsFraParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFPSDrop",ERROR:"hlsError",DESTROYING:"hlsDestroying"},t.exports=e.default},{}],13:[function(r,i,e){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;td)return void(i.PTSKnown=!1);for(var r=c;d>=r;r++){var l=f[h+r],s=o[r];u=l.cc-s.cc,isNaN(l.startPTS)||(s.start=s.startPTS=l.startPTS,s.endPTS=l.endPTS,s.duration=l.duration,n=s)}if(u)for(t.logger.log("discontinuity sliding from playlist, take drift into account"),r=0;ri.endSN)return 0;o=l-i.startSN,a=i.fragments,r=a[o],isNaN(r.startPTS)||(s=Math.max(s,r.startPTS),n=Math.min(n,r.endPTS));var u=s-r.start;for(r.start=r.startPTS=s,r.endPTS=n,r.duration=n-s,t=o;t>0;t--)e.updatePTS(a,t,t-1);for(t=o;ti?r.start=e.start+e.duration:r.start=e.start-r.duration:s>i?(e.duration=a-e.start,e.duration<0&&t.logger.error("negative duration computed for "+e+", there should be some duration drift between playlist and fragment!")):(r.duration=e.start-a,r.duration<0&&t.logger.error("negative duration computed for "+r+", there should be some duration drift between playlist and fragment!"))}}]),e}();e.default=n,i.exports=e.default},{"../utils/logger":19}],14:[function(t,f,s){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;t1?t-1:0),e=1;t>e;e++)s[e-1]=arguments[e];r.emit.apply(r,[i,i].concat(s))},r.off=function(s){for(var t=arguments.length,i=Array(t>1?t-1:0),e=1;t>e;e++)i[e-1]=arguments[e];r.removeListener.apply(r,[s].concat(i))},this.on=r.on.bind(r),this.off=r.off.bind(r),this.trigger=r.trigger.bind(r),this.playlistLoader=new d.default(this),this.fragmentLoader=new R.default(this),this.levelController=new y.default(this),this.abrController=new i.abrController(this),this.bufferController=new p.default(this)}return a(t,null,[{key:"isSupported",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"Events",get:function(){return i.default}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}}]),a(t,[{key:"destroy",value:function(){e.logger.log("destroy"),this.trigger(i.default.DESTROYING),this.playlistLoader.destroy(),this.fragmentLoader.destroy(),this.levelController.destroy(),this.bufferController.destroy(),this.url=null,this.detachVideo(),this.observer.removeAllListeners()}},{key:"attachVideo",value:function(r){e.logger.log("attachVideo"),this.video=r;var t=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),t.addEventListener("sourceopen",this.onmso),t.addEventListener("sourceended",this.onmse),t.addEventListener("sourceclose",this.onmsc),r.src=URL.createObjectURL(t)}},{key:"detachVideo",value:function(){e.logger.log("detachVideo");var r=this.video;e.logger.log("trigger MSE_DETACHING"),this.trigger(i.default.MSE_DETACHING);var t=this.mediaSource;t&&("open"===t.readyState&&t.endOfStream(),t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),r.src="",this.mediaSource=null,e.logger.log("trigger MSE_DETACHED"),this.trigger(i.default.MSE_DETACHED)),this.onmso=this.onmse=this.onmsc=null,r&&(this.video=null)}},{key:"loadSource",value:function(t){e.logger.log("loadSource:"+t),this.url=t,this.trigger(i.default.MANIFEST_LOADING,{url:t})}},{key:"startLoad",value:function(){e.logger.log("startLoad"),this.bufferController.startLoad()}},{key:"recoverMediaError",value:function(){e.logger.log("recoverMediaError");var t=this.video;this.detachVideo(),this.attachVideo(t)}},{key:"onMediaSourceOpen",value:function(){e.logger.log("media source opened"),this.trigger(i.default.MSE_ATTACHED,{video:this.video,mediaSource:this.mediaSource}),this.mediaSource.removeEventListener("sourceopen",this.onmso)}},{key:"onMediaSourceClose",value:function(){e.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){e.logger.log("media source ended")}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.bufferController.currentLevel},set:function(t){e.logger.log("set currentLevel:"+t),this.loadLevel=t,this.bufferController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.bufferController.nextLevel},set:function(t){e.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.bufferController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){e.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel()},set:function(e){this.levelController.level=e}},{key:"firstLevel",get:function(){return this.levelController.firstLevel},set:function(t){e.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){e.logger.log("set startLevel:"+t),this.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this.abrController.autoLevelCapping},set:function(t){e.logger.log("set autoLevelCapping:"+t),this.abrController.autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}}]),t}();s.default=l,f.exports=s.default},{"./controller/abr-controller":3,"./controller/buffer-controller":4,"./controller/level-controller":5,"./errors":11,"./events":12,"./loader/fragment-loader":15,"./loader/playlist-loader":16,"./utils/logger":19,"./utils/xhr-loader":20,events:1}],15:[function(i,s,r){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(i,r){for(var t=0;t0;)switch(e.shift()){case"RES":t.width=parseInt(e.shift()),t.height=parseInt(e.shift());break;case"BAND":t.bitrate=parseInt(e.shift());break;case"NAME":t.name=e.shift();break;case"CODECS":for(i=e.shift().split(",");i.length>0;)r=i.shift(),-1!==r.indexOf("avc1")?t.videoCodec=this.avc1toavcoti(r):t.audioCodec=r}s.push(t),t={}}return s}},{key:"avc1toavcoti",value:function(r){var e,t=r.split(".");return t.length>2?(e=t.shift()+".",e+=parseInt(t.shift()).toString(16),e+=("00"+parseInt(t.shift()).toString(16)).substr(-4)):e=r,e}},{key:"parseLevelPlaylist",value:function(c,o,f){var e,d,r,s,i,l=0,u=0,t={url:o,fragments:[],live:!0,startSN:0},h=0;for(d=/(?:#EXT-X-(MEDIA-SEQUENCE):(\d+))|(?:#EXT-X-(TARGETDURATION):(\d+))|(?:#EXT(INF):([\d\.]+)[^\r\n]*([\r\n]+[^#|\r\n]+)?)|(?:#EXT-X-(BYTERANGE):([\d]+[@[\d]*)]*[\r\n]+([^#|\r\n]+)?|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))/g;null!==(e=d.exec(c));)switch(e.shift(),e=e.filter(function(e){return void 0!==e}),e[0]){case"MEDIA-SEQUENCE":l=t.startSN=parseInt(e[1]);break;case"TARGETDURATION":t.targetduration=parseFloat(e[1]);break;case"ENDLIST":t.live=!1;break;case"DIS":h++;break;case"BYTERANGE":var n=e[1].split("@");i=1===n.length?s:parseInt(n[1]),s=parseInt(n[0])+i,r=t.fragments.length?t.fragments[t.fragments.length-1]:null,r&&!r.url&&(r.byteRangeStartOffset=i,r.byteRangeEndOffset=s,r.url=this.resolve(e[2],o));break;case"INF":var a=parseFloat(e[1]);isNaN(a)||(t.fragments.push({url:e[2]?this.resolve(e[2],o):null,duration:a,start:u,sn:l++,level:f,cc:h,byteRangeStartOffset:i,byteRangeEndOffset:s}),u+=a,i=null)}return t.totalduration=u,t.endSN=l-1,t}},{key:"loadsuccess",value:function(n,i){var o,a=n.currentTarget.responseText,r=n.currentTarget.responseURL,l=this.id,u=this.id2,s=this.hls;void 0===r&&(r=this.url),i.tload=new Date,i.mtime=new Date(n.currentTarget.getResponseHeader("Last-Modified")),0===a.indexOf("#EXTM3U")?a.indexOf("#EXTINF:")>0?null===this.id?s.trigger(e.default.MANIFEST_LOADED,{levels:[{url:r}],url:r,stats:i}):s.trigger(e.default.LEVEL_LOADED,{details:this.parseLevelPlaylist(a,r,l),level:l,id:u,stats:i}):(o=this.parseMasterPlaylist(a,r),o.length?s.trigger(e.default.MANIFEST_LOADED,{levels:o,url:r,stats:i}):s.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:t.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:r,reason:"no level found in manifest"})):s.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:t.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:r,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(s){var r,i;null===this.id?(r=t.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0):(r=t.ErrorDetails.LEVEL_LOAD_ERROR,i=!1),this.loader.abort(),this.hls.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:this.url,loader:this.loader,response:s.currentTarget,level:this.id,id:this.id2})}},{key:"loadtimeout",value:function(){var r,i;null===this.id?(r=t.ErrorDetails.MANIFEST_LOAD_TIMEOUT,i=!0):(r=t.ErrorDetails.LEVEL_LOAD_TIMEOUT,i=!1),this.loader.abort(),this.hls.trigger(e.default.ERROR,{type:t.ErrorTypes.NETWORK_ERROR,details:r,fatal:i,url:this.url,loader:this.loader,level:this.id,id:this.id2})}}]),r}();r.default=u,s.exports=r.default},{"../errors":11,"../events":12}],17:[function(a,t,e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{ +value:!0});var i=function(){function e(i,r){for(var t=0;t>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(r){for(var t=r.length,i=[];t--;)i[t]=e.trex(r[t]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){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(a){var r,t,i=a.samples||[],s=new Uint8Array(4+i.length);for(t=0;t>>8&255),i.push(255&t.sps[r].byteLength),i=i.concat(Array.prototype.slice.call(t.sps[r]));for(r=0;r>>8&255),s.push(255&t.pps[r].byteLength),s=s.concat(Array.prototype.slice.call(t.pps[r]));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,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e.box(e.types.avcC,new Uint8Array([1,t.profileIdc,t.profileCompat,t.levelIdc,255].concat([t.sps.length]).concat(i).concat([t.pps.length]).concat(s))),e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(e){return new Uint8Array([0,0,0,0,3,23+e.config.length,0,1,0,4,15+e.config.length,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e.config.length]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){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,t.audiosamplerate>>8&255,255&t.audiosamplerate,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t.id>>24&255,t.id>>16&255,t.id>>8&255,255&t.id,0,0,0,0,t.duration>>24,t.duration>>16&255,t.duration>>8&255,255&t.duration,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,t.width>>8&255,255&t.width,0,0,t.height>>8&255,255&t.height,0,0]))}},{key:"traf",value:function(t,r){var i=e.sdtp(t);return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t.id>>24,t.id>>16&255,t.id>>8&255,255&t.id])),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){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t.id>>24,t.id>>16&255,t.id>>8&255,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(n,i){var r,t,s,a;for(r=n.samples||[],a=new Uint8Array(12+16*r.length),i+=8+a.byteLength,a.set([0,0,15,1,r.length>>>24&255,r.length>>>16&255,r.length>>>8&255,255&r.length,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),s=0;s>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,t.size>>>24&255,t.size>>>16&255,t.size>>>8&255,255&t.size,t.flags.isLeading<<2|t.flags.dependsOn,t.flags.isDependedOn<<6|t.flags.hasRedundancy<<4|t.flags.paddingValue<<1|t.flags.isNonSync,61440&t.flags.degradPrio,15&t.flags.degradPrio,t.cts>>>24&255,t.cts>>>16&255,t.cts>>>8&255,255&t.cts],12+16*s);return e.box(e.types.trun,a)}},{key:"initSegment",value:function(i){e.types||e.init();var t,r=e.moov(i);return t=new Uint8Array(e.FTYP.byteLength+r.byteLength),t.set(e.FTYP),t.set(r,e.FTYP.byteLength),t}}]),e}();e.default=s,t.exports=e.default},{}],18:[function(i,h,s){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var d=function(){function e(i,r){for(var t=0;tA)l>1?r.logger.log("AVC:"+l+" ms hole between fragments detected,filling it"):-1>l&&r.logger.log("AVC:"+-l+" ms overlapping between fragments detected"),A&&(i=this.nextAvcDts,n=Math.max(n-l,i),r.logger.log("Video/PTS/DTS adjusted:"+n+"/"+i));else{var m=h*T;if(Math.abs(m-i)>3600*h){var S=m-i;i=m,n=i,this._initPTS-=S,this._initDTS-=S}}}b=Math.max(0,n),E=Math.max(0,i)}s={size:y,duration:0,cts:(n-i)/d,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0}},u.key===!0?(s.flags.dependsOn=2,s.flags.isNonSync=0):(s.flags.dependsOn=1,s.flags.isNonSync=1),o.push(s),v=i}o.length>=2&&(s.duration=o[o.length-2].duration),this.nextAvcDts=i+s.duration*d,a.len=0,a.nbNalu=0,navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(o[0].flags.dependsOn=2,o[0].flags.isNonSync=0),a.samples=o,R=t.default.moof(a.sequenceNumber++,E/d,a),a.samples=[],this.observer.trigger(e.default.FRAG_PARSING_DATA,{moof:R,mdat:f,startPTS:b/h,endPTS:(n+d*s.duration)/h,startDTS:E/h,endDTS:(i+d*s.duration)/h,type:"video",nb:o.length})}},{key:"remuxAudio",value:function(a,S){var A,f,n,c,u,b,L,m,d,p,g,i,s,_=8,o=this.PES_TIMESCALE,v=this.PES2MP4SCALEFACTOR,l=[];for(u=new Uint8Array(a.len+8),A=new DataView(u.buffer),A.setUint32(0,u.byteLength),u.set(t.default.types.mdat,4);a.samples.length;){if(f=a.samples.shift(),c=f.unit,u.set(c,_),_+=c.byteLength,p=f.pts-this._initDTS,g=f.dts-this._initDTS,void 0!==d)i=this._PTSNormalize(p,d),s=this._PTSNormalize(g,d),n.duration=(s-d)/v,n.duration<0&&(n.duration=0);else{if(i=this._PTSNormalize(p,this.nextAacPts),s=this._PTSNormalize(g,this.nextAacPts),this.nextAacPts&&this.nextAacPts!==i){var h=Math.round(1e3*(i-this.nextAacPts)/o),E=Math.abs(h);if(E>1&&300>E)h>0?r.logger.log("AAC:"+h+" ms hole between fragments detected,filling it"):r.logger.log("AAC:"+-h+" ms overlapping between fragments detected"),i=s=this.nextAacPts,r.logger.log("Audio/PTS/DTS adjusted:"+i+"/"+s);else if(E){var y=o*S;if(Math.abs(y-i)>3600*o){var R=y-i;i=y,s=i,this._initPTS-=R,this._initDTS-=R}}}L=Math.max(0,i),m=Math.max(0,s)}n={size:c.byteLength,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},l.push(n),d=s}l.length>=2&&(n.duration=l[l.length-2].duration),this.nextAacPts=i+v*n.duration,a.len=0,a.samples=l,b=t.default.moof(a.sequenceNumber++,m/v,a),a.samples=[],this.observer.trigger(e.default.FRAG_PARSING_DATA,{moof:b,mdat:u,startPTS:L/o,endPTS:this.nextAacPts/o,startDTS:m/o,endDTS:(s+v*n.duration)/o,type:"audio",nb:l.length})}},{key:"remuxID3",value:function(r,s){var t,a=r.samples.length;if(a){for(var i=0;a>i;i++)t=r.samples[i],t.pts=(t.pts-this._initPTS)/this.PES_TIMESCALE,t.dts=(t.dts-this._initDTS)/this.PES_TIMESCALE;this.observer.trigger(e.default.FRAG_PARSING_METADATA,{samples:r.samples})}r.samples=[],s=s}},{key:"_PTSNormalize",value:function(e,t){var r;if(void 0===t)return e;for(r=e>t?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}},{key:"timescale",get:function(){return this.MP4_TIMESCALE}}]),i}();s.default=o,h.exports=s.default},{"../errors":11,"../events":12,"../remux/mp4-generator":17,"../utils/logger":19}],19:[function(n,o,r){"use strict";function t(){}Object.defineProperty(r,"__esModule",{value:!0});var i={log:t,warn:t,info:t,error:t},e=i,s=function(r){if(r===!0||"object"==typeof r){e.log=r.log?r.log.bind(r):void 0,e.info=r.info?r.info.bind(r):void 0,e.error=r.error?r.error.bind(r):void 0,e.warn=r.warn?r.warn.bind(r):void 0;try{e.log()}catch(r){e.log=t,e.info=t,e.error=t,e.warn=t}}else e=i};r.enableLogs=s;var a=e;r.logger=a},{}],20:[function(r,i,e){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;t", diff --git a/src/controller/abr-controller.js b/src/controller/abr-controller.js index 0546bdd0c84..f65ccbb3cfb 100644 --- a/src/controller/abr-controller.js +++ b/src/controller/abr-controller.js @@ -26,8 +26,6 @@ class AbrController { this.lastfetchlevel = data.frag.level; this.lastbw = (stats.loaded * 8) / this.lastfetchduration; //console.log('fetchDuration:${this.lastfetchduration},bw:${(this.lastbw/1000).toFixed(0)}/${stats.aborted}'); - // unset forced auto level - this._nextAutoLevel =-1; } } diff --git a/src/controller/level-controller.js b/src/controller/level-controller.js index 10c8a4b4028..89fe7f37c6c 100644 --- a/src/controller/level-controller.js +++ b/src/controller/level-controller.js @@ -154,7 +154,11 @@ class LevelController { } onError(event, data) { - var details = data.details, levelId, level; + if(data.fatal) { + return; + } + + var details = data.details, hls = this.hls, levelId, level; // try to recover not fatal errors switch(details) { case ErrorDetails.FRAG_LOAD_ERROR: @@ -184,7 +188,7 @@ class LevelController { let recoverable = ((this._manualLevel === -1) && levelId); if (recoverable) { logger.warn(`level controller,${details}: emergency switch-down for next fragment`); - this.hls.abrController.nextAutoLevel = 0; + hls.abrController.nextAutoLevel = 0; } else if(level && level.details && level.details.live) { logger.warn(`level controller,${details} on live stream, discard`); } else { @@ -194,10 +198,10 @@ class LevelController { if (this.timer) { clearInterval(this.timer); this.timer = null; - // redispatch same error but with fatal set to true - data.fatal = true; - this.hls.trigger(event, data); } + // redispatch same error but with fatal set to true + data.fatal = true; + hls.trigger(event, data); } } } diff --git a/src/controller/mse-buffer-controller.js b/src/controller/mse-buffer-controller.js index 23de3c9b0e5..316e90a19b5 100644 --- a/src/controller/mse-buffer-controller.js +++ b/src/controller/mse-buffer-controller.js @@ -8,18 +8,21 @@ import {logger} from '../utils/logger'; import LevelHelper from '../helper/level-helper'; import {ErrorTypes, ErrorDetails} from '../errors'; +const State = { + ERROR : -2, + STARTING : -1, + IDLE : 0, + LOADING : 1, + WAITING_LEVEL : 2, + PARSING : 3, + PARSED : 4, + APPENDING : 5, + BUFFER_FLUSHING : 6 +}; + class MSEBufferController { constructor(hls) { - this.ERROR = -2; - this.STARTING = -1; - this.IDLE = 0; - this.LOADING = 1; - this.WAITING_LEVEL = 2; - this.PARSING = 3; - this.PARSED = 4; - this.APPENDING = 5; - this.BUFFER_FLUSHING = 6; this.config = hls.config; this.hls = hls; // Source Buffer listeners @@ -53,7 +56,7 @@ class MSEBufferController { hls.off(Event.MEDIA_DETACHING, this.onmediadet0); hls.off(Event.MEDIA_DETACHED, this.onmediadet); hls.off(Event.MANIFEST_PARSED, this.onmp); - this.state = this.IDLE; + this.state = State.IDLE; } startLoad() { @@ -65,10 +68,10 @@ class MSEBufferController { logger.log('resuming video'); this.media.play(); } - this.state = this.IDLE; + this.state = State.IDLE; } else { this.lastCurrentTime = 0; - this.state = this.STARTING; + this.state = State.STARTING; } this.nextLoadPosition = this.startPosition = this.lastCurrentTime; this.tick(); @@ -133,25 +136,25 @@ class MSEBufferController { } tick() { - var pos, level, levelDetails, fragIdx; + var pos, level, levelDetails, fragIdx, hls = this.hls; switch(this.state) { - case this.ERROR: + case State.ERROR: //don't do anything in error state to avoid breaking further ... break; - case this.STARTING: + case State.STARTING: // determine load level - this.startLevel = this.hls.startLevel; + this.startLevel = hls.startLevel; if (this.startLevel === -1) { // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level this.startLevel = 0; this.fragBitrateTest = true; } // set new level to playlist loader : this will trigger start level load - this.level = this.hls.nextLoadLevel = this.startLevel; - this.state = this.WAITING_LEVEL; + this.level = hls.nextLoadLevel = this.startLevel; + this.state = State.WAITING_LEVEL; this.loadedmetadata = false; break; - case this.IDLE: + case State.IDLE: // if video detached or unbound exit loop if (!this.media) { break; @@ -170,7 +173,7 @@ class MSEBufferController { level = this.startLevel; } else { // we are not at playback start, get next load level from level Controller - level = this.hls.nextLoadLevel; + level = hls.nextLoadLevel; } var bufferInfo = this.bufferInfo(pos,0.3), bufferLen = bufferInfo.len, bufferEnd = bufferInfo.end, maxBufLen; // 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 @@ -183,12 +186,12 @@ class MSEBufferController { // if buffer length is less than maxBufLen try to load a new fragment if (bufferLen < maxBufLen) { // set next load level : this will trigger a playlist load if needed - this.hls.nextLoadLevel = level; + hls.nextLoadLevel = level; this.level = level; levelDetails = this.levels[level].details; // if level info not retrieved yet, switch state and wait for level retrieval if (typeof levelDetails === 'undefined') { - this.state = this.WAITING_LEVEL; + this.state = State.WAITING_LEVEL; break; } // find fragment index, contiguous with end of buffer position @@ -260,7 +263,7 @@ class MSEBufferController { } logger.log(`Loading ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}, currentTime:${pos},bufferEnd:${bufferEnd.toFixed(3)}`); //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3)); - frag.autoLevel = this.hls.autoLevelEnabled; + frag.autoLevel = hls.autoLevelEnabled; if (this.levels.length > 1) { frag.expectedLen = Math.round(frag.duration * this.levels[level].bitrate / 8); frag.trequest = new Date(); @@ -276,7 +279,7 @@ class MSEBufferController { let maxThreshold = this.config.fragLoadingLoopThreshold; // if this frag has already been loaded 3 times, and if it has been reloaded recently if (frag.loadCounter > maxThreshold && (Math.abs(this.fragLoadIdx - frag.loadIdx) < maxThreshold)) { - this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag}); + hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_LOOP_LOADING_ERROR, fatal: false, frag: frag}); return; } } else { @@ -285,18 +288,18 @@ class MSEBufferController { frag.loadIdx = this.fragLoadIdx; this.fragCurrent = frag; this.startFragmentRequested = true; - this.hls.trigger(Event.FRAG_LOADING, {frag: frag}); - this.state = this.LOADING; + hls.trigger(Event.FRAG_LOADING, {frag: frag}); + this.state = State.LOADING; } break; - case this.WAITING_LEVEL: + case State.WAITING_LEVEL: level = this.levels[this.level]; // check if playlist is already loaded if (level && level.details) { - this.state = this.IDLE; + this.state = State.IDLE; } break; - case this.LOADING: + case State.LOADING: /* monitor fragment retrieval time... we compute expected time of arrival of the complete fragment. @@ -316,7 +319,7 @@ class MSEBufferController { pos = v.currentTime; var fragLoadedDelay = (frag.expectedLen - frag.loaded) / loadRate; var bufferStarvationDelay = this.bufferInfo(pos,0.3).end - pos; - var fragLevelNextLoadedDelay = frag.duration * this.levels[this.hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps + var fragLevelNextLoadedDelay = frag.duration * this.levels[hls.nextLoadLevel].bitrate / (8 * loadRate); //bps/Bps /* if we have less than 2 frag duration in buffer and if frag loaded delay is greater than buffer starvation delay ... and also bigger than duration needed to load fragment at next level ...*/ if (bufferStarvationDelay < (2 * frag.duration) && fragLoadedDelay > bufferStarvationDelay && fragLoadedDelay > fragLevelNextLoadedDelay) { @@ -325,18 +328,18 @@ class MSEBufferController { logger.log(`fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay :${fragLoadedDelay.toFixed(1)}/${bufferStarvationDelay.toFixed(1)}/${fragLevelNextLoadedDelay.toFixed(1)}`); //abort fragment loading frag.loader.abort(); - this.hls.trigger(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag}); + hls.trigger(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag}); // switch back to IDLE state to request new fragment at lowest level - this.state = this.IDLE; + this.state = State.IDLE; } } } break; - case this.PARSING: + case State.PARSING: // nothing to do, wait for fragment being parsed break; - case this.PARSED: - case this.APPENDING: + case State.PARSED: + case State.APPENDING: if (this.sourceBuffer) { // if MP4 segment appending in progress nothing to do if ((this.sourceBuffer.audio && this.sourceBuffer.audio.updating) || @@ -365,22 +368,22 @@ class MSEBufferController { if (this.appendError > this.config.appendErrorMaxRetry) { logger.log(`fail ${this.config.appendErrorMaxRetry} times to append segment in sourceBuffer`); event.fatal = true; - this.hls.trigger(Event.ERROR, event); - this.state = this.ERROR; + hls.trigger(Event.ERROR, event); + this.state = State.ERROR; return; } else { event.fatal = false; - this.hls.trigger(Event.ERROR, event); + hls.trigger(Event.ERROR, event); } } - this.state = this.APPENDING; + this.state = State.APPENDING; } } else { // sourceBuffer undefined, switch back to IDLE state - this.state = this.IDLE; + this.state = State.IDLE; } break; - case this.BUFFER_FLUSHING: + case State.BUFFER_FLUSHING: // loop through all buffer ranges to flush while(this.flushRange.length) { var range = this.flushRange[0]; @@ -399,7 +402,7 @@ class MSEBufferController { this.immediateLevelSwitchEnd(); } // move to IDLE once flush complete. this should trigger new fragment loading - this.state = this.IDLE; + this.state = State.IDLE; // reset reference to frag this.fragPrevious = null; } @@ -637,7 +640,7 @@ class MSEBufferController { this.flushBufferCounter = 0; this.flushRange.push({start: 0, end: Number.POSITIVE_INFINITY}); // trigger a sourceBuffer flush - this.state = this.BUFFER_FLUSHING; + this.state = State.BUFFER_FLUSHING; // increase fragment load Index to avoid frag loop loading error after buffer flush this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold; // speed up switching, trigger timer function @@ -701,7 +704,7 @@ class MSEBufferController { if (this.flushRange.length) { this.flushBufferCounter = 0; // trigger a sourceBuffer flush - this.state = this.BUFFER_FLUSHING; + this.state = State.BUFFER_FLUSHING; // increase fragment load Index to avoid frag loop loading error after buffer flush this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold; // speed up switching, trigger timer function @@ -778,16 +781,19 @@ class MSEBufferController { } onMediaSeeking() { - if (this.state === this.LOADING) { + if (this.state === State.LOADING) { // check if currently loaded fragment is inside buffer. //if outside, cancel fragment loading, otherwise do nothing if (this.bufferInfo(this.media.currentTime,0.3).len === 0) { logger.log('seeking outside of buffer while fragment load in progress, cancel fragment load'); - this.fragCurrent.loader.abort(); - this.fragCurrent = null; + var fragCurrent = this.fragCurrent; + if (fragCurrent) { + fragCurrent.loader.abort(); + this.fragCurrent = null; + } this.fragPrevious = null; // switch to IDLE state to load new fragment - this.state = this.IDLE; + this.state = State.IDLE; } } if (this.media) { @@ -886,8 +892,8 @@ class MSEBufferController { this.startLevelLoaded = true; } // only switch batck to IDLE state if we were waiting for level to start downloading a new fragment - if (this.state === this.WAITING_LEVEL) { - this.state = this.IDLE; + if (this.state === State.WAITING_LEVEL) { + this.state = State.IDLE; } //trigger handler right now this.tick(); @@ -895,32 +901,34 @@ class MSEBufferController { onFragLoaded(event, data) { var fragCurrent = this.fragCurrent; - if (this.state === this.LOADING && + if (this.state === State.LOADING && fragCurrent && data.frag.level === fragCurrent.level && data.frag.sn === fragCurrent.sn) { if (this.fragBitrateTest === true) { // switch back to IDLE state ... we just loaded a fragment to determine adequate start bitrate and initialize autoswitch algo - this.state = this.IDLE; + this.state = State.IDLE; this.fragBitrateTest = false; data.stats.tparsed = data.stats.tbuffered = new Date(); this.hls.trigger(Event.FRAG_BUFFERED, {stats: data.stats, frag: fragCurrent}); } else { - this.state = this.PARSING; + this.state = State.PARSING; // transmux the MPEG-TS data to ISO-BMFF segments this.stats = data.stats; var currentLevel = this.levels[this.level], details = currentLevel.details, duration = details.totalduration, - start = fragCurrent.start; - logger.log(`Demuxing ${fragCurrent.sn} of [${details.startSN} ,${details.endSN}],level ${this.level}`); - this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, this.level, duration); + start = fragCurrent.start, + level = fragCurrent.level, + sn = fragCurrent.sn; + logger.log(`Demuxing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}`); + this.demuxer.push(data.payload, currentLevel.audioCodec, currentLevel.videoCodec, start, fragCurrent.cc, level, duration); } } } onInitSegment(event, data) { - if (this.state === this.PARSING) { + if (this.state === State.PARSING) { // check if codecs have been explicitely defined in the master playlist for this level; // if yes use these ones instead of the ones parsed from the demux var audioCodec = this.levels[this.level].audioCodec, videoCodec = this.levels[this.level].videoCodec, sb; @@ -935,7 +943,11 @@ class MSEBufferController { } // in case several audio codecs might be used, force HE-AAC for audio (some browsers don't support audio codec switch) //don't do it for mono streams ... - if (this.audiocodecswitch && data.audioChannelCount === 2 && navigator.userAgent.toLowerCase().indexOf('android') === -1 && navigator.userAgent.toLowerCase().indexOf('firefox') === -1) { + var ua = navigator.userAgent.toLowerCase(); + if (this.audiocodecswitch && + data.audioChannelCount !== 1 && + ua.indexOf('android') === -1 && + ua.indexOf('firefox') === -1) { audioCodec = 'mp4a.40.5'; } if (!this.sourceBuffer) { @@ -965,7 +977,7 @@ class MSEBufferController { } onFragParsing(event, data) { - if (this.state === this.PARSING) { + if (this.state === State.PARSING) { this.tparse2 = Date.now(); var level = this.levels[this.level], frag = this.fragCurrent; @@ -986,8 +998,8 @@ class MSEBufferController { } onFragParsed() { - if (this.state === this.PARSING) { - this.state = this.PARSED; + if (this.state === State.PARSING) { + this.state = State.PARSED; this.stats.tparsed = new Date(); //trigger handler right now this.tick(); @@ -1004,7 +1016,7 @@ class MSEBufferController { case ErrorDetails.LEVEL_LOAD_TIMEOUT: // if fatal error, stop processing, otherwise move to IDLE to retry loading logger.warn(`buffer controller: ${data.details} while loading frag,switch to ${data.fatal ? 'ERROR' : 'IDLE'} state ...`); - this.state = data.fatal ? this.ERROR : this.IDLE; + this.state = data.fatal ? State.ERROR : State.IDLE; break; default: break; @@ -1013,15 +1025,15 @@ class MSEBufferController { onSBUpdateEnd() { //trigger handler right now - if (this.state === this.APPENDING && this.mp4segments.length === 0) { + if (this.state === State.APPENDING && this.mp4segments.length === 0) { var frag = this.fragCurrent, stats = this.stats; if (frag) { this.fragPrevious = frag; stats.tbuffered = new Date(); this.fragLastKbps = Math.round(8 * stats.length / (stats.tbuffered - stats.tfirst)); this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag}); - logger.log(`video buffered : ${this.timeRangesToString(this.media.buffered)}`); - this.state = this.IDLE; + logger.log(`media buffered : ${this.timeRangesToString(this.media.buffered)}`); + this.state = State.IDLE; } var video = this.media; if(video) { @@ -1052,7 +1064,7 @@ class MSEBufferController { onSBUpdateError(event) { logger.error(`sourceBuffer error:${event}`); - this.state = this.ERROR; + this.state = State.ERROR; this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_APPENDING_ERROR, fatal: true, frag: this.fragCurrent}); } diff --git a/src/errors.js b/src/errors.js index 5e0f88f2c95..c852eb08978 100644 --- a/src/errors.js +++ b/src/errors.js @@ -1,4 +1,4 @@ -export var ErrorTypes = { +export const ErrorTypes = { // Identifier for a network error (loading error / timeout ...) NETWORK_ERROR: 'hlsNetworkError', // Identifier for a media Error (video/parsing/mediasource error) @@ -7,7 +7,7 @@ export var ErrorTypes = { OTHER_ERROR: 'hlsOtherError' }; -export var ErrorDetails = { +export const ErrorDetails = { // Identifier for a manifest load error - data: { url : faulty URL, response : XHR response} MANIFEST_LOAD_ERROR: 'manifestLoadError', // Identifier for a manifest load timeout - data: { url : faulty URL, response : XHR response} diff --git a/src/hls.js b/src/hls.js index 74dc0b9a86d..0e487739f0d 100644 --- a/src/hls.js +++ b/src/hls.js @@ -102,13 +102,13 @@ class Hls { } attachMedia(media) { - logger.log('attachMediaElement'); + logger.log('attachMedia'); this.media = media; this.trigger(Event.MEDIA_ATTACHING, {media: media}); } - detachMediaElement() { - logger.log('detachMediaElement'); + detachMedia() { + logger.log('detachMedia'); this.trigger(Event.MEDIA_DETACHING); this.media = null; this.trigger(Event.MEDIA_DETACHED);