hls.js 1.6.0-rc.1.0.canary.11076 → 1.6.0-rc.1.0.canary.11077

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.
@@ -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-rc.1.0.canary.11076"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-rc.1.0.canary.11077"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -2346,6 +2346,21 @@ const AUDIO_CODEC_REGEXP = /flac|opus|mp4a\.40\.34/i;
2346
2346
  function getCodecCompatibleName(codec, preferManagedMediaSource = true) {
2347
2347
  return codec.replace(AUDIO_CODEC_REGEXP, m => getCodecCompatibleNameLower(m.toLowerCase(), preferManagedMediaSource));
2348
2348
  }
2349
+ function replaceVideoCodec(originalCodecs, newVideoCodec) {
2350
+ const codecs = [];
2351
+ if (originalCodecs) {
2352
+ const allCodecs = originalCodecs.split(',');
2353
+ for (let i = 0; i < allCodecs.length; i++) {
2354
+ if (!isCodecType(allCodecs[i], 'video')) {
2355
+ codecs.push(allCodecs[i]);
2356
+ }
2357
+ }
2358
+ }
2359
+ if (newVideoCodec) {
2360
+ codecs.push(newVideoCodec);
2361
+ }
2362
+ return codecs.join(',');
2363
+ }
2349
2364
  function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2350
2365
  // Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
2351
2366
  // so use level codec is parsed codec is unavailable or incomplete
@@ -10504,10 +10519,11 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
10504
10519
  getTrackCodec(track, trackName) {
10505
10520
  // Use supplemental video codec when supported when adding SourceBuffer (#5558)
10506
10521
  const supplementalCodec = track.supplemental;
10507
- if (supplementalCodec && trackName === 'video' && areCodecsMediaSourceSupported(supplementalCodec, trackName)) {
10508
- return supplementalCodec;
10522
+ let trackCodec = track.codec;
10523
+ if (supplementalCodec && (trackName === 'video' || trackName === 'audiovideo') && areCodecsMediaSourceSupported(supplementalCodec, 'video')) {
10524
+ trackCodec = replaceVideoCodec(trackCodec, supplementalCodec);
10509
10525
  }
10510
- const codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
10526
+ const codec = pickMostCompleteCodecName(trackCodec, track.levelCodec);
10511
10527
  if (codec) {
10512
10528
  if (trackName.slice(0, 5) === 'audio') {
10513
10529
  return getCodecCompatibleName(codec, this.appendSource);
@@ -16339,6 +16355,7 @@ class PassThroughRemuxer {
16339
16355
  tracks.audiovideo = {
16340
16356
  container: 'video/mp4',
16341
16357
  codec: audioCodec + ',' + videoCodec,
16358
+ supplemental: initData.video.supplemental,
16342
16359
  initSegment,
16343
16360
  id: 'main'
16344
16361
  };
@@ -19607,7 +19624,7 @@ function assignTrackIdsByGroup(tracks) {
19607
19624
  });
19608
19625
  }
19609
19626
 
19610
- const version = "1.6.0-rc.1.0.canary.11076";
19627
+ const version = "1.6.0-rc.1.0.canary.11077";
19611
19628
 
19612
19629
  // ensure the worker ends up in the bundle
19613
19630
  // If the worker should not be included this gets aliased to empty.js