hls.js 1.6.6-0.canary.11354 → 1.6.6-0.canary.11356

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.11354"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11356"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -10267,7 +10267,7 @@ function requireEventemitter3 () {
10267
10267
  var eventemitter3Exports = requireEventemitter3();
10268
10268
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
10269
10269
 
10270
- const version = "1.6.6-0.canary.11354";
10270
+ const version = "1.6.6-0.canary.11356";
10271
10271
 
10272
10272
  // ensure the worker ends up in the bundle
10273
10273
  // If the worker should not be included this gets aliased to empty.js
@@ -17091,7 +17091,9 @@ class AudioStreamController extends BaseStreamController {
17091
17091
  if (data.parent !== 'audio') {
17092
17092
  return;
17093
17093
  }
17094
- this.resetLoadingState();
17094
+ if (!this.reduceLengthAndFlushBuffer(data)) {
17095
+ this.resetLoadingState();
17096
+ }
17095
17097
  break;
17096
17098
  case ErrorDetails.BUFFER_FULL_ERROR:
17097
17099
  if (data.parent !== 'audio') {
@@ -18747,7 +18749,7 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
18747
18749
  }
18748
18750
 
18749
18751
  // Block audio append until overlapping video append
18750
- const videoTrack = this.tracks.video;
18752
+ const videoTrack = tracks.video;
18751
18753
  const videoSb = videoTrack == null ? void 0 : videoTrack.buffer;
18752
18754
  if (videoSb && sn !== 'initSegment') {
18753
18755
  const partOrFrag = part || frag;
@@ -18779,16 +18781,14 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
18779
18781
  const operation = {
18780
18782
  label: `append-${type}`,
18781
18783
  execute: () => {
18784
+ var _this$tracks$type2;
18782
18785
  chunkStats.executeStart = self.performance.now();
18783
- const track = this.tracks[type];
18784
- if (track) {
18785
- const sb = track.buffer;
18786
- if (sb) {
18787
- if (checkTimestampOffset) {
18788
- this.updateTimestampOffset(sb, fragStart, 0.1, type, sn, cc);
18789
- } else if (offset !== undefined && isFiniteNumber(offset)) {
18790
- this.updateTimestampOffset(sb, offset, 0.000001, type, sn, cc);
18791
- }
18786
+ const sb = (_this$tracks$type2 = this.tracks[type]) == null ? void 0 : _this$tracks$type2.buffer;
18787
+ if (sb) {
18788
+ if (checkTimestampOffset) {
18789
+ this.updateTimestampOffset(sb, fragStart, 0.1, type, sn, cc);
18790
+ } else if (offset !== undefined && isFiniteNumber(offset)) {
18791
+ this.updateTimestampOffset(sb, offset, 0.000001, type, sn, cc);
18792
18792
  }
18793
18793
  }
18794
18794
  this.appendExecutor(data, type);
@@ -18844,7 +18844,7 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
18844
18844
  fatal: false
18845
18845
  };
18846
18846
  const mediaError = (_this$media = this.media) == null ? void 0 : _this$media.error;
18847
- if (error.code === DOMException.QUOTA_EXCEEDED_ERR) {
18847
+ if (error.code === DOMException.QUOTA_EXCEEDED_ERR || error.name == 'QuotaExceededError' || `quota` in error) {
18848
18848
  // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
18849
18849
  // let's stop appending any segments, and report BUFFER_FULL_ERROR error
18850
18850
  event.details = ErrorDetails.BUFFER_FULL_ERROR;
@@ -18950,8 +18950,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
18950
18950
  }
18951
18951
  get bufferedToEnd() {
18952
18952
  return this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
18953
- var _this$tracks$type2, _this$tracks$type3;
18954
- return type && (!((_this$tracks$type2 = this.tracks[type]) != null && _this$tracks$type2.ended) || ((_this$tracks$type3 = this.tracks[type]) == null ? void 0 : _this$tracks$type3.ending));
18953
+ var _this$tracks$type3, _this$tracks$type4;
18954
+ return type && (!((_this$tracks$type3 = this.tracks[type]) != null && _this$tracks$type3.ended) || ((_this$tracks$type4 = this.tracks[type]) == null ? void 0 : _this$tracks$type4.ending));
18955
18955
  });
18956
18956
  }
18957
18957
 
@@ -18973,8 +18973,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
18973
18973
  });
18974
18974
  const allowEndOfStream = ((_this$overrides = this.overrides) == null ? void 0 : _this$overrides.endOfStream) !== false;
18975
18975
  const allTracksEnding = this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
18976
- var _this$tracks$type4;
18977
- return type && !((_this$tracks$type4 = this.tracks[type]) != null && _this$tracks$type4.ended);
18976
+ var _this$tracks$type5;
18977
+ return type && !((_this$tracks$type5 = this.tracks[type]) != null && _this$tracks$type5.ended);
18978
18978
  });
18979
18979
  if (allTracksEnding) {
18980
18980
  if (allowEndOfStream) {
@@ -19496,8 +19496,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
19496
19496
  }
19497
19497
  stepOperationQueue(bufferNames) {
19498
19498
  bufferNames.forEach(type => {
19499
- var _this$tracks$type5;
19500
- const sb = (_this$tracks$type5 = this.tracks[type]) == null ? void 0 : _this$tracks$type5.buffer;
19499
+ var _this$tracks$type6;
19500
+ const sb = (_this$tracks$type6 = this.tracks[type]) == null ? void 0 : _this$tracks$type6.buffer;
19501
19501
  // Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
19502
19502
  // true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
19503
19503
  // While this is a workaround, it's probably useful to have around
@@ -21310,7 +21310,11 @@ class ContentSteeringController extends Logger {
21310
21310
  this.updatePathwayPriority(pathwayPriority);
21311
21311
  errorAction.resolved = this.pathwayId !== errorPathway;
21312
21312
  }
21313
- if (!errorAction.resolved) {
21313
+ if (data.details === ErrorDetails.BUFFER_APPEND_ERROR && !data.fatal) {
21314
+ // Error will become fatal in buffer-controller when reaching `appendErrorMaxRetry`
21315
+ // Stream-controllers are expected to reduce buffer length even if this is not deemed a QuotaExceededError
21316
+ errorAction.resolved = true;
21317
+ } else if (!errorAction.resolved) {
21314
21318
  this.warn(`Could not resolve ${data.details} ("${data.error.message}") with content-steering for Pathway: ${errorPathway} levels: ${levels ? levels.length : levels} priorities: ${stringify(pathwayPriority)} penalized: ${stringify(this.penalizedPathways)}`);
21315
21319
  }
21316
21320
  }
@@ -33231,7 +33235,9 @@ class StreamController extends BaseStreamController {
33231
33235
  if (data.parent !== 'main') {
33232
33236
  return;
33233
33237
  }
33234
- this.resetLoadingState();
33238
+ if (this.reduceLengthAndFlushBuffer(data)) {
33239
+ this.resetLoadingState();
33240
+ }
33235
33241
  break;
33236
33242
  case ErrorDetails.BUFFER_FULL_ERROR:
33237
33243
  if (data.parent !== 'main') {