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.js CHANGED
@@ -637,7 +637,7 @@
637
637
  // Some browsers don't allow to use bind on console object anyway
638
638
  // fallback to default if needed
639
639
  try {
640
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10225");
640
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10227");
641
641
  } catch (e) {
642
642
  /* log fn threw an exception. All logger methods are no-ops. */
643
643
  return createLogger();
@@ -906,9 +906,9 @@
906
906
  var _proto2 = Fragment.prototype;
907
907
  _proto2.setKeyFormat = function setKeyFormat(keyFormat) {
908
908
  if (this.levelkeys) {
909
- var _key = this.levelkeys[keyFormat];
910
- if (_key && !this._decryptdata) {
911
- this._decryptdata = _key.getDecryptData(this.sn);
909
+ var key = this.levelkeys[keyFormat];
910
+ if (key && !this._decryptdata) {
911
+ this._decryptdata = key.getDecryptData(this.sn);
912
912
  }
913
913
  }
914
914
  };
@@ -952,9 +952,9 @@
952
952
  return null;
953
953
  }
954
954
  if (!this._decryptdata && this.levelkeys && !this.levelkeys.NONE) {
955
- var _key2 = this.levelkeys.identity;
956
- if (_key2) {
957
- this._decryptdata = _key2.getDecryptData(this.sn);
955
+ var key = this.levelkeys.identity;
956
+ if (key) {
957
+ this._decryptdata = key.getDecryptData(this.sn);
958
958
  } else {
959
959
  var keyFormats = Object.keys(this.levelkeys);
960
960
  if (keyFormats.length === 1) {
@@ -4383,10 +4383,10 @@
4383
4383
  var firstCueInRange = getFirstCueIndexAfterTime(cues, start);
4384
4384
  if (firstCueInRange > -1) {
4385
4385
  for (var i = firstCueInRange, len = cues.length; i < len; i++) {
4386
- var _cue = cues[i];
4387
- if (_cue.startTime >= start && _cue.endTime <= end) {
4388
- cuesFound.push(_cue);
4389
- } else if (_cue.startTime > end) {
4386
+ var cue = cues[i];
4387
+ if (cue.startTime >= start && cue.endTime <= end) {
4388
+ cuesFound.push(cue);
4389
+ } else if (cue.startTime > end) {
4390
4390
  return cuesFound;
4391
4391
  }
4392
4392
  }
@@ -7379,8 +7379,8 @@
7379
7379
  }
7380
7380
  }
7381
7381
  for (var i = 0; i < tracks.length; i++) {
7382
- var _track = tracks[i];
7383
- if (matchesOption(option, _track, matchPredicate)) {
7382
+ var track = tracks[i];
7383
+ if (matchesOption(option, track, matchPredicate)) {
7384
7384
  return i;
7385
7385
  }
7386
7386
  }
@@ -15569,8 +15569,8 @@
15569
15569
  var maxDtsDelta = Number.NEGATIVE_INFINITY;
15570
15570
  var maxPtsDelta = Number.NEGATIVE_INFINITY;
15571
15571
  for (var _i3 = 0; _i3 < nbSamples; _i3++) {
15572
- var _VideoSample = inputSamples[_i3];
15573
- var VideoSampleUnits = _VideoSample.units;
15572
+ var VideoSample = inputSamples[_i3];
15573
+ var VideoSampleUnits = VideoSample.units;
15574
15574
  var mp4SampleLength = 0;
15575
15575
  // convert NALU bitstream to MP4 format (prepend NALU with size field)
15576
15576
  for (var _j = 0, _nbUnits = VideoSampleUnits.length; _j < _nbUnits; _j++) {
@@ -15587,12 +15587,12 @@
15587
15587
  // expected sample duration is the Decoding Timestamp diff of consecutive samples
15588
15588
  var ptsDelta = void 0;
15589
15589
  if (_i3 < nbSamples - 1) {
15590
- mp4SampleDuration = inputSamples[_i3 + 1].dts - _VideoSample.dts;
15591
- ptsDelta = inputSamples[_i3 + 1].pts - _VideoSample.pts;
15590
+ mp4SampleDuration = inputSamples[_i3 + 1].dts - VideoSample.dts;
15591
+ ptsDelta = inputSamples[_i3 + 1].pts - VideoSample.pts;
15592
15592
  } else {
15593
15593
  var config = this.config;
15594
- var lastFrameDuration = _i3 > 0 ? _VideoSample.dts - inputSamples[_i3 - 1].dts : averageSampleDuration;
15595
- ptsDelta = _i3 > 0 ? _VideoSample.pts - inputSamples[_i3 - 1].pts : averageSampleDuration;
15594
+ var lastFrameDuration = _i3 > 0 ? VideoSample.dts - inputSamples[_i3 - 1].dts : averageSampleDuration;
15595
+ ptsDelta = _i3 > 0 ? VideoSample.pts - inputSamples[_i3 - 1].pts : averageSampleDuration;
15596
15596
  if (config.stretchShortVideoTrack && this.nextAudioPts !== null) {
15597
15597
  // In some cases, a segment's audio track duration may exceed the video track duration.
15598
15598
  // Since we've already remuxed audio, and we know how long the audio track is, we look to
@@ -15600,7 +15600,7 @@
15600
15600
  // If so, playback would potentially get stuck, so we artificially inflate
15601
15601
  // the duration of the last frame to minimize any potential gap between segments.
15602
15602
  var gapTolerance = Math.floor(config.maxBufferHole * timeScale);
15603
- var deltaToFrameEnd = (audioTrackLength ? minPTS + audioTrackLength * timeScale : this.nextAudioPts) - _VideoSample.pts;
15603
+ var deltaToFrameEnd = (audioTrackLength ? minPTS + audioTrackLength * timeScale : this.nextAudioPts) - VideoSample.pts;
15604
15604
  if (deltaToFrameEnd > gapTolerance) {
15605
15605
  // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video
15606
15606
  // frame overlap. maxBufferHole should be >> lastFrameDuration anyway.
@@ -15618,12 +15618,12 @@
15618
15618
  mp4SampleDuration = lastFrameDuration;
15619
15619
  }
15620
15620
  }
15621
- var compositionTimeOffset = Math.round(_VideoSample.pts - _VideoSample.dts);
15621
+ var compositionTimeOffset = Math.round(VideoSample.pts - VideoSample.dts);
15622
15622
  minDtsDelta = Math.min(minDtsDelta, mp4SampleDuration);
15623
15623
  maxDtsDelta = Math.max(maxDtsDelta, mp4SampleDuration);
15624
15624
  minPtsDelta = Math.min(minPtsDelta, ptsDelta);
15625
15625
  maxPtsDelta = Math.max(maxPtsDelta, ptsDelta);
15626
- outputSamples.push(new Mp4Sample(_VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
15626
+ outputSamples.push(new Mp4Sample(VideoSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));
15627
15627
  }
15628
15628
  if (outputSamples.length) {
15629
15629
  if (chromeVersion) {
@@ -17277,17 +17277,17 @@
17277
17277
  state: state
17278
17278
  }, data instanceof ArrayBuffer ? [data] : []);
17279
17279
  } else if (transmuxer) {
17280
- var _transmuxResult = transmuxer.push(data, decryptdata, chunkMeta, state);
17281
- if (isPromise(_transmuxResult)) {
17280
+ var transmuxResult = transmuxer.push(data, decryptdata, chunkMeta, state);
17281
+ if (isPromise(transmuxResult)) {
17282
17282
  transmuxer.async = true;
17283
- _transmuxResult.then(function (data) {
17283
+ transmuxResult.then(function (data) {
17284
17284
  _this2.handleTransmuxComplete(data);
17285
17285
  }).catch(function (error) {
17286
17286
  _this2.transmuxerError(error, chunkMeta, 'transmuxer-interface push error');
17287
17287
  });
17288
17288
  } else {
17289
17289
  transmuxer.async = false;
17290
- this.handleTransmuxComplete(_transmuxResult);
17290
+ this.handleTransmuxComplete(transmuxResult);
17291
17291
  }
17292
17292
  }
17293
17293
  };
@@ -17301,19 +17301,19 @@
17301
17301
  chunkMeta: chunkMeta
17302
17302
  });
17303
17303
  } else if (transmuxer) {
17304
- var _transmuxResult2 = transmuxer.flush(chunkMeta);
17305
- var asyncFlush = isPromise(_transmuxResult2);
17304
+ var transmuxResult = transmuxer.flush(chunkMeta);
17305
+ var asyncFlush = isPromise(transmuxResult);
17306
17306
  if (asyncFlush || transmuxer.async) {
17307
- if (!isPromise(_transmuxResult2)) {
17308
- _transmuxResult2 = Promise.resolve(_transmuxResult2);
17307
+ if (!isPromise(transmuxResult)) {
17308
+ transmuxResult = Promise.resolve(transmuxResult);
17309
17309
  }
17310
- _transmuxResult2.then(function (data) {
17310
+ transmuxResult.then(function (data) {
17311
17311
  _this3.handleFlushResult(data, chunkMeta);
17312
17312
  }).catch(function (error) {
17313
17313
  _this3.transmuxerError(error, chunkMeta, 'transmuxer-interface flush error');
17314
17314
  });
17315
17315
  } else {
17316
- this.handleFlushResult(_transmuxResult2, chunkMeta);
17316
+ this.handleFlushResult(transmuxResult, chunkMeta);
17317
17317
  }
17318
17318
  }
17319
17319
  };
@@ -22156,9 +22156,9 @@
22156
22156
  if (kv.length !== 2) {
22157
22157
  continue;
22158
22158
  }
22159
- var _k = kv[0];
22160
- var _v = kv[1];
22161
- callback(_k, _v);
22159
+ var k = kv[0];
22160
+ var v = kv[1];
22161
+ callback(k, v);
22162
22162
  }
22163
22163
  }
22164
22164
  var defaults = new VTTCue(0, 0, '');
@@ -24089,9 +24089,9 @@
24089
24089
  var decryptdata = mediaKeySessionContext.decryptdata;
24090
24090
  if (decryptdata.pssh) {
24091
24091
  var keySessionContext = this.createMediaKeySessionContext(mediaKeySessionContext);
24092
- var _keyId = this.getKeyIdString(decryptdata);
24092
+ var keyId = this.getKeyIdString(decryptdata);
24093
24093
  var scheme = 'cenc';
24094
- this.keyIdToKeySessionPromise[_keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'expired');
24094
+ this.keyIdToKeySessionPromise[keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'expired');
24095
24095
  } else {
24096
24096
  this.warn("Could not renew expired session. Missing pssh initData.");
24097
24097
  }
@@ -24464,9 +24464,9 @@
24464
24464
  var _header$querySelector, _header$querySelector2;
24465
24465
  header = headers[i];
24466
24466
  var name = (_header$querySelector = header.querySelector('name')) == null ? void 0 : _header$querySelector.textContent;
24467
- var _value = (_header$querySelector2 = header.querySelector('value')) == null ? void 0 : _header$querySelector2.textContent;
24468
- if (name && _value) {
24469
- xhr.setRequestHeader(name, _value);
24467
+ var value = (_header$querySelector2 = header.querySelector('value')) == null ? void 0 : _header$querySelector2.textContent;
24468
+ if (name && value) {
24469
+ xhr.setRequestHeader(name, value);
24470
24470
  }
24471
24471
  }
24472
24472
  }
@@ -26059,12 +26059,12 @@
26059
26059
  if (data.context) {
26060
26060
  var _data$context = data.context,
26061
26061
  groupId = _data$context.groupId,
26062
- _pathwayId = _data$context.pathwayId,
26062
+ pathwayId = _data$context.pathwayId,
26063
26063
  type = _data$context.type;
26064
26064
  if (groupId && levels) {
26065
26065
  errorPathway = this.getPathwayForGroupId(groupId, type, errorPathway);
26066
- } else if (_pathwayId) {
26067
- errorPathway = _pathwayId;
26066
+ } else if (pathwayId) {
26067
+ errorPathway = pathwayId;
26068
26068
  }
26069
26069
  }
26070
26070
  if (!(errorPathway in this.penalizedPathways)) {
@@ -26088,10 +26088,10 @@
26088
26088
  this.levels = levels;
26089
26089
  var pathwayLevels = this.getLevelsForPathway(this.pathwayId);
26090
26090
  if (pathwayLevels.length === 0) {
26091
- var _pathwayId2 = levels[0].pathwayId;
26092
- this.log("No levels found in Pathway " + this.pathwayId + ". Setting initial Pathway to \"" + _pathwayId2 + "\"");
26093
- pathwayLevels = this.getLevelsForPathway(_pathwayId2);
26094
- this.pathwayId = _pathwayId2;
26091
+ var pathwayId = levels[0].pathwayId;
26092
+ this.log("No levels found in Pathway " + this.pathwayId + ". Setting initial Pathway to \"" + pathwayId + "\"");
26093
+ pathwayLevels = this.getLevelsForPathway(pathwayId);
26094
+ this.pathwayId = pathwayId;
26095
26095
  }
26096
26096
  if (pathwayLevels.length !== levels.length) {
26097
26097
  this.log("Found " + pathwayLevels.length + "/" + levels.length + " levels in Pathway \"" + this.pathwayId + "\"");
@@ -26120,19 +26120,19 @@
26120
26120
  }
26121
26121
  });
26122
26122
  for (var i = 0; i < pathwayPriority.length; i++) {
26123
- var _pathwayId3 = pathwayPriority[i];
26124
- if (_pathwayId3 in penalizedPathways) {
26123
+ var pathwayId = pathwayPriority[i];
26124
+ if (pathwayId in penalizedPathways) {
26125
26125
  continue;
26126
26126
  }
26127
- if (_pathwayId3 === this.pathwayId) {
26127
+ if (pathwayId === this.pathwayId) {
26128
26128
  return;
26129
26129
  }
26130
26130
  var selectedIndex = this.hls.nextLoadLevel;
26131
26131
  var selectedLevel = this.hls.levels[selectedIndex];
26132
- levels = this.getLevelsForPathway(_pathwayId3);
26132
+ levels = this.getLevelsForPathway(pathwayId);
26133
26133
  if (levels.length > 0) {
26134
- this.log("Setting Pathway to \"" + _pathwayId3 + "\"");
26135
- this.pathwayId = _pathwayId3;
26134
+ this.log("Setting Pathway to \"" + pathwayId + "\"");
26135
+ this.pathwayId = pathwayId;
26136
26136
  reassignFragmentLevelIndexes(levels);
26137
26137
  this.hls.trigger(Events.LEVELS_UPDATED, {
26138
26138
  levels: levels
@@ -30513,7 +30513,7 @@
30513
30513
  * Get the video-dev/hls.js package version.
30514
30514
  */
30515
30515
  function get() {
30516
- return "1.5.9-0.canary.10225";
30516
+ return "1.5.9-0.canary.10227";
30517
30517
  }
30518
30518
  }, {
30519
30519
  key: "Events",