hls.js 1.6.6-0.canary.11331 → 1.6.6-0.canary.11334

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
@@ -523,7 +523,7 @@ function enableLogs(debugConfig, context, id) {
523
523
  // Some browsers don't allow to use bind on console object anyway
524
524
  // fallback to default if needed
525
525
  try {
526
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11331"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11334"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -10250,7 +10250,7 @@ function requireEventemitter3 () {
10250
10250
  var eventemitter3Exports = requireEventemitter3();
10251
10251
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
10252
10252
 
10253
- const version = "1.6.6-0.canary.11331";
10253
+ const version = "1.6.6-0.canary.11334";
10254
10254
 
10255
10255
  // ensure the worker ends up in the bundle
10256
10256
  // If the worker should not be included this gets aliased to empty.js
@@ -26372,10 +26372,12 @@ class SubtitleStreamController extends BaseStreamController {
26372
26372
  frag,
26373
26373
  success
26374
26374
  } = data;
26375
- if (isMediaFragment(frag)) {
26376
- this.fragPrevious = frag;
26375
+ if (!this.fragContextChanged(frag)) {
26376
+ if (isMediaFragment(frag)) {
26377
+ this.fragPrevious = frag;
26378
+ }
26379
+ this.state = State.IDLE;
26377
26380
  }
26378
- this.state = State.IDLE;
26379
26381
  if (!success) {
26380
26382
  return;
26381
26383
  }
@@ -26515,8 +26517,12 @@ class SubtitleStreamController extends BaseStreamController {
26515
26517
  this.mediaBuffer = this.mediaBufferTimeRanges;
26516
26518
  let sliding = 0;
26517
26519
  if (newDetails.live || (_track$details = track.details) != null && _track$details.live) {
26520
+ if (newDetails.deltaUpdateFailed) {
26521
+ return;
26522
+ }
26518
26523
  const mainDetails = this.mainDetails;
26519
- if (newDetails.deltaUpdateFailed || !mainDetails) {
26524
+ if (!mainDetails) {
26525
+ this.startFragRequested = false;
26520
26526
  return;
26521
26527
  }
26522
26528
  const mainSlidingStartFragment = mainDetails.fragments[0];
@@ -26538,6 +26544,10 @@ class SubtitleStreamController extends BaseStreamController {
26538
26544
  addSliding(newDetails, sliding);
26539
26545
  }
26540
26546
  }
26547
+ // compute start position if we are aligned with the main playlist
26548
+ if (mainDetails && !this.startFragRequested) {
26549
+ this.setStartPosition(mainDetails, sliding);
26550
+ }
26541
26551
  }
26542
26552
  track.details = newDetails;
26543
26553
  this.levelLastLoaded = track;
@@ -29114,8 +29124,16 @@ class TimelineController {
29114
29124
  // Parse any unparsed fragments upon receiving the initial PTS.
29115
29125
  if (unparsedVttFrags.length) {
29116
29126
  this.unparsedVttFrags = [];
29117
- unparsedVttFrags.forEach(frag => {
29118
- this.onFragLoaded(Events.FRAG_LOADED, frag);
29127
+ unparsedVttFrags.forEach(data => {
29128
+ if (this.initPTS[data.frag.cc]) {
29129
+ this.onFragLoaded(Events.FRAG_LOADED, data);
29130
+ } else {
29131
+ this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED, {
29132
+ success: false,
29133
+ frag: data.frag,
29134
+ error: new Error('Subtitle discontinuity domain does not match main')
29135
+ });
29136
+ }
29119
29137
  });
29120
29138
  }
29121
29139
  }