hls.js 1.6.6-0.canary.11355 → 1.6.6

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.11355"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -10121,7 +10121,7 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10121
10121
  }
10122
10122
 
10123
10123
  // Block audio append until overlapping video append
10124
- const videoTrack = this.tracks.video;
10124
+ const videoTrack = tracks.video;
10125
10125
  const videoSb = videoTrack == null ? void 0 : videoTrack.buffer;
10126
10126
  if (videoSb && sn !== 'initSegment') {
10127
10127
  const partOrFrag = part || frag;
@@ -10153,16 +10153,14 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10153
10153
  const operation = {
10154
10154
  label: `append-${type}`,
10155
10155
  execute: () => {
10156
+ var _this$tracks$type2;
10156
10157
  chunkStats.executeStart = self.performance.now();
10157
- const track = this.tracks[type];
10158
- if (track) {
10159
- const sb = track.buffer;
10160
- if (sb) {
10161
- if (checkTimestampOffset) {
10162
- this.updateTimestampOffset(sb, fragStart, 0.1, type, sn, cc);
10163
- } else if (offset !== undefined && isFiniteNumber(offset)) {
10164
- this.updateTimestampOffset(sb, offset, 0.000001, type, sn, cc);
10165
- }
10158
+ const sb = (_this$tracks$type2 = this.tracks[type]) == null ? void 0 : _this$tracks$type2.buffer;
10159
+ if (sb) {
10160
+ if (checkTimestampOffset) {
10161
+ this.updateTimestampOffset(sb, fragStart, 0.1, type, sn, cc);
10162
+ } else if (offset !== undefined && isFiniteNumber(offset)) {
10163
+ this.updateTimestampOffset(sb, offset, 0.000001, type, sn, cc);
10166
10164
  }
10167
10165
  }
10168
10166
  this.appendExecutor(data, type);
@@ -10218,7 +10216,7 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10218
10216
  fatal: false
10219
10217
  };
10220
10218
  const mediaError = (_this$media = this.media) == null ? void 0 : _this$media.error;
10221
- if (error.code === DOMException.QUOTA_EXCEEDED_ERR) {
10219
+ if (error.code === DOMException.QUOTA_EXCEEDED_ERR || error.name == 'QuotaExceededError' || `quota` in error) {
10222
10220
  // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
10223
10221
  // let's stop appending any segments, and report BUFFER_FULL_ERROR error
10224
10222
  event.details = ErrorDetails.BUFFER_FULL_ERROR;
@@ -10324,8 +10322,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10324
10322
  }
10325
10323
  get bufferedToEnd() {
10326
10324
  return this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
10327
- var _this$tracks$type2, _this$tracks$type3;
10328
- 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));
10325
+ var _this$tracks$type3, _this$tracks$type4;
10326
+ 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));
10329
10327
  });
10330
10328
  }
10331
10329
 
@@ -10347,8 +10345,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10347
10345
  });
10348
10346
  const allowEndOfStream = ((_this$overrides = this.overrides) == null ? void 0 : _this$overrides.endOfStream) !== false;
10349
10347
  const allTracksEnding = this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
10350
- var _this$tracks$type4;
10351
- return type && !((_this$tracks$type4 = this.tracks[type]) != null && _this$tracks$type4.ended);
10348
+ var _this$tracks$type5;
10349
+ return type && !((_this$tracks$type5 = this.tracks[type]) != null && _this$tracks$type5.ended);
10352
10350
  });
10353
10351
  if (allTracksEnding) {
10354
10352
  if (allowEndOfStream) {
@@ -10870,8 +10868,8 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10870
10868
  }
10871
10869
  stepOperationQueue(bufferNames) {
10872
10870
  bufferNames.forEach(type => {
10873
- var _this$tracks$type5;
10874
- const sb = (_this$tracks$type5 = this.tracks[type]) == null ? void 0 : _this$tracks$type5.buffer;
10871
+ var _this$tracks$type6;
10872
+ const sb = (_this$tracks$type6 = this.tracks[type]) == null ? void 0 : _this$tracks$type6.buffer;
10875
10873
  // Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
10876
10874
  // true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
10877
10875
  // While this is a workaround, it's probably useful to have around
@@ -11346,7 +11344,11 @@ class ContentSteeringController extends Logger {
11346
11344
  this.updatePathwayPriority(pathwayPriority);
11347
11345
  errorAction.resolved = this.pathwayId !== errorPathway;
11348
11346
  }
11349
- if (!errorAction.resolved) {
11347
+ if (data.details === ErrorDetails.BUFFER_APPEND_ERROR && !data.fatal) {
11348
+ // Error will become fatal in buffer-controller when reaching `appendErrorMaxRetry`
11349
+ // Stream-controllers are expected to reduce buffer length even if this is not deemed a QuotaExceededError
11350
+ errorAction.resolved = true;
11351
+ } else if (!errorAction.resolved) {
11350
11352
  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)}`);
11351
11353
  }
11352
11354
  }
@@ -19891,7 +19893,7 @@ function assignTrackIdsByGroup(tracks) {
19891
19893
  });
19892
19894
  }
19893
19895
 
19894
- const version = "1.6.6-0.canary.11355";
19896
+ const version = "1.6.6";
19895
19897
 
19896
19898
  // ensure the worker ends up in the bundle
19897
19899
  // If the worker should not be included this gets aliased to empty.js
@@ -21070,7 +21072,9 @@ class StreamController extends BaseStreamController {
21070
21072
  if (data.parent !== 'main') {
21071
21073
  return;
21072
21074
  }
21073
- this.resetLoadingState();
21075
+ if (this.reduceLengthAndFlushBuffer(data)) {
21076
+ this.resetLoadingState();
21077
+ }
21074
21078
  break;
21075
21079
  case ErrorDetails.BUFFER_FULL_ERROR:
21076
21080
  if (data.parent !== 'main') {