hls.js 1.6.0-beta.4.0.canary.11051 → 1.6.0-beta.4.0.canary.11056

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.4.0.canary.11051"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.4.0.canary.11056"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -528,12 +528,6 @@ const Hex = {
528
528
  }
529
529
  };
530
530
 
531
- function sliceUint8(array, start, end) {
532
- // @ts-expect-error This polyfills IE11 usage of Uint8Array slice.
533
- // It always exists in the TypeScript definition so fails, but it fails at runtime on IE11.
534
- return Uint8Array.prototype.slice ? array.slice(start, end) : new Uint8Array(Array.prototype.slice.call(array, start, end));
535
- }
536
-
537
531
  function getDefaultExportFromCjs (x) {
538
532
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
539
533
  }
@@ -1805,8 +1799,8 @@ function segmentValidRange(data) {
1805
1799
  }
1806
1800
  const last = moofs[moofs.length - 1];
1807
1801
  // Offset by 8 bytes; findBox offsets the start by as much
1808
- segmentedRange.valid = sliceUint8(data, 0, last.byteOffset - 8);
1809
- segmentedRange.remainder = sliceUint8(data, last.byteOffset - 8);
1802
+ segmentedRange.valid = data.slice(0, last.byteOffset - 8);
1803
+ segmentedRange.remainder = data.slice(last.byteOffset - 8);
1810
1804
  return segmentedRange;
1811
1805
  }
1812
1806
  function appendUint8Array(data1, data2) {
@@ -5007,7 +5001,7 @@ function removePadding(array) {
5007
5001
  const outputBytes = array.byteLength;
5008
5002
  const paddingBytes = outputBytes && new DataView(array.buffer).getUint8(outputBytes - 1);
5009
5003
  if (paddingBytes) {
5010
- return sliceUint8(array, 0, outputBytes - paddingBytes);
5004
+ return array.slice(0, outputBytes - paddingBytes);
5011
5005
  }
5012
5006
  return array;
5013
5007
  }
@@ -5383,7 +5377,7 @@ class Decrypter {
5383
5377
  softwareDecrypter.expandKey(key);
5384
5378
  const result = currentResult;
5385
5379
  this.currentResult = softwareDecrypter.decrypt(currentChunk.buffer, 0, iv);
5386
- this.currentIV = sliceUint8(currentChunk, -16).buffer;
5380
+ this.currentIV = currentChunk.slice(-16).buffer;
5387
5381
  if (!result) {
5388
5382
  return null;
5389
5383
  }
@@ -5427,8 +5421,8 @@ class Decrypter {
5427
5421
  let currentChunk = data;
5428
5422
  const splitPoint = data.length - data.length % CHUNK_SIZE;
5429
5423
  if (splitPoint !== data.length) {
5430
- currentChunk = sliceUint8(data, 0, splitPoint);
5431
- this.remainderData = sliceUint8(data, splitPoint);
5424
+ currentChunk = data.slice(0, splitPoint);
5425
+ this.remainderData = data.slice(splitPoint);
5432
5426
  }
5433
5427
  return currentChunk;
5434
5428
  }
@@ -8251,8 +8245,6 @@ class BaseStreamController extends TaskLoop {
8251
8245
  this.onTickEnd();
8252
8246
  }
8253
8247
  onTickEnd() {}
8254
-
8255
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8256
8248
  startLoad(startPosition) {}
8257
8249
  stopLoad() {
8258
8250
  if (this.state === State.STOPPED) {
@@ -8636,8 +8628,6 @@ class BaseStreamController extends TaskLoop {
8636
8628
  const chunkMeta = new ChunkMetadata(frag.level, frag.sn, frag.stats.chunkCount + 1, 0, part ? part.index : -1, !complete);
8637
8629
  transmuxer.flush(chunkMeta);
8638
8630
  }
8639
-
8640
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8641
8631
  _handleFragmentLoadProgress(frag) {}
8642
8632
  _doFragLoad(frag, level, targetBufferTime = null, progressCallback) {
8643
8633
  var _frag$decryptdata;
@@ -9975,7 +9965,7 @@ function requireEventemitter3 () {
9975
9965
  var eventemitter3Exports = requireEventemitter3();
9976
9966
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9977
9967
 
9978
- const version = "1.6.0-beta.4.0.canary.11051";
9968
+ const version = "1.6.0-beta.4.0.canary.11056";
9979
9969
 
9980
9970
  // ensure the worker ends up in the bundle
9981
9971
  // If the worker should not be included this gets aliased to empty.js
@@ -10937,7 +10927,7 @@ class BaseAudioDemuxer {
10937
10927
  offset++;
10938
10928
  }
10939
10929
  if (offset === length && lastDataIndex !== length) {
10940
- const partialData = sliceUint8(data, lastDataIndex);
10930
+ const partialData = data.slice(lastDataIndex);
10941
10931
  if (this.cachedData) {
10942
10932
  this.cachedData = appendUint8Array(this.cachedData, partialData);
10943
10933
  } else {
@@ -21257,7 +21247,7 @@ class EMEController extends Logger {
21257
21247
  if (!tenc) {
21258
21248
  throw new Error(`'schm' box missing or not cbcs/cenc with schi > tenc`);
21259
21249
  }
21260
- keyId = tenc.subarray(8, 24);
21250
+ keyId = new Uint8Array(tenc.subarray(8, 24));
21261
21251
  keySystemDomain = KeySystems.FAIRPLAY;
21262
21252
  } catch (error) {
21263
21253
  this.warn(`${logMessage} Failed to parse sinf: ${error}`);
@@ -21287,7 +21277,7 @@ class EMEController extends Logger {
21287
21277
  if (psshInfo.version === 0 && psshInfo.data) {
21288
21278
  if (keySystemDomain === KeySystems.WIDEVINE) {
21289
21279
  const offset = psshInfo.data.length - 22;
21290
- keyId = psshInfo.data.subarray(offset, offset + 16);
21280
+ keyId = new Uint8Array(psshInfo.data.subarray(offset, offset + 16));
21291
21281
  } else if (keySystemDomain === KeySystems.PLAYREADY) {
21292
21282
  keyId = parsePlayReadyWRM(psshInfo.data);
21293
21283
  }
@@ -27562,7 +27552,6 @@ var VTTCue = (function () {
27562
27552
  */
27563
27553
 
27564
27554
  class StringDecoder {
27565
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
27566
27555
  decode(data, options) {
27567
27556
  if (!data) {
27568
27557
  return '';