hls.js 1.6.0-beta.2.0.canary.10830 → 1.6.0-beta.2.0.canary.10833

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.
@@ -401,7 +401,7 @@ function enableLogs(debugConfig, context, id) {
401
401
  // Some browsers don't allow to use bind on console object anyway
402
402
  // fallback to default if needed
403
403
  try {
404
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10830"}`);
404
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10833"}`);
405
405
  } catch (e) {
406
406
  /* log fn threw an exception. All logger methods are no-ops. */
407
407
  return createLogger();
@@ -7691,12 +7691,20 @@ class BaseStreamController extends TaskLoop {
7691
7691
  this.buffering = true;
7692
7692
  }
7693
7693
  _streamEnded(bufferInfo, levelDetails) {
7694
- // If playlist is live, there is another buffered range after the current range, nothing buffered, media is detached,
7695
- // of nothing loading/loaded return false
7696
- const hasTimelineOffset = this.config.timelineOffset !== undefined;
7694
+ // Stream is never "ended" when playlist is live or media is detached
7695
+ if (levelDetails.live || !this.media) {
7696
+ return false;
7697
+ }
7698
+ // Stream is not "ended" when nothing is buffered past the start
7699
+ const bufferEnd = bufferInfo.end || 0;
7700
+ const timelineStart = this.config.timelineOffset || 0;
7701
+ if (bufferEnd <= timelineStart) {
7702
+ return false;
7703
+ }
7704
+ // Stream is not "ended" when there is a second buffered range starting before the end of the playlist
7697
7705
  const nextStart = bufferInfo.nextStart;
7698
- const hasSecondBufferedRange = nextStart && (!hasTimelineOffset || nextStart < levelDetails.edge);
7699
- if (levelDetails.live || hasSecondBufferedRange || !bufferInfo.end || !this.media) {
7706
+ const hasSecondBufferedRange = nextStart && nextStart > timelineStart && nextStart < levelDetails.edge;
7707
+ if (hasSecondBufferedRange) {
7700
7708
  return false;
7701
7709
  }
7702
7710
  const partList = levelDetails.partList;
@@ -19172,7 +19180,7 @@ class GapController extends Logger {
19172
19180
  }
19173
19181
  }
19174
19182
 
19175
- const version = "1.6.0-beta.2.0.canary.10830";
19183
+ const version = "1.6.0-beta.2.0.canary.10833";
19176
19184
 
19177
19185
  // ensure the worker ends up in the bundle
19178
19186
  // If the worker should not be included this gets aliased to empty.js