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/package.json CHANGED
@@ -74,7 +74,7 @@
74
74
  "@babel/preset-env": "7.27.2",
75
75
  "@babel/preset-typescript": "7.27.1",
76
76
  "@babel/register": "7.27.1",
77
- "@microsoft/api-documenter": "7.26.27",
77
+ "@microsoft/api-documenter": "7.26.28",
78
78
  "@microsoft/api-extractor": "7.52.8",
79
79
  "@rollup/plugin-alias": "5.1.1",
80
80
  "@rollup/plugin-babel": "6.0.4",
@@ -135,5 +135,5 @@
135
135
  "url-toolkit": "2.2.5",
136
136
  "wrangler": "4.22.0"
137
137
  },
138
- "version": "1.6.6-0.canary.11339"
138
+ "version": "1.6.6-0.canary.11342"
139
139
  }
@@ -1424,11 +1424,9 @@ export default class StreamController
1424
1424
  // include levelCodec in audio and video tracks
1425
1425
  const { audio, video, audiovideo } = tracks;
1426
1426
  if (audio) {
1427
- let audioCodec = pickMostCompleteCodecName(
1428
- audio.codec,
1429
- currentLevel.audioCodec,
1430
- );
1431
- // Add level and profile to make up for passthrough-remuxer not being able to parse full codec
1427
+ const levelCodec = currentLevel.audioCodec;
1428
+ let audioCodec = pickMostCompleteCodecName(audio.codec, levelCodec);
1429
+ // Add level and profile to make up for remuxer not being able to parse full codec
1432
1430
  // (logger warning "Unhandled audio codec...")
1433
1431
  if (audioCodec === 'mp4a') {
1434
1432
  audioCodec = 'mp4a.40.5';
@@ -1467,9 +1465,9 @@ export default class StreamController
1467
1465
  audioCodec = 'mp4a.40.2';
1468
1466
  this.log(`Android: force audio codec to ${audioCodec}`);
1469
1467
  }
1470
- if (currentLevel.audioCodec && currentLevel.audioCodec !== audioCodec) {
1468
+ if (levelCodec && levelCodec !== audioCodec) {
1471
1469
  this.log(
1472
- `Swapping manifest audio codec "${currentLevel.audioCodec}" for "${audioCodec}"`,
1470
+ `Swapping manifest audio codec "${levelCodec}" for "${audioCodec}"`,
1473
1471
  );
1474
1472
  }
1475
1473
  audio.levelCodec = audioCodec;
@@ -1478,7 +1476,7 @@ export default class StreamController
1478
1476
  `Init audio buffer, container:${
1479
1477
  audio.container
1480
1478
  }, codecs[selected/level/parsed]=[${audioCodec || ''}/${
1481
- currentLevel.audioCodec || ''
1479
+ levelCodec || ''
1482
1480
  }/${audio.codec}]`,
1483
1481
  );
1484
1482
  delete tracks.audiovideo;
@@ -232,7 +232,12 @@ export function pickMostCompleteCodecName(
232
232
  (parsedCodec.length > 4 ||
233
233
  ['ac-3', 'ec-3', 'alac', 'fLaC', 'Opus'].indexOf(parsedCodec) !== -1)
234
234
  ) {
235
- return parsedCodec;
235
+ if (
236
+ isCodecSupportedAsType(parsedCodec, 'audio') ||
237
+ isCodecSupportedAsType(parsedCodec, 'video')
238
+ ) {
239
+ return parsedCodec;
240
+ }
236
241
  }
237
242
  if (levelCodec) {
238
243
  const levelCodecs = levelCodec.split(',');
@@ -250,6 +255,10 @@ export function pickMostCompleteCodecName(
250
255
  return levelCodec || parsedCodec;
251
256
  }
252
257
 
258
+ function isCodecSupportedAsType(codec: string, type: CodecType): boolean {
259
+ return isCodecType(codec, type) && isCodecMediaSourceSupported(codec, type);
260
+ }
261
+
253
262
  export function convertAVC1ToAVCOTI(videoCodecs: string): string {
254
263
  // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
255
264
  // Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.