hls.js 1.6.0-rc.1.0.canary.11074 → 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.
package/dist/hls.mjs CHANGED
@@ -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.11074"}`);
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();
@@ -2449,6 +2449,21 @@ const AUDIO_CODEC_REGEXP = /flac|opus|mp4a\.40\.34/i;
2449
2449
  function getCodecCompatibleName(codec, preferManagedMediaSource = true) {
2450
2450
  return codec.replace(AUDIO_CODEC_REGEXP, m => getCodecCompatibleNameLower(m.toLowerCase(), preferManagedMediaSource));
2451
2451
  }
2452
+ function replaceVideoCodec(originalCodecs, newVideoCodec) {
2453
+ const codecs = [];
2454
+ if (originalCodecs) {
2455
+ const allCodecs = originalCodecs.split(',');
2456
+ for (let i = 0; i < allCodecs.length; i++) {
2457
+ if (!isCodecType(allCodecs[i], 'video')) {
2458
+ codecs.push(allCodecs[i]);
2459
+ }
2460
+ }
2461
+ }
2462
+ if (newVideoCodec) {
2463
+ codecs.push(newVideoCodec);
2464
+ }
2465
+ return codecs.join(',');
2466
+ }
2452
2467
  function pickMostCompleteCodecName(parsedCodec, levelCodec) {
2453
2468
  // Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
2454
2469
  // so use level codec is parsed codec is unavailable or incomplete
@@ -10058,7 +10073,7 @@ function requireEventemitter3 () {
10058
10073
  var eventemitter3Exports = requireEventemitter3();
10059
10074
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
10060
10075
 
10061
- const version = "1.6.0-rc.1.0.canary.11074";
10076
+ const version = "1.6.0-rc.1.0.canary.11077";
10062
10077
 
10063
10078
  // ensure the worker ends up in the bundle
10064
10079
  // If the worker should not be included this gets aliased to empty.js
@@ -15447,6 +15462,7 @@ class PassThroughRemuxer {
15447
15462
  tracks.audiovideo = {
15448
15463
  container: 'video/mp4',
15449
15464
  codec: audioCodec + ',' + videoCodec,
15465
+ supplemental: initData.video.supplemental,
15450
15466
  initSegment,
15451
15467
  id: 'main'
15452
15468
  };
@@ -19115,10 +19131,11 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => key === 'initSeg
19115
19131
  getTrackCodec(track, trackName) {
19116
19132
  // Use supplemental video codec when supported when adding SourceBuffer (#5558)
19117
19133
  const supplementalCodec = track.supplemental;
19118
- if (supplementalCodec && trackName === 'video' && areCodecsMediaSourceSupported(supplementalCodec, trackName)) {
19119
- return supplementalCodec;
19134
+ let trackCodec = track.codec;
19135
+ if (supplementalCodec && (trackName === 'video' || trackName === 'audiovideo') && areCodecsMediaSourceSupported(supplementalCodec, 'video')) {
19136
+ trackCodec = replaceVideoCodec(trackCodec, supplementalCodec);
19120
19137
  }
19121
- const codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
19138
+ const codec = pickMostCompleteCodecName(trackCodec, track.levelCodec);
19122
19139
  if (codec) {
19123
19140
  if (trackName.slice(0, 5) === 'audio') {
19124
19141
  return getCodecCompatibleName(codec, this.appendSource);