hls.js 1.5.9-0.canary.10225 → 1.5.9-0.canary.10227

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hls.light.js CHANGED
@@ -606,7 +606,7 @@
606
606
  // Some browsers don't allow to use bind on console object anyway
607
607
  // fallback to default if needed
608
608
  try {
609
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10225");
609
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10227");
610
610
  } catch (e) {
611
611
  /* log fn threw an exception. All logger methods are no-ops. */
612
612
  return createLogger();
@@ -875,9 +875,9 @@
875
875
  var _proto2 = Fragment.prototype;
876
876
  _proto2.setKeyFormat = function setKeyFormat(keyFormat) {
877
877
  if (this.levelkeys) {
878
- var _key = this.levelkeys[keyFormat];
879
- if (_key && !this._decryptdata) {
880
- this._decryptdata = _key.getDecryptData(this.sn);
878
+ var key = this.levelkeys[keyFormat];
879
+ if (key && !this._decryptdata) {
880
+ this._decryptdata = key.getDecryptData(this.sn);
881
881
  }
882
882
  }
883
883
  };
@@ -921,9 +921,9 @@
921
921
  return null;
922
922
  }
923
923
  if (!this._decryptdata && this.levelkeys && !this.levelkeys.NONE) {
924
- var _key2 = this.levelkeys.identity;
925
- if (_key2) {
926
- this._decryptdata = _key2.getDecryptData(this.sn);
924
+ var key = this.levelkeys.identity;
925
+ if (key) {
926
+ this._decryptdata = key.getDecryptData(this.sn);
927
927
  } else {
928
928
  var keyFormats = Object.keys(this.levelkeys);
929
929
  if (keyFormats.length === 1) {
@@ -3865,10 +3865,10 @@
3865
3865
  var firstCueInRange = getFirstCueIndexAfterTime(cues, start);
3866
3866
  if (firstCueInRange > -1) {
3867
3867
  for (var i = firstCueInRange, len = cues.length; i < len; i++) {
3868
- var _cue = cues[i];
3869
- if (_cue.startTime >= start && _cue.endTime <= end) {
3870
- cuesFound.push(_cue);
3871
- } else if (_cue.startTime > end) {
3868
+ var cue = cues[i];
3869
+ if (cue.startTime >= start && cue.endTime <= end) {
3870
+ cuesFound.push(cue);
3871
+ } else if (cue.startTime > end) {
3872
3872
  return cuesFound;
3873
3873
  }
3874
3874
  }
@@ -8947,12 +8947,12 @@
8947
8947
  if (data.context) {
8948
8948
  var _data$context = data.context,
8949
8949
  groupId = _data$context.groupId,
8950
- _pathwayId = _data$context.pathwayId,
8950
+ pathwayId = _data$context.pathwayId,
8951
8951
  type = _data$context.type;
8952
8952
  if (groupId && levels) {
8953
8953
  errorPathway = this.getPathwayForGroupId(groupId, type, errorPathway);
8954
- } else if (_pathwayId) {
8955
- errorPathway = _pathwayId;
8954
+ } else if (pathwayId) {
8955
+ errorPathway = pathwayId;
8956
8956
  }
8957
8957
  }
8958
8958
  if (!(errorPathway in this.penalizedPathways)) {
@@ -8976,10 +8976,10 @@
8976
8976
  this.levels = levels;
8977
8977
  var pathwayLevels = this.getLevelsForPathway(this.pathwayId);
8978
8978
  if (pathwayLevels.length === 0) {
8979
- var _pathwayId2 = levels[0].pathwayId;
8980
- this.log("No levels found in Pathway " + this.pathwayId + ". Setting initial Pathway to \"" + _pathwayId2 + "\"");
8981
- pathwayLevels = this.getLevelsForPathway(_pathwayId2);
8982
- this.pathwayId = _pathwayId2;
8979
+ var pathwayId = levels[0].pathwayId;
8980
+ this.log("No levels found in Pathway " + this.pathwayId + ". Setting initial Pathway to \"" + pathwayId + "\"");
8981
+ pathwayLevels = this.getLevelsForPathway(pathwayId);
8982
+ this.pathwayId = pathwayId;
8983
8983
  }
8984
8984
  if (pathwayLevels.length !== levels.length) {
8985
8985
  this.log("Found " + pathwayLevels.length + "/" + levels.length + " levels in Pathway \"" + this.pathwayId + "\"");
@@ -9008,19 +9008,19 @@
9008
9008
  }
9009
9009
  });
9010
9010
  for (var i = 0; i < pathwayPriority.length; i++) {
9011
- var _pathwayId3 = pathwayPriority[i];
9012
- if (_pathwayId3 in penalizedPathways) {
9011
+ var pathwayId = pathwayPriority[i];
9012
+ if (pathwayId in penalizedPathways) {
9013
9013
  continue;
9014
9014
  }
9015
- if (_pathwayId3 === this.pathwayId) {
9015
+ if (pathwayId === this.pathwayId) {
9016
9016
  return;
9017
9017
  }
9018
9018
  var selectedIndex = this.hls.nextLoadLevel;
9019
9019
  var selectedLevel = this.hls.levels[selectedIndex];
9020
- levels = this.getLevelsForPathway(_pathwayId3);
9020
+ levels = this.getLevelsForPathway(pathwayId);
9021
9021
  if (levels.length > 0) {
9022
- this.log("Setting Pathway to \"" + _pathwayId3 + "\"");
9023
- this.pathwayId = _pathwayId3;
9022
+ this.log("Setting Pathway to \"" + pathwayId + "\"");
9023
+ this.pathwayId = pathwayId;
9024
9024
  reassignFragmentLevelIndexes(levels);
9025
9025
  this.hls.trigger(Events.LEVELS_UPDATED, {
9026
9026
  levels: levels
@@ -17552,8 +17552,8 @@
17552
17552
  var maxDtsDelta = Number.NEGATIVE_INFINITY;
17553
17553
  var maxPtsDelta = Number.NEGATIVE_INFINITY;
17554
17554
  for (var _i3 = 0; _i3 < nbSamples; _i3++) {
17555
- var _VideoSample = inputSamples[_i3];
17556
- var VideoSampleUnits = _VideoSample.units;
17555
+ var VideoSample = inputSamples[_i3];
17556
+ var VideoSampleUnits = VideoSample.units;
17557
17557
  var mp4SampleLength = 0;
17558
17558
  // convert NALU bitstream to MP4 format (prepend NALU with size field)
17559
17559
  for (var _j = 0, _nbUnits = VideoSampleUnits.length; _j < _nbUnits; _j++) {
@@ -17570,12 +17570,12 @@
17570
17570
  // expected sample duration is the Decoding Timestamp diff of consecutive samples
17571
17571
  var ptsDelta = void 0;
17572
17572
  if (_i3 < nbSamples - 1) {
17573
- mp4SampleDuration = inputSamples[_i3 + 1].dts - _VideoSample.dts;
17574
- ptsDelta = inputSamples[_i3 + 1].pts - _VideoSample.pts;
17573
+ mp4SampleDuration = inputSamples[_i3 + 1].dts - VideoSample.dts;
17574
+ ptsDelta = inputSamples[_i3 + 1].pts - VideoSample.pts;
17575
17575
  } else {
17576
17576
  var config = this.config;
17577
- var lastFrameDuration = _i3 > 0 ? _VideoSample.dts - inputSamples[_i3 - 1].dts : averageSampleDuration;
17578
- ptsDelta = _i3 > 0 ? _VideoSample.pts - inputSamples[_i3 - 1].pts : averageSampleDuration;
17577
+ var lastFrameDuration = _i3 > 0 ? VideoSample.dts - inputSamples[_i3 - 1].dts : averageSampleDuration;
17578
+ ptsDelta = _i3 > 0 ? VideoSample.pts - inputSamples[_i3 - 1].pts : averageSampleDuration;
17579
17579
  if (config.stretchShortVideoTrack && this.nextAudioPts !== null) {
17580
17580
  // In some cases, a segment's audio track duration may exceed the video track duration.
17581
17581
  // Since we've already remuxed audio, and we know how long the audio track is, we look to
@@ -17583,7 +17583,7 @@
17583
17583
  // If so, playback would potentially get stuck, so we artificially inflate
17584
17584
  // the duration of the last frame to minimize any potential gap between segments.
17585
17585
  var gapTolerance = Math.floor(config.maxBufferHole * timeScale);
17586
- var deltaToFrameEnd = (audioTrackLength ? minPTS + audioTrackLength * timeScale : this.nextAudioPts) - _VideoSample.pts;
17586
+ var deltaToFrameEnd = (audioTrackLength ? minPTS + audioTrackLength * timeScale : this.nextAudioPts) - VideoSample.pts;
17587
17587
  if (deltaToFrameEnd > gapTolerance) {
17588
17588
  // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video
17589
17589
  // frame overlap. maxBufferHole should be >> lastFrameDuration anyway.
@@ -17601,12 +17601,12 @@
17601
17601
  mp4SampleDuration = lastFrameDuration;
17602
17602
  }
17603
17603
  }
17604
- var compositionTimeOffset = Math.round(_VideoSample.pts - _VideoSample.dts);
17604
+ var compositionTimeOffset = Math.round(VideoSample.pts - VideoSample.dts);
17605
17605
  minDtsDelta = Math.min(minDtsDelta, mp4SampleDuration);
17606
17606
  maxDtsDelta = Math.max(maxDtsDelta, mp4SampleDuration);
17607
17607
  minPtsDelta = Math.min(minPtsDelta, ptsDelta);
17608
17608
  maxPtsDelta = Math.max(maxPtsDelta, ptsDelta);
17609
- outputSamples.push(new Mp4Sample(_VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
17609
+ outputSamples.push(new Mp4Sample(VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
17610
17610
  }
17611
17611
  if (outputSamples.length) {
17612
17612
  if (chromeVersion) {
@@ -19257,17 +19257,17 @@
19257
19257
  state: state
19258
19258
  }, data instanceof ArrayBuffer ? [data] : []);
19259
19259
  } else if (transmuxer) {
19260
- var _transmuxResult = transmuxer.push(data, decryptdata, chunkMeta, state);
19261
- if (isPromise(_transmuxResult)) {
19260
+ var transmuxResult = transmuxer.push(data, decryptdata, chunkMeta, state);
19261
+ if (isPromise(transmuxResult)) {
19262
19262
  transmuxer.async = true;
19263
- _transmuxResult.then(function (data) {
19263
+ transmuxResult.then(function (data) {
19264
19264
  _this2.handleTransmuxComplete(data);
19265
19265
  }).catch(function (error) {
19266
19266
  _this2.transmuxerError(error, chunkMeta, 'transmuxer-interface push error');
19267
19267
  });
19268
19268
  } else {
19269
19269
  transmuxer.async = false;
19270
- this.handleTransmuxComplete(_transmuxResult);
19270
+ this.handleTransmuxComplete(transmuxResult);
19271
19271
  }
19272
19272
  }
19273
19273
  };
@@ -19281,19 +19281,19 @@
19281
19281
  chunkMeta: chunkMeta
19282
19282
  });
19283
19283
  } else if (transmuxer) {
19284
- var _transmuxResult2 = transmuxer.flush(chunkMeta);
19285
- var asyncFlush = isPromise(_transmuxResult2);
19284
+ var transmuxResult = transmuxer.flush(chunkMeta);
19285
+ var asyncFlush = isPromise(transmuxResult);
19286
19286
  if (asyncFlush || transmuxer.async) {
19287
- if (!isPromise(_transmuxResult2)) {
19288
- _transmuxResult2 = Promise.resolve(_transmuxResult2);
19287
+ if (!isPromise(transmuxResult)) {
19288
+ transmuxResult = Promise.resolve(transmuxResult);
19289
19289
  }
19290
- _transmuxResult2.then(function (data) {
19290
+ transmuxResult.then(function (data) {
19291
19291
  _this3.handleFlushResult(data, chunkMeta);
19292
19292
  }).catch(function (error) {
19293
19293
  _this3.transmuxerError(error, chunkMeta, 'transmuxer-interface flush error');
19294
19294
  });
19295
19295
  } else {
19296
- this.handleFlushResult(_transmuxResult2, chunkMeta);
19296
+ this.handleFlushResult(transmuxResult, chunkMeta);
19297
19297
  }
19298
19298
  }
19299
19299
  };
@@ -21715,7 +21715,7 @@
21715
21715
  * Get the video-dev/hls.js package version.
21716
21716
  */
21717
21717
  function get() {
21718
- return "1.5.9-0.canary.10225";
21718
+ return "1.5.9-0.canary.10227";
21719
21719
  }
21720
21720
  }, {
21721
21721
  key: "Events",