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

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.6-0.canary.11339"}`);
526
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.6-0.canary.11340"}`);
527
527
  } catch (e) {
528
528
  /* log fn threw an exception. All logger methods are no-ops. */
529
529
  return createLogger();
@@ -2435,7 +2435,9 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2435
2435
  // Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
2436
2436
  // so use level codec is parsed codec is unavailable or incomplete
2437
2437
  if (parsedCodec && (parsedCodec.length > 4 || ['ac-3', 'ec-3', 'alac', 'fLaC', 'Opus'].indexOf(parsedCodec) !== -1)) {
2438
- return parsedCodec;
2438
+ if (isCodecSupportedAsType(parsedCodec, 'audio') || isCodecSupportedAsType(parsedCodec, 'video')) {
2439
+ return parsedCodec;
2440
+ }
2439
2441
  }
2440
2442
  if (levelCodec) {
2441
2443
  const levelCodecs = levelCodec.split(',');
@@ -2452,6 +2454,9 @@ function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2452
2454
  }
2453
2455
  return levelCodec || parsedCodec;
2454
2456
  }
2457
+ function isCodecSupportedAsType(codec, type) {
2458
+ return isCodecType(codec, type) && isCodecMediaSourceSupported(codec, type);
2459
+ }
2455
2460
  function convertAVC1ToAVCOTI(videoCodecs) {
2456
2461
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
2457
2462
  // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
@@ -19878,7 +19883,7 @@ function assignTrackIdsByGroup(tracks) {
19878
19883
  });
19879
19884
  }
19880
19885
 
19881
- const version = "1.6.6-0.canary.11339";
19886
+ const version = "1.6.6-0.canary.11340";
19882
19887
 
19883
19888
  // ensure the worker ends up in the bundle
19884
19889
  // If the worker should not be included this gets aliased to empty.js
@@ -21367,8 +21372,9 @@ class StreamController extends BaseStreamController {
21367
21372
  audiovideo
21368
21373
  } = tracks;
21369
21374
  if (audio) {
21370
- let audioCodec = pickMostCompleteCodecName(audio.codec, currentLevel.audioCodec);
21371
- // Add level and profile to make up for passthrough-remuxer not being able to parse full codec
21375
+ const levelCodec = currentLevel.audioCodec;
21376
+ let audioCodec = pickMostCompleteCodecName(audio.codec, levelCodec);
21377
+ // Add level and profile to make up for remuxer not being able to parse full codec
21372
21378
  // (logger warning "Unhandled audio codec...")
21373
21379
  if (audioCodec === 'mp4a') {
21374
21380
  audioCodec = 'mp4a.40.5';
@@ -21397,12 +21403,12 @@ class StreamController extends BaseStreamController {
21397
21403
  audioCodec = 'mp4a.40.2';
21398
21404
  this.log(`Android: force audio codec to ${audioCodec}`);
21399
21405
  }
21400
- if (currentLevel.audioCodec && currentLevel.audioCodec !== audioCodec) {
21401
- this.log(`Swapping manifest audio codec "${currentLevel.audioCodec}" for "${audioCodec}"`);
21406
+ if (levelCodec && levelCodec !== audioCodec) {
21407
+ this.log(`Swapping manifest audio codec "${levelCodec}" for "${audioCodec}"`);
21402
21408
  }
21403
21409
  audio.levelCodec = audioCodec;
21404
21410
  audio.id = PlaylistLevelType.MAIN;
21405
- this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${audioCodec || ''}/${currentLevel.audioCodec || ''}/${audio.codec}]`);
21411
+ this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${audioCodec || ''}/${levelCodec || ''}/${audio.codec}]`);
21406
21412
  delete tracks.audiovideo;
21407
21413
  }
21408
21414
  if (video) {