hls.js 1.6.0-beta.3.0.canary.10976 → 1.6.0-beta.3.0.canary.10979

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
@@ -402,7 +402,7 @@ function enableLogs(debugConfig, context, id) {
402
402
  // Some browsers don't allow to use bind on console object anyway
403
403
  // fallback to default if needed
404
404
  try {
405
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10976"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10979"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -1973,16 +1973,19 @@ class AbrController extends Logger {
1973
1973
  return -1;
1974
1974
  }
1975
1975
  set nextAutoLevel(nextLevel) {
1976
- const {
1977
- maxAutoLevel,
1978
- minAutoLevel
1979
- } = this.hls;
1980
- const value = Math.min(Math.max(nextLevel, minAutoLevel), maxAutoLevel);
1976
+ const value = this.deriveNextAutoLevel(nextLevel);
1981
1977
  if (this._nextAutoLevel !== value) {
1982
1978
  this.nextAutoLevelKey = '';
1983
1979
  this._nextAutoLevel = value;
1984
1980
  }
1985
1981
  }
1982
+ deriveNextAutoLevel(nextLevel) {
1983
+ const {
1984
+ maxAutoLevel,
1985
+ minAutoLevel
1986
+ } = this.hls;
1987
+ return Math.min(Math.max(nextLevel, minAutoLevel), maxAutoLevel);
1988
+ }
1986
1989
  }
1987
1990
 
1988
1991
  const BinarySearch = {
@@ -9887,7 +9890,7 @@ var eventemitter3 = {exports: {}};
9887
9890
  var eventemitter3Exports = eventemitter3.exports;
9888
9891
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9889
9892
 
9890
- const version = "1.6.0-beta.3.0.canary.10976";
9893
+ const version = "1.6.0-beta.3.0.canary.10979";
9891
9894
 
9892
9895
  // ensure the worker ends up in the bundle
9893
9896
  // If the worker should not be included this gets aliased to empty.js
@@ -10391,51 +10394,6 @@ function decodeId3UrlFrame(frame) {
10391
10394
  };
10392
10395
  }
10393
10396
 
10394
- function toUint8(data, offset = 0, length = Infinity) {
10395
- return view(data, offset, length, Uint8Array);
10396
- }
10397
- function view(data, offset, length, Type) {
10398
- const buffer = unsafeGetArrayBuffer(data);
10399
- let bytesPerElement = 1;
10400
- if ('BYTES_PER_ELEMENT' in Type) {
10401
- bytesPerElement = Type.BYTES_PER_ELEMENT;
10402
- }
10403
- // Absolute end of the |data| view within |buffer|.
10404
- const dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
10405
- const dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
10406
- // Absolute start of the result within |buffer|.
10407
- const rawStart = (dataOffset + offset) / bytesPerElement;
10408
- const start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
10409
- // Absolute end of the result within |buffer|.
10410
- const end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
10411
- return new Type(buffer, start, end - start);
10412
- }
10413
- function unsafeGetArrayBuffer(view) {
10414
- if (view instanceof ArrayBuffer) {
10415
- return view;
10416
- } else {
10417
- return view.buffer;
10418
- }
10419
- }
10420
- function isArrayBufferView(obj) {
10421
- return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
10422
- }
10423
-
10424
- function toArrayBuffer(view) {
10425
- if (view instanceof ArrayBuffer) {
10426
- return view;
10427
- } else {
10428
- if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
10429
- // This is a TypedArray over the whole buffer.
10430
- return view.buffer;
10431
- }
10432
- // This is a 'view' on the buffer. Create a new buffer that only contains
10433
- // the data. Note that since this isn't an ArrayBuffer, the 'new' call
10434
- // will allocate a new buffer to hold the copy.
10435
- return new Uint8Array(view).buffer;
10436
- }
10437
- }
10438
-
10439
10397
  /**
10440
10398
  * Encodes binary data to base64
10441
10399
  *
@@ -10540,6 +10498,51 @@ function uuid() {
10540
10498
  }
10541
10499
  }
10542
10500
 
10501
+ function toArrayBuffer(view) {
10502
+ if (view instanceof ArrayBuffer) {
10503
+ return view;
10504
+ } else {
10505
+ if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
10506
+ // This is a TypedArray over the whole buffer.
10507
+ return view.buffer;
10508
+ }
10509
+ // This is a 'view' on the buffer. Create a new buffer that only contains
10510
+ // the data. Note that since this isn't an ArrayBuffer, the 'new' call
10511
+ // will allocate a new buffer to hold the copy.
10512
+ return new Uint8Array(view).buffer;
10513
+ }
10514
+ }
10515
+
10516
+ function toUint8(data, offset = 0, length = Infinity) {
10517
+ return view(data, offset, length, Uint8Array);
10518
+ }
10519
+ function view(data, offset, length, Type) {
10520
+ const buffer = unsafeGetArrayBuffer(data);
10521
+ let bytesPerElement = 1;
10522
+ if ('BYTES_PER_ELEMENT' in Type) {
10523
+ bytesPerElement = Type.BYTES_PER_ELEMENT;
10524
+ }
10525
+ // Absolute end of the |data| view within |buffer|.
10526
+ const dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
10527
+ const dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
10528
+ // Absolute start of the result within |buffer|.
10529
+ const rawStart = (dataOffset + offset) / bytesPerElement;
10530
+ const start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
10531
+ // Absolute end of the result within |buffer|.
10532
+ const end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
10533
+ return new Type(buffer, start, end - start);
10534
+ }
10535
+ function unsafeGetArrayBuffer(view) {
10536
+ if (view instanceof ArrayBuffer) {
10537
+ return view;
10538
+ } else {
10539
+ return view.buffer;
10540
+ }
10541
+ }
10542
+ function isArrayBufferView(obj) {
10543
+ return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
10544
+ }
10545
+
10543
10546
  function decodeId3ImageFrame(frame) {
10544
10547
  const metadataFrame = {
10545
10548
  key: frame.type,