hls.js 1.6.6-0.canary.11339 → 1.6.6-0.canary.11342

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.6-0.canary.11339"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11342"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -2548,7 +2548,9 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2548
2548
  // Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
2549
2549
  // so use level codec is parsed codec is unavailable or incomplete
2550
2550
  if (parsedCodec && (parsedCodec.length > 4 || ['ac-3', 'ec-3', 'alac', 'fLaC', 'Opus'].indexOf(parsedCodec) !== -1)) {
2551
- return parsedCodec;
2551
+ if (isCodecSupportedAsType(parsedCodec, 'audio') || isCodecSupportedAsType(parsedCodec, 'video')) {
2552
+ return parsedCodec;
2553
+ }
2552
2554
  }
2553
2555
  if (levelCodec) {
2554
2556
  const levelCodecs = levelCodec.split(',');
@@ -2565,6 +2567,9 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2565
2567
  }
2566
2568
  return levelCodec || parsedCodec;
2567
2569
  }
2570
+ function isCodecSupportedAsType(codec, type) {
2571
+ return isCodecType(codec, type) && isCodecMediaSourceSupported(codec, type);
2572
+ }
2568
2573
  function convertAVC1ToAVCOTI(videoCodecs) {
2569
2574
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
2570
2575
  // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
@@ -10209,7 +10214,7 @@ function requireEventemitter3 () {
10209
10214
  var eventemitter3Exports = requireEventemitter3();
10210
10215
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
10211
10216
 
10212
- const version = "1.6.6-0.canary.11339";
10217
+ const version = "1.6.6-0.canary.11342";
10213
10218
 
10214
10219
  // ensure the worker ends up in the bundle
10215
10220
  // If the worker should not be included this gets aliased to empty.js
@@ -33473,8 +33478,9 @@ class StreamController extends BaseStreamController {
33473
33478
  audiovideo
33474
33479
  } = tracks;
33475
33480
  if (audio) {
33476
- let audioCodec = pickMostCompleteCodecName(audio.codec, currentLevel.audioCodec);
33477
- // Add level and profile to make up for passthrough-remuxer not being able to parse full codec
33481
+ const levelCodec = currentLevel.audioCodec;
33482
+ let audioCodec = pickMostCompleteCodecName(audio.codec, levelCodec);
33483
+ // Add level and profile to make up for remuxer not being able to parse full codec
33478
33484
  // (logger warning "Unhandled audio codec...")
33479
33485
  if (audioCodec === 'mp4a') {
33480
33486
  audioCodec = 'mp4a.40.5';
@@ -33503,12 +33509,12 @@ class StreamController extends BaseStreamController {
33503
33509
  audioCodec = 'mp4a.40.2';
33504
33510
  this.log(`Android: force audio codec to ${audioCodec}`);
33505
33511
  }
33506
- if (currentLevel.audioCodec && currentLevel.audioCodec !== audioCodec) {
33507
- this.log(`Swapping manifest audio codec "${currentLevel.audioCodec}" for "${audioCodec}"`);
33512
+ if (levelCodec && levelCodec !== audioCodec) {
33513
+ this.log(`Swapping manifest audio codec "${levelCodec}" for "${audioCodec}"`);
33508
33514
  }
33509
33515
  audio.levelCodec = audioCodec;
33510
33516
  audio.id = PlaylistLevelType.MAIN;
33511
- this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${audioCodec || ''}/${currentLevel.audioCodec || ''}/${audio.codec}]`);
33517
+ this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${audioCodec || ''}/${levelCodec || ''}/${audio.codec}]`);
33512
33518
  delete tracks.audiovideo;
33513
33519
  }
33514
33520
  if (video) {