hls.js 1.6.6-0.canary.11346 → 1.6.6-0.canary.11349

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.
@@ -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.11346"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11349"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -7891,7 +7891,8 @@ class BaseStreamController extends TaskLoop {
7891
7891
  } = this;
7892
7892
  const currentTime = media ? media.currentTime : 0;
7893
7893
  const bufferInfo = BufferHelper.bufferInfo(mediaBuffer ? mediaBuffer : media, currentTime, config.maxBufferHole);
7894
- this.log(`media seeking to ${isFiniteNumber(currentTime) ? currentTime.toFixed(3) : currentTime}, state: ${state}`);
7894
+ const noFowardBuffer = !bufferInfo.len;
7895
+ this.log(`Media seeking to ${isFiniteNumber(currentTime) ? currentTime.toFixed(3) : currentTime}, state: ${state}, ${noFowardBuffer ? 'out of' : 'in'} buffer`);
7895
7896
  if (this.state === State.ENDED) {
7896
7897
  this.resetLoadingState();
7897
7898
  } else if (fragCurrent) {
@@ -7900,12 +7901,12 @@ class BaseStreamController extends TaskLoop {
7900
7901
  const fragStartOffset = fragCurrent.start - tolerance;
7901
7902
  const fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;
7902
7903
  // if seeking out of buffered range or into new one
7903
- if (!bufferInfo.len || fragEndOffset < bufferInfo.start || fragStartOffset > bufferInfo.end) {
7904
+ if (noFowardBuffer || fragEndOffset < bufferInfo.start || fragStartOffset > bufferInfo.end) {
7904
7905
  const pastFragment = currentTime > fragEndOffset;
7905
7906
  // if the seek position is outside the current fragment range
7906
7907
  if (currentTime < fragStartOffset || pastFragment) {
7907
7908
  if (pastFragment && fragCurrent.loader) {
7908
- this.log('seeking outside of buffer while fragment load in progress, cancel fragment load');
7909
+ this.log(`Cancelling fragment load for seek (sn: ${fragCurrent.sn})`);
7909
7910
  fragCurrent.abortRequests();
7910
7911
  this.resetLoadingState();
7911
7912
  }
@@ -7933,9 +7934,12 @@ class BaseStreamController extends TaskLoop {
7933
7934
  }
7934
7935
 
7935
7936
  // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target
7936
- if (!this.hls.hasEnoughToStart && !bufferInfo.len) {
7937
- this.log(`setting startPosition to ${currentTime} because of seek before start`);
7938
- this.nextLoadPosition = this.startPosition = currentTime;
7937
+ if (!this.hls.hasEnoughToStart) {
7938
+ this.log(`Setting ${noFowardBuffer ? 'startPosition' : 'nextLoadPosition'} to ${currentTime} for seek without enough to start`);
7939
+ this.nextLoadPosition = currentTime;
7940
+ if (noFowardBuffer) {
7941
+ this.startPosition = currentTime;
7942
+ }
7939
7943
  }
7940
7944
 
7941
7945
  // Async tick to speed up processing
@@ -9038,7 +9042,7 @@ class BaseStreamController extends TaskLoop {
9038
9042
  }
9039
9043
  handleFragLoadAborted(frag, part) {
9040
9044
  if (this.transmuxer && frag.type === this.playlistType && isMediaFragment(frag) && frag.stats.aborted) {
9041
- this.warn(`Fragment ${frag.sn}${part ? ' part ' + part.index : ''} of ${this.playlistLabel()} ${frag.level} was aborted`);
9045
+ this.log(`Fragment ${frag.sn}${part ? ' part ' + part.index : ''} of ${this.playlistLabel()} ${frag.level} was aborted`);
9042
9046
  this.resetFragmentLoading(frag);
9043
9047
  }
9044
9048
  }
@@ -19883,7 +19887,7 @@ function assignTrackIdsByGroup(tracks) {
19883
19887
  });
19884
19888
  }
19885
19889
 
19886
- const version = "1.6.6-0.canary.11346";
19890
+ const version = "1.6.6-0.canary.11349";
19887
19891
 
19888
19892
  // ensure the worker ends up in the bundle
19889
19893
  // If the worker should not be included this gets aliased to empty.js