hls.js 1.6.1-0.canary.11107 → 1.6.1-0.canary.11108

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.1-0.canary.11107"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.1-0.canary.11108"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -1502,8 +1502,10 @@ function parseStsd(stsd) {
1502
1502
  {
1503
1503
  // extract profile + compatibility + level out of avcC box
1504
1504
  const avcCBox = findBox(sampleEntriesEnd, ['avcC'])[0];
1505
- codec += '.' + toHex(avcCBox[1]) + toHex(avcCBox[2]) + toHex(avcCBox[3]);
1506
- supplemental = parseSupplementalDoViCodec(codecFourCC === 'avc1' ? 'dva1' : 'dvav', sampleEntriesEnd);
1505
+ if (avcCBox && avcCBox.length > 3) {
1506
+ codec += '.' + toHex(avcCBox[1]) + toHex(avcCBox[2]) + toHex(avcCBox[3]);
1507
+ supplemental = parseSupplementalDoViCodec(codecFourCC === 'avc1' ? 'dva1' : 'dvav', sampleEntriesEnd);
1508
+ }
1507
1509
  break;
1508
1510
  }
1509
1511
  case 'mp4a':
@@ -1554,9 +1556,8 @@ function parseStsd(stsd) {
1554
1556
  case 'hvc1':
1555
1557
  case 'hev1':
1556
1558
  {
1557
- const hvcCBoxes = findBox(sampleEntriesEnd, ['hvcC']);
1558
- if (hvcCBoxes) {
1559
- const hvcCBox = hvcCBoxes[0];
1559
+ const hvcCBox = findBox(sampleEntriesEnd, ['hvcC'])[0];
1560
+ if (hvcCBox && hvcCBox.length > 12) {
1560
1561
  const profileByte = hvcCBox[1];
1561
1562
  const profileSpace = ['', 'A', 'B', 'C'][profileByte >> 6];
1562
1563
  const generalProfileIdc = profileByte & 0x1f;
@@ -1592,34 +1593,38 @@ function parseStsd(stsd) {
1592
1593
  case 'vp09':
1593
1594
  {
1594
1595
  const vpcCBox = findBox(sampleEntriesEnd, ['vpcC'])[0];
1595
- const profile = vpcCBox[4];
1596
- const level = vpcCBox[5];
1597
- const bitDepth = vpcCBox[6] >> 4 & 0x0f;
1598
- codec += '.' + addLeadingZero(profile) + '.' + addLeadingZero(level) + '.' + addLeadingZero(bitDepth);
1596
+ if (vpcCBox && vpcCBox.length > 6) {
1597
+ const profile = vpcCBox[4];
1598
+ const level = vpcCBox[5];
1599
+ const bitDepth = vpcCBox[6] >> 4 & 0x0f;
1600
+ codec += '.' + addLeadingZero(profile) + '.' + addLeadingZero(level) + '.' + addLeadingZero(bitDepth);
1601
+ }
1599
1602
  break;
1600
1603
  }
1601
1604
  case 'av01':
1602
1605
  {
1603
1606
  const av1CBox = findBox(sampleEntriesEnd, ['av1C'])[0];
1604
- const profile = av1CBox[1] >>> 5;
1605
- const level = av1CBox[1] & 0x1f;
1606
- const tierFlag = av1CBox[2] >>> 7 ? 'H' : 'M';
1607
- const highBitDepth = (av1CBox[2] & 0x40) >> 6;
1608
- const twelveBit = (av1CBox[2] & 0x20) >> 5;
1609
- const bitDepth = profile === 2 && highBitDepth ? twelveBit ? 12 : 10 : highBitDepth ? 10 : 8;
1610
- const monochrome = (av1CBox[2] & 0x10) >> 4;
1611
- const chromaSubsamplingX = (av1CBox[2] & 0x08) >> 3;
1612
- const chromaSubsamplingY = (av1CBox[2] & 0x04) >> 2;
1613
- const chromaSamplePosition = av1CBox[2] & 0x03;
1614
- // TODO: parse color_description_present_flag
1615
- // default it to BT.709/limited range for now
1616
- // more info https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax
1617
- const colorPrimaries = 1;
1618
- const transferCharacteristics = 1;
1619
- const matrixCoefficients = 1;
1620
- const videoFullRangeFlag = 0;
1621
- codec += '.' + profile + '.' + addLeadingZero(level) + tierFlag + '.' + addLeadingZero(bitDepth) + '.' + monochrome + '.' + chromaSubsamplingX + chromaSubsamplingY + chromaSamplePosition + '.' + addLeadingZero(colorPrimaries) + '.' + addLeadingZero(transferCharacteristics) + '.' + addLeadingZero(matrixCoefficients) + '.' + videoFullRangeFlag;
1622
- supplemental = parseSupplementalDoViCodec('dav1', sampleEntriesEnd);
1607
+ if (av1CBox && av1CBox.length > 2) {
1608
+ const profile = av1CBox[1] >>> 5;
1609
+ const level = av1CBox[1] & 0x1f;
1610
+ const tierFlag = av1CBox[2] >>> 7 ? 'H' : 'M';
1611
+ const highBitDepth = (av1CBox[2] & 0x40) >> 6;
1612
+ const twelveBit = (av1CBox[2] & 0x20) >> 5;
1613
+ const bitDepth = profile === 2 && highBitDepth ? twelveBit ? 12 : 10 : highBitDepth ? 10 : 8;
1614
+ const monochrome = (av1CBox[2] & 0x10) >> 4;
1615
+ const chromaSubsamplingX = (av1CBox[2] & 0x08) >> 3;
1616
+ const chromaSubsamplingY = (av1CBox[2] & 0x04) >> 2;
1617
+ const chromaSamplePosition = av1CBox[2] & 0x03;
1618
+ // TODO: parse color_description_present_flag
1619
+ // default it to BT.709/limited range for now
1620
+ // more info https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax
1621
+ const colorPrimaries = 1;
1622
+ const transferCharacteristics = 1;
1623
+ const matrixCoefficients = 1;
1624
+ const videoFullRangeFlag = 0;
1625
+ codec += '.' + profile + '.' + addLeadingZero(level) + tierFlag + '.' + addLeadingZero(bitDepth) + '.' + monochrome + '.' + chromaSubsamplingX + chromaSubsamplingY + chromaSamplePosition + '.' + addLeadingZero(colorPrimaries) + '.' + addLeadingZero(transferCharacteristics) + '.' + addLeadingZero(matrixCoefficients) + '.' + videoFullRangeFlag;
1626
+ supplemental = parseSupplementalDoViCodec('dav1', sampleEntriesEnd);
1627
+ }
1623
1628
  break;
1624
1629
  }
1625
1630
  }
@@ -10238,7 +10243,7 @@ function requireEventemitter3 () {
10238
10243
  var eventemitter3Exports = requireEventemitter3();
10239
10244
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
10240
10245
 
10241
- const version = "1.6.1-0.canary.11107";
10246
+ const version = "1.6.1-0.canary.11108";
10242
10247
 
10243
10248
  // ensure the worker ends up in the bundle
10244
10249
  // If the worker should not be included this gets aliased to empty.js