hls.js 1.6.3-0.canary.11214 → 1.6.3-0.canary.11218

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.3-0.canary.11214"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.3-0.canary.11218"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -12473,6 +12473,91 @@ function canParseId3(data, offset) {
12473
12473
  return isId3Header(data, offset) && readId3Size(data, offset + 6) + 10 <= data.length - offset;
12474
12474
  }
12475
12475
 
12476
+ function toArrayBuffer(view) {
12477
+ if (view instanceof ArrayBuffer) {
12478
+ return view;
12479
+ } else {
12480
+ if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
12481
+ // This is a TypedArray over the whole buffer.
12482
+ return view.buffer;
12483
+ }
12484
+ // This is a 'view' on the buffer. Create a new buffer that only contains
12485
+ // the data. Note that since this isn't an ArrayBuffer, the 'new' call
12486
+ // will allocate a new buffer to hold the copy.
12487
+ return new Uint8Array(view).buffer;
12488
+ }
12489
+ }
12490
+
12491
+ function toUint8(data, offset = 0, length = Infinity) {
12492
+ return view(data, offset, length, Uint8Array);
12493
+ }
12494
+ function view(data, offset, length, Type) {
12495
+ const buffer = unsafeGetArrayBuffer(data);
12496
+ let bytesPerElement = 1;
12497
+ if ('BYTES_PER_ELEMENT' in Type) {
12498
+ bytesPerElement = Type.BYTES_PER_ELEMENT;
12499
+ }
12500
+ // Absolute end of the |data| view within |buffer|.
12501
+ const dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
12502
+ const dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
12503
+ // Absolute start of the result within |buffer|.
12504
+ const rawStart = (dataOffset + offset) / bytesPerElement;
12505
+ const start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
12506
+ // Absolute end of the result within |buffer|.
12507
+ const end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
12508
+ return new Type(buffer, start, end - start);
12509
+ }
12510
+ function unsafeGetArrayBuffer(view) {
12511
+ if (view instanceof ArrayBuffer) {
12512
+ return view;
12513
+ } else {
12514
+ return view.buffer;
12515
+ }
12516
+ }
12517
+ function isArrayBufferView(obj) {
12518
+ return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
12519
+ }
12520
+
12521
+ function decodeId3ImageFrame(frame) {
12522
+ const metadataFrame = {
12523
+ key: frame.type,
12524
+ description: '',
12525
+ data: '',
12526
+ mimeType: null,
12527
+ pictureType: null
12528
+ };
12529
+ const utf8Encoding = 0x03;
12530
+ if (frame.size < 2) {
12531
+ return undefined;
12532
+ }
12533
+ if (frame.data[0] !== utf8Encoding) {
12534
+ console.log('Ignore frame with unrecognized character ' + 'encoding');
12535
+ return undefined;
12536
+ }
12537
+ const mimeTypeEndIndex = frame.data.subarray(1).indexOf(0);
12538
+ if (mimeTypeEndIndex === -1) {
12539
+ return undefined;
12540
+ }
12541
+ const mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex));
12542
+ const pictureType = frame.data[2 + mimeTypeEndIndex];
12543
+ const descriptionEndIndex = frame.data.subarray(3 + mimeTypeEndIndex).indexOf(0);
12544
+ if (descriptionEndIndex === -1) {
12545
+ return undefined;
12546
+ }
12547
+ const description = utf8ArrayToStr(toUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex));
12548
+ let data;
12549
+ if (mimeType === '-->') {
12550
+ data = utf8ArrayToStr(toUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex));
12551
+ } else {
12552
+ data = toArrayBuffer(frame.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex));
12553
+ }
12554
+ metadataFrame.mimeType = mimeType;
12555
+ metadataFrame.pictureType = pictureType;
12556
+ metadataFrame.description = description;
12557
+ metadataFrame.data = data;
12558
+ return metadataFrame;
12559
+ }
12560
+
12476
12561
  /**
12477
12562
  * Decode an ID3 PRIV frame.
12478
12563
  *
@@ -12587,91 +12672,6 @@ function decodeId3UrlFrame(frame) {
12587
12672
  };
12588
12673
  }
12589
12674
 
12590
- function toArrayBuffer(view) {
12591
- if (view instanceof ArrayBuffer) {
12592
- return view;
12593
- } else {
12594
- if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {
12595
- // This is a TypedArray over the whole buffer.
12596
- return view.buffer;
12597
- }
12598
- // This is a 'view' on the buffer. Create a new buffer that only contains
12599
- // the data. Note that since this isn't an ArrayBuffer, the 'new' call
12600
- // will allocate a new buffer to hold the copy.
12601
- return new Uint8Array(view).buffer;
12602
- }
12603
- }
12604
-
12605
- function toUint8(data, offset = 0, length = Infinity) {
12606
- return view(data, offset, length, Uint8Array);
12607
- }
12608
- function view(data, offset, length, Type) {
12609
- const buffer = unsafeGetArrayBuffer(data);
12610
- let bytesPerElement = 1;
12611
- if ('BYTES_PER_ELEMENT' in Type) {
12612
- bytesPerElement = Type.BYTES_PER_ELEMENT;
12613
- }
12614
- // Absolute end of the |data| view within |buffer|.
12615
- const dataOffset = isArrayBufferView(data) ? data.byteOffset : 0;
12616
- const dataEnd = (dataOffset + data.byteLength) / bytesPerElement;
12617
- // Absolute start of the result within |buffer|.
12618
- const rawStart = (dataOffset + offset) / bytesPerElement;
12619
- const start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
12620
- // Absolute end of the result within |buffer|.
12621
- const end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd));
12622
- return new Type(buffer, start, end - start);
12623
- }
12624
- function unsafeGetArrayBuffer(view) {
12625
- if (view instanceof ArrayBuffer) {
12626
- return view;
12627
- } else {
12628
- return view.buffer;
12629
- }
12630
- }
12631
- function isArrayBufferView(obj) {
12632
- return obj && obj.buffer instanceof ArrayBuffer && obj.byteLength !== undefined && obj.byteOffset !== undefined;
12633
- }
12634
-
12635
- function decodeId3ImageFrame(frame) {
12636
- const metadataFrame = {
12637
- key: frame.type,
12638
- description: '',
12639
- data: '',
12640
- mimeType: null,
12641
- pictureType: null
12642
- };
12643
- const utf8Encoding = 0x03;
12644
- if (frame.size < 2) {
12645
- return undefined;
12646
- }
12647
- if (frame.data[0] !== utf8Encoding) {
12648
- console.log('Ignore frame with unrecognized character ' + 'encoding');
12649
- return undefined;
12650
- }
12651
- const mimeTypeEndIndex = frame.data.subarray(1).indexOf(0);
12652
- if (mimeTypeEndIndex === -1) {
12653
- return undefined;
12654
- }
12655
- const mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex));
12656
- const pictureType = frame.data[2 + mimeTypeEndIndex];
12657
- const descriptionEndIndex = frame.data.subarray(3 + mimeTypeEndIndex).indexOf(0);
12658
- if (descriptionEndIndex === -1) {
12659
- return undefined;
12660
- }
12661
- const description = utf8ArrayToStr(toUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex));
12662
- let data;
12663
- if (mimeType === '-->') {
12664
- data = utf8ArrayToStr(toUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex));
12665
- } else {
12666
- data = toArrayBuffer(frame.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex));
12667
- }
12668
- metadataFrame.mimeType = mimeType;
12669
- metadataFrame.pictureType = pictureType;
12670
- metadataFrame.description = description;
12671
- metadataFrame.data = data;
12672
- return metadataFrame;
12673
- }
12674
-
12675
12675
  /**
12676
12676
  * Decode an ID3 frame.
12677
12677
  *
@@ -19870,7 +19870,7 @@ function assignTrackIdsByGroup(tracks) {
19870
19870
  });
19871
19871
  }
19872
19872
 
19873
- const version = "1.6.3-0.canary.11214";
19873
+ const version = "1.6.3-0.canary.11218";
19874
19874
 
19875
19875
  // ensure the worker ends up in the bundle
19876
19876
  // If the worker should not be included this gets aliased to empty.js