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.
- package/dist/hls.js +22 -5
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +22 -5
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +22 -5
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +22 -5
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/buffer-controller.ts +6 -4
- package/src/remux/passthrough-remuxer.ts +1 -0
- package/src/utils/codecs.ts +19 -0
package/package.json
CHANGED
@@ -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,
|
1443
|
+
(trackName === 'video' || trackName === 'audiovideo') &&
|
1444
|
+
areCodecsMediaSourceSupported(supplementalCodec, 'video')
|
1443
1445
|
) {
|
1444
|
-
|
1446
|
+
trackCodec = replaceVideoCodec(trackCodec, supplementalCodec);
|
1445
1447
|
}
|
1446
|
-
const codec = pickMostCompleteCodecName(
|
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);
|
package/src/utils/codecs.ts
CHANGED
@@ -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,
|