hls.js 1.6.0-beta.3.0.canary.10979 → 1.6.0-beta.3.0.canary.10980

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
@@ -1030,7 +1030,7 @@
1030
1030
  // Some browsers don't allow to use bind on console object anyway
1031
1031
  // fallback to default if needed
1032
1032
  try {
1033
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.3.0.canary.10979");
1033
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.3.0.canary.10980");
1034
1034
  } catch (e) {
1035
1035
  /* log fn threw an exception. All logger methods are no-ops. */
1036
1036
  return createLogger();
@@ -1566,6 +1566,25 @@
1566
1566
  };
1567
1567
  }
1568
1568
 
1569
+ var omitCircularRefsReplacer = function omitCircularRefsReplacer(replacer) {
1570
+ var known = new WeakSet();
1571
+ return function (_, value) {
1572
+ if (replacer) {
1573
+ value = replacer(_, value);
1574
+ }
1575
+ if (typeof value === 'object' && value !== null) {
1576
+ if (known.has(value)) {
1577
+ return;
1578
+ }
1579
+ known.add(value);
1580
+ }
1581
+ return value;
1582
+ };
1583
+ };
1584
+ var stringify = function stringify(object, replacer) {
1585
+ return JSON.stringify(object, omitCircularRefsReplacer(replacer));
1586
+ };
1587
+
1569
1588
  function getStartCodecTier(codecTiers, currentVideoRange, currentBw, audioPreference, videoPreference) {
1570
1589
  var codecSets = Object.keys(codecTiers);
1571
1590
  var channelsPreference = audioPreference == null ? void 0 : audioPreference.channels;
@@ -1653,7 +1672,7 @@
1653
1672
  if (!videoRanges.some(function (range) {
1654
1673
  return candidateTier.videoRanges[range] > 0;
1655
1674
  })) {
1656
- logStartCodecCandidateIgnored(candidate, "no variants with VIDEO-RANGE of " + JSON.stringify(videoRanges) + " found");
1675
+ logStartCodecCandidateIgnored(candidate, "no variants with VIDEO-RANGE of " + stringify(videoRanges) + " found");
1657
1676
  return selected;
1658
1677
  }
1659
1678
  if (videoCodecPreference && candidate.indexOf(videoCodecPreference.substring(0, 4)) % 5 !== 0) {
@@ -2238,7 +2257,7 @@
2238
2257
  currentVideoRange = preferHDR ? videoRanges[videoRanges.length - 1] : videoRanges[0];
2239
2258
  currentFrameRate = minFramerate;
2240
2259
  currentBw = Math.max(currentBw, minBitrate);
2241
- this.log("picked start tier " + JSON.stringify(startTier));
2260
+ this.log("picked start tier " + stringify(startTier));
2242
2261
  } else {
2243
2262
  currentCodecSet = level == null ? void 0 : level.codecSet;
2244
2263
  currentVideoRange = level == null ? void 0 : level.videoRange;
@@ -4051,9 +4070,9 @@
4051
4070
  this.log("attachTransferred: waiting for SourceBuffer track info");
4052
4071
  return;
4053
4072
  }
4054
- this.log("attachTransferred: (bufferCodecEventsTotal " + this.bufferCodecEventsTotal + ")\nrequired tracks: " + JSON.stringify(requiredTracks, function (key, value) {
4073
+ this.log("attachTransferred: (bufferCodecEventsTotal " + this.bufferCodecEventsTotal + ")\nrequired tracks: " + stringify(requiredTracks, function (key, value) {
4055
4074
  return key === 'initSegment' ? undefined : value;
4056
- }) + ";\ntransfer tracks: " + JSON.stringify(transferredTracks, function (key, value) {
4075
+ }) + ";\ntransfer tracks: " + stringify(transferredTracks, function (key, value) {
4057
4076
  return key === 'initSegment' ? undefined : value;
4058
4077
  }) + "}");
4059
4078
  if (!isCompatibleTrackChange(transferredTracks, requiredTracks)) {
@@ -4844,7 +4863,7 @@
4844
4863
  var bufferCodecEventsTotal = this.bufferCodecEventsTotal,
4845
4864
  pendingTrackCount = this.pendingTrackCount,
4846
4865
  tracks = this.tracks;
4847
- this.log("checkPendingTracks (pending: " + pendingTrackCount + " codec events expected: " + bufferCodecEventsTotal + ") " + JSON.stringify(tracks));
4866
+ this.log("checkPendingTracks (pending: " + pendingTrackCount + " codec events expected: " + bufferCodecEventsTotal + ") " + stringify(tracks));
4848
4867
  // Check if we've received all of the expected bufferCodec events. When none remain, create all the sourceBuffers at once.
4849
4868
  // This is important because the MSE spec allows implementations to throw QuotaExceededErrors if creating new sourceBuffers after
4850
4869
  // data has been appended to existing ones.
@@ -4913,7 +4932,7 @@
4913
4932
  var codec = this.getTrackCodec(track, type);
4914
4933
  var mimeType = track.container + ";codecs=" + codec;
4915
4934
  track.codec = codec;
4916
- this.log("creating sourceBuffer(" + mimeType + ")" + (this.currentOp(type) ? ' Queued' : '') + " " + JSON.stringify(track));
4935
+ this.log("creating sourceBuffer(" + mimeType + ")" + (this.currentOp(type) ? ' Queued' : '') + " " + stringify(track));
4917
4936
  try {
4918
4937
  var sb = mediaSource.addSourceBuffer(mimeType);
4919
4938
  var sbIndex = sourceBufferNameToIndex(type);
@@ -8189,7 +8208,7 @@
8189
8208
  dateRange.tagOrder += mergeCount;
8190
8209
  }
8191
8210
  } else {
8192
- logger.warn("Ignoring invalid Playlist Delta Update DATERANGE tag: \"" + JSON.stringify(deltaDateRanges[id].attr) + "\"");
8211
+ logger.warn("Ignoring invalid Playlist Delta Update DATERANGE tag: \"" + stringify(deltaDateRanges[id].attr) + "\"");
8193
8212
  }
8194
8213
  });
8195
8214
  }
@@ -8482,7 +8501,7 @@
8482
8501
  errorAction.resolved = this.pathwayId !== errorPathway;
8483
8502
  }
8484
8503
  if (!errorAction.resolved) {
8485
- this.warn("Could not resolve " + data.details + " (\"" + data.error.message + "\") with content-steering for Pathway: " + errorPathway + " levels: " + (levels ? levels.length : levels) + " priorities: " + JSON.stringify(pathwayPriority) + " penalized: " + JSON.stringify(this.penalizedPathways));
8504
+ this.warn("Could not resolve " + data.details + " (\"" + data.error.message + "\") with content-steering for Pathway: " + errorPathway + " levels: " + (levels ? levels.length : levels) + " priorities: " + stringify(pathwayPriority) + " penalized: " + stringify(this.penalizedPathways));
8486
8505
  }
8487
8506
  }
8488
8507
  };
@@ -15200,7 +15219,7 @@
15200
15219
  }
15201
15220
  });
15202
15221
  if (report.length) {
15203
- logger.warn("hls.js config: \"" + report.join('", "') + "\" setting(s) are deprecated, use \"" + policyName + "\": " + JSON.stringify(userConfig[policyName]));
15222
+ logger.warn("hls.js config: \"" + report.join('", "') + "\" setting(s) are deprecated, use \"" + policyName + "\": " + stringify(userConfig[policyName]));
15204
15223
  }
15205
15224
  });
15206
15225
  return _objectSpread2(_objectSpread2({}, defaultsCopy), userConfig);
@@ -18114,7 +18133,7 @@
18114
18133
  if (!stallReported && stalled !== null && media && hls) {
18115
18134
  // Report stalled error once
18116
18135
  this.stallReported = true;
18117
- var error = new Error("Playback stalling at @" + media.currentTime + " due to low buffer (" + JSON.stringify(bufferInfo) + ")");
18136
+ var error = new Error("Playback stalling at @" + media.currentTime + " due to low buffer (" + stringify(bufferInfo) + ")");
18118
18137
  this.warn(error.message);
18119
18138
  hls.trigger(Events.ERROR, {
18120
18139
  type: ErrorTypes.MEDIA_ERROR,
@@ -18397,7 +18416,7 @@
18397
18416
  cue.type = type;
18398
18417
  }
18399
18418
  } catch (e) {
18400
- cue = new Cue(startTime, endTime, JSON.stringify(type ? _objectSpread2({
18419
+ cue = new Cue(startTime, endTime, stringify(type ? _objectSpread2({
18401
18420
  type: type
18402
18421
  }, data) : data));
18403
18422
  }
@@ -19404,7 +19423,7 @@
19404
19423
  Promise.resolve().then(function () {
19405
19424
  if (_this3.hls) {
19406
19425
  if (data.levels.length) {
19407
- _this3.warn("One or more CODECS in variant not supported: " + JSON.stringify(data.levels[0].attrs));
19426
+ _this3.warn("One or more CODECS in variant not supported: " + stringify(data.levels[0].attrs));
19408
19427
  }
19409
19428
  var error = new Error('no level with compatible codecs found in manifest');
19410
19429
  _this3.hls.trigger(Events.ERROR, {
@@ -20004,7 +20023,7 @@
20004
20023
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
20005
20024
  }
20006
20025
 
20007
- var version = "1.6.0-beta.3.0.canary.10979";
20026
+ var version = "1.6.0-beta.3.0.canary.10980";
20008
20027
 
20009
20028
  // ensure the worker ends up in the bundle
20010
20029
  // If the worker should not be included this gets aliased to empty.js
@@ -20185,7 +20204,7 @@
20185
20204
  cmd: 'init',
20186
20205
  typeSupported: m2tsTypeSupported,
20187
20206
  id: id,
20188
- config: JSON.stringify(config)
20207
+ config: stringify(config)
20189
20208
  });
20190
20209
  } catch (err) {
20191
20210
  logger.warn("Error setting up \"" + id + "\" Web Worker, fallback to inline", err);
@@ -20213,7 +20232,7 @@
20213
20232
  resetNo: instanceNo,
20214
20233
  typeSupported: m2tsTypeSupported,
20215
20234
  id: this.id,
20216
- config: JSON.stringify(config)
20235
+ config: stringify(config)
20217
20236
  });
20218
20237
  }
20219
20238
  };