hls.js 1.6.0-beta.3.0.canary.10973 → 1.6.0-beta.3.0.canary.10976

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.mjs CHANGED
@@ -402,7 +402,7 @@ function enableLogs(debugConfig, context, id) {
402
402
  // Some browsers don't allow to use bind on console object anyway
403
403
  // fallback to default if needed
404
404
  try {
405
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10973"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10976"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -9887,7 +9887,7 @@ var eventemitter3 = {exports: {}};
9887
9887
  var eventemitter3Exports = eventemitter3.exports;
9888
9888
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9889
9889
 
9890
- const version = "1.6.0-beta.3.0.canary.10973";
9890
+ const version = "1.6.0-beta.3.0.canary.10976";
9891
9891
 
9892
9892
  // ensure the worker ends up in the bundle
9893
9893
  // If the worker should not be included this gets aliased to empty.js
@@ -23685,6 +23685,20 @@ function removeEventListener(el, type, listener) {
23685
23685
  el.removeEventListener(type, listener);
23686
23686
  }
23687
23687
 
23688
+ const replacer = () => {
23689
+ const known = new WeakSet();
23690
+ return (_, value) => {
23691
+ if (typeof value === 'object' && value !== null) {
23692
+ if (known.has(value)) {
23693
+ return;
23694
+ }
23695
+ known.add(value);
23696
+ }
23697
+ return value;
23698
+ };
23699
+ };
23700
+ const stringify = object => JSON.stringify(object, replacer());
23701
+
23688
23702
  function playWithCatch(media) {
23689
23703
  media == null ? void 0 : media.play().catch(() => {
23690
23704
  /* no-op */
@@ -24343,7 +24357,7 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
24343
24357
  }
24344
24358
  }
24345
24359
  const attachMediaSourceData = player.transferMedia();
24346
- this.log(`transfer MediaSource from ${player} ${JSON.stringify(attachMediaSourceData)}`);
24360
+ this.log(`transfer MediaSource from ${player} ${stringify(attachMediaSourceData)}`);
24347
24361
  this.detachedData = attachMediaSourceData;
24348
24362
  } else if (toSegment && playerMedia) {
24349
24363
  this.shouldPlay || (this.shouldPlay = !playerMedia.paused);
@@ -24371,11 +24385,11 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
24371
24385
  logFromSource = `<unknown>`;
24372
24386
  }
24373
24387
  this.log(`transferring to ${isAssetPlayer ? player : 'Primary'}
24374
- MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24388
+ MediaSource ${stringify(attachMediaSourceData)} from ${logFromSource}`);
24375
24389
  if (!attachMediaSourceData) {
24376
24390
  if (detachedMediaSource) {
24377
24391
  attachMediaSourceData = this.detachedData;
24378
- this.log(`using detachedData: MediaSource ${JSON.stringify(attachMediaSourceData)}`);
24392
+ this.log(`using detachedData: MediaSource ${stringify(attachMediaSourceData)}`);
24379
24393
  } else if (!this.detachedData || this.hls.media === media) {
24380
24394
  // Media is attaching when `detachedData` and `hls.media` are populated. Detach to clear the MediaSource.
24381
24395
  this.hls.detachMedia();