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.
@@ -344,11 +344,12 @@ export default class BaseStreamController
344
344
  currentTime,
345
345
  config.maxBufferHole,
346
346
  );
347
+ const noFowardBuffer = !bufferInfo.len;
347
348
 
348
349
  this.log(
349
- `media seeking to ${
350
+ `Media seeking to ${
350
351
  Number.isFinite(currentTime) ? currentTime.toFixed(3) : currentTime
351
- }, state: ${state}`,
352
+ }, state: ${state}, ${noFowardBuffer ? 'out of' : 'in'} buffer`,
352
353
  );
353
354
 
354
355
  if (this.state === State.ENDED) {
@@ -361,7 +362,7 @@ export default class BaseStreamController
361
362
  fragCurrent.start + fragCurrent.duration + tolerance;
362
363
  // if seeking out of buffered range or into new one
363
364
  if (
364
- !bufferInfo.len ||
365
+ noFowardBuffer ||
365
366
  fragEndOffset < bufferInfo.start ||
366
367
  fragStartOffset > bufferInfo.end
367
368
  ) {
@@ -370,7 +371,7 @@ export default class BaseStreamController
370
371
  if (currentTime < fragStartOffset || pastFragment) {
371
372
  if (pastFragment && fragCurrent.loader) {
372
373
  this.log(
373
- 'seeking outside of buffer while fragment load in progress, cancel fragment load',
374
+ `Cancelling fragment load for seek (sn: ${fragCurrent.sn})`,
374
375
  );
375
376
  fragCurrent.abortRequests();
376
377
  this.resetLoadingState();
@@ -413,11 +414,14 @@ export default class BaseStreamController
413
414
  }
414
415
 
415
416
  // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target
416
- if (!this.hls.hasEnoughToStart && !bufferInfo.len) {
417
+ if (!this.hls.hasEnoughToStart) {
417
418
  this.log(
418
- `setting startPosition to ${currentTime} because of seek before start`,
419
+ `Setting ${noFowardBuffer ? 'startPosition' : 'nextLoadPosition'} to ${currentTime} for seek without enough to start`,
419
420
  );
420
- this.nextLoadPosition = this.startPosition = currentTime;
421
+ this.nextLoadPosition = currentTime;
422
+ if (noFowardBuffer) {
423
+ this.startPosition = currentTime;
424
+ }
421
425
  }
422
426
 
423
427
  // Async tick to speed up processing
@@ -1777,7 +1781,7 @@ export default class BaseStreamController
1777
1781
  isMediaFragment(frag) &&
1778
1782
  frag.stats.aborted
1779
1783
  ) {
1780
- this.warn(
1784
+ this.log(
1781
1785
  `Fragment ${frag.sn}${part ? ' part ' + part.index : ''} of ${this.playlistLabel()} ${
1782
1786
  frag.level
1783
1787
  } was aborted`,