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/package.json CHANGED
@@ -132,7 +132,7 @@
132
132
  "sinon-chai": "3.7.0",
133
133
  "typescript": "5.8.2",
134
134
  "url-toolkit": "2.2.5",
135
- "wrangler": "3.114.1"
135
+ "wrangler": "3.114.2"
136
136
  },
137
- "version": "1.6.0-rc.1.0.canary.11074"
137
+ "version": "1.6.0-rc.1.0.canary.11077"
138
138
  }
@@ -9,6 +9,7 @@ import {
9
9
  areCodecsMediaSourceSupported,
10
10
  getCodecCompatibleName,
11
11
  pickMostCompleteCodecName,
12
+ replaceVideoCodec,
12
13
  } from '../utils/codecs';
13
14
  import { Logger } from '../utils/logger';
14
15
  import {
@@ -1436,14 +1437,15 @@ transfer tracks: ${stringify(transferredTracks, (key, value) => (key === 'initSe
1436
1437
  private getTrackCodec(track: BaseTrack, trackName: SourceBufferName): string {
1437
1438
  // Use supplemental video codec when supported when adding SourceBuffer (#5558)
1438
1439
  const supplementalCodec = track.supplemental;
1440
+ let trackCodec = track.codec;
1439
1441
  if (
1440
1442
  supplementalCodec &&
1441
- trackName === 'video' &&
1442
- areCodecsMediaSourceSupported(supplementalCodec, trackName)
1443
+ (trackName === 'video' || trackName === 'audiovideo') &&
1444
+ areCodecsMediaSourceSupported(supplementalCodec, 'video')
1443
1445
  ) {
1444
- return supplementalCodec;
1446
+ trackCodec = replaceVideoCodec(trackCodec, supplementalCodec);
1445
1447
  }
1446
- const codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
1448
+ const codec = pickMostCompleteCodecName(trackCodec, track.levelCodec);
1447
1449
  if (codec) {
1448
1450
  if (trackName.slice(0, 5) === 'audio') {
1449
1451
  return getCodecCompatibleName(codec, this.appendSource);
@@ -103,6 +103,7 @@ class PassThroughRemuxer implements Remuxer {
103
103
  tracks.audiovideo = {
104
104
  container: 'video/mp4',
105
105
  codec: audioCodec + ',' + videoCodec,
106
+ supplemental: initData.video.supplemental,
106
107
  initSegment,
107
108
  id: 'main',
108
109
  };
@@ -202,6 +202,25 @@ export function getCodecCompatibleName(
202
202
  );
203
203
  }
204
204
 
205
+ export function replaceVideoCodec(
206
+ originalCodecs: string | undefined,
207
+ newVideoCodec: string | undefined,
208
+ ): string | undefined {
209
+ const codecs: string[] = [];
210
+ if (originalCodecs) {
211
+ const allCodecs = originalCodecs.split(',');
212
+ for (let i = 0; i < allCodecs.length; i++) {
213
+ if (!isCodecType(allCodecs[i], 'video')) {
214
+ codecs.push(allCodecs[i]);
215
+ }
216
+ }
217
+ }
218
+ if (newVideoCodec) {
219
+ codecs.push(newVideoCodec);
220
+ }
221
+ return codecs.join(',');
222
+ }
223
+
205
224
  export function pickMostCompleteCodecName(
206
225
  parsedCodec: string | undefined,
207
226
  levelCodec: string | undefined,