hls.js 1.5.14-0.canary.10668 → 1.5.14-0.canary.10669
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.d.mts +8 -4
- package/dist/hls.d.ts +8 -4
- package/dist/hls.js +134 -57
- package/dist/hls.js.d.ts +8 -4
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +212 -36
- 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 +191 -28
- 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 +120 -48
- 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 +2 -2
- package/src/controller/level-controller.ts +44 -21
- package/src/controller/stream-controller.ts +30 -3
- package/src/hls.ts +24 -4
- package/src/remux/passthrough-remuxer.ts +7 -15
- package/src/utils/codecs.ts +36 -6
- package/src/utils/mediacapabilities-helper.ts +30 -23
- package/src/utils/mediakeys-helper.ts +2 -2
package/dist/hls.d.mts
CHANGED
@@ -1736,11 +1736,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1736
1736
|
/**
|
1737
1737
|
* Get the complete list of audio tracks across all media groups
|
1738
1738
|
*/
|
1739
|
-
get allAudioTracks():
|
1739
|
+
get allAudioTracks(): MediaPlaylist[];
|
1740
1740
|
/**
|
1741
1741
|
* Get the list of selectable audio tracks
|
1742
1742
|
*/
|
1743
|
-
get audioTracks():
|
1743
|
+
get audioTracks(): MediaPlaylist[];
|
1744
1744
|
/**
|
1745
1745
|
* index of the selected audio track (index in audio track lists)
|
1746
1746
|
*/
|
@@ -1752,11 +1752,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1752
1752
|
/**
|
1753
1753
|
* get the complete list of subtitle tracks across all media groups
|
1754
1754
|
*/
|
1755
|
-
get allSubtitleTracks():
|
1755
|
+
get allSubtitleTracks(): MediaPlaylist[];
|
1756
1756
|
/**
|
1757
1757
|
* get alternate subtitle tracks list from playlist
|
1758
1758
|
*/
|
1759
|
-
get subtitleTracks():
|
1759
|
+
get subtitleTracks(): MediaPlaylist[];
|
1760
1760
|
/**
|
1761
1761
|
* index of the selected subtitle track (index in subtitle track lists)
|
1762
1762
|
*/
|
@@ -1824,6 +1824,10 @@ declare class Hls implements HlsEventEmitter {
|
|
1824
1824
|
* returns Interstitials Program Manager
|
1825
1825
|
*/
|
1826
1826
|
get interstitialsManager(): InterstitialsManager | null;
|
1827
|
+
/**
|
1828
|
+
* returns mediaCapabilities.decodingInfo for a variant/rendition
|
1829
|
+
*/
|
1830
|
+
getMediaDecodingInfo(level: Level, audioTracks?: MediaPlaylist[]): Promise<MediaDecodingInfo>;
|
1827
1831
|
}
|
1828
1832
|
export default Hls;
|
1829
1833
|
|
package/dist/hls.d.ts
CHANGED
@@ -1736,11 +1736,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1736
1736
|
/**
|
1737
1737
|
* Get the complete list of audio tracks across all media groups
|
1738
1738
|
*/
|
1739
|
-
get allAudioTracks():
|
1739
|
+
get allAudioTracks(): MediaPlaylist[];
|
1740
1740
|
/**
|
1741
1741
|
* Get the list of selectable audio tracks
|
1742
1742
|
*/
|
1743
|
-
get audioTracks():
|
1743
|
+
get audioTracks(): MediaPlaylist[];
|
1744
1744
|
/**
|
1745
1745
|
* index of the selected audio track (index in audio track lists)
|
1746
1746
|
*/
|
@@ -1752,11 +1752,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1752
1752
|
/**
|
1753
1753
|
* get the complete list of subtitle tracks across all media groups
|
1754
1754
|
*/
|
1755
|
-
get allSubtitleTracks():
|
1755
|
+
get allSubtitleTracks(): MediaPlaylist[];
|
1756
1756
|
/**
|
1757
1757
|
* get alternate subtitle tracks list from playlist
|
1758
1758
|
*/
|
1759
|
-
get subtitleTracks():
|
1759
|
+
get subtitleTracks(): MediaPlaylist[];
|
1760
1760
|
/**
|
1761
1761
|
* index of the selected subtitle track (index in subtitle track lists)
|
1762
1762
|
*/
|
@@ -1824,6 +1824,10 @@ declare class Hls implements HlsEventEmitter {
|
|
1824
1824
|
* returns Interstitials Program Manager
|
1825
1825
|
*/
|
1826
1826
|
get interstitialsManager(): InterstitialsManager | null;
|
1827
|
+
/**
|
1828
|
+
* returns mediaCapabilities.decodingInfo for a variant/rendition
|
1829
|
+
*/
|
1830
|
+
getMediaDecodingInfo(level: Level, audioTracks?: MediaPlaylist[]): Promise<MediaDecodingInfo>;
|
1827
1831
|
}
|
1828
1832
|
export default Hls;
|
1829
1833
|
|
package/dist/hls.js
CHANGED
@@ -542,7 +542,7 @@
|
|
542
542
|
// Some browsers don't allow to use bind on console object anyway
|
543
543
|
// fallback to default if needed
|
544
544
|
try {
|
545
|
-
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.
|
545
|
+
newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10669");
|
546
546
|
} catch (e) {
|
547
547
|
/* log fn threw an exception. All logger methods are no-ops. */
|
548
548
|
return createLogger();
|
@@ -1573,14 +1573,14 @@
|
|
1573
1573
|
sessionTypes: drmSystemOptions.sessionTypes || [drmSystemOptions.sessionType || 'temporary'],
|
1574
1574
|
audioCapabilities: audioCodecs.map(function (codec) {
|
1575
1575
|
return {
|
1576
|
-
contentType: "audio/mp4; codecs
|
1576
|
+
contentType: "audio/mp4; codecs=" + codec,
|
1577
1577
|
robustness: drmSystemOptions.audioRobustness || '',
|
1578
1578
|
encryptionScheme: drmSystemOptions.audioEncryptionScheme || null
|
1579
1579
|
};
|
1580
1580
|
}),
|
1581
1581
|
videoCapabilities: videoCodecs.map(function (codec) {
|
1582
1582
|
return {
|
1583
|
-
contentType: "video/mp4; codecs
|
1583
|
+
contentType: "video/mp4; codecs=" + codec,
|
1584
1584
|
robustness: drmSystemOptions.videoRobustness || '',
|
1585
1585
|
encryptionScheme: drmSystemOptions.videoEncryptionScheme || null
|
1586
1586
|
};
|
@@ -3142,7 +3142,7 @@
|
|
3142
3142
|
return (_MediaSource$isTypeSu = MediaSource == null ? void 0 : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
|
3143
3143
|
}
|
3144
3144
|
function mimeTypeForCodec(codec, type) {
|
3145
|
-
return type + "/mp4;codecs
|
3145
|
+
return type + "/mp4;codecs=" + codec;
|
3146
3146
|
}
|
3147
3147
|
function videoCodecPreferenceValue(videoCodec) {
|
3148
3148
|
if (videoCodec) {
|
@@ -3201,15 +3201,28 @@
|
|
3201
3201
|
function pickMostCompleteCodecName(parsedCodec, levelCodec) {
|
3202
3202
|
// Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
|
3203
3203
|
// so use level codec is parsed codec is unavailable or incomplete
|
3204
|
-
if (parsedCodec && parsedCodec
|
3204
|
+
if (parsedCodec && (parsedCodec.length > 4 || ['ac-3', 'ec-3', 'alac', 'fLaC', 'Opus'].indexOf(parsedCodec) !== -1)) {
|
3205
3205
|
return parsedCodec;
|
3206
3206
|
}
|
3207
|
-
|
3207
|
+
if (levelCodec) {
|
3208
|
+
var levelCodecs = levelCodec.split(',');
|
3209
|
+
if (levelCodecs.length > 1) {
|
3210
|
+
if (parsedCodec) {
|
3211
|
+
for (var i = levelCodecs.length; i--;) {
|
3212
|
+
if (levelCodecs[i].substring(0, 4) === parsedCodec.substring(0, 4)) {
|
3213
|
+
return levelCodecs[i];
|
3214
|
+
}
|
3215
|
+
}
|
3216
|
+
}
|
3217
|
+
return levelCodecs[0];
|
3218
|
+
}
|
3219
|
+
}
|
3220
|
+
return levelCodec || parsedCodec;
|
3208
3221
|
}
|
3209
|
-
function convertAVC1ToAVCOTI(
|
3222
|
+
function convertAVC1ToAVCOTI(videoCodecs) {
|
3210
3223
|
// Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
|
3211
3224
|
// Examples: avc1.66.30 to avc1.42001e and avc1.77.30,avc1.66.30 to avc1.4d001e,avc1.42001e.
|
3212
|
-
var codecs =
|
3225
|
+
var codecs = videoCodecs.split(',');
|
3213
3226
|
for (var i = 0; i < codecs.length; i++) {
|
3214
3227
|
var avcdata = codecs[i].split('.');
|
3215
3228
|
if (avcdata.length > 2) {
|
@@ -3221,6 +3234,18 @@
|
|
3221
3234
|
}
|
3222
3235
|
return codecs.join(',');
|
3223
3236
|
}
|
3237
|
+
function fillInMissingAV01Params(videoCodec) {
|
3238
|
+
// Used to fill in incomplete AV1 playlist CODECS strings for mediaCapabilities.decodingInfo queries
|
3239
|
+
if (videoCodec.startsWith('av01.')) {
|
3240
|
+
var av1params = videoCodec.split('.');
|
3241
|
+
var placeholders = ['0', '111', '01', '01', '01', '0'];
|
3242
|
+
for (var i = av1params.length; i > 4 && i < 10; i++) {
|
3243
|
+
av1params[i] = placeholders[i - 4];
|
3244
|
+
}
|
3245
|
+
return av1params.join('.');
|
3246
|
+
}
|
3247
|
+
return videoCodec;
|
3248
|
+
}
|
3224
3249
|
function getM2TSSupportedAudioTypes(preferManagedMediaSource) {
|
3225
3250
|
var MediaSource = getMediaSource(preferManagedMediaSource) || {
|
3226
3251
|
isTypeSupported: function isTypeSupported() {
|
@@ -7244,6 +7269,7 @@
|
|
7244
7269
|
this.resetLevels();
|
7245
7270
|
};
|
7246
7271
|
_proto.onManifestLoaded = function onManifestLoaded(event, data) {
|
7272
|
+
var _this2 = this;
|
7247
7273
|
var preferManagedMediaSource = this.hls.config.preferManagedMediaSource;
|
7248
7274
|
var levels = [];
|
7249
7275
|
var redundantSet = {};
|
@@ -7268,10 +7294,27 @@
|
|
7268
7294
|
var width = levelParsed.width,
|
7269
7295
|
height = levelParsed.height,
|
7270
7296
|
unknownCodecs = levelParsed.unknownCodecs;
|
7297
|
+
var unknownUnsupportedCodecCount = unknownCodecs ? unknownCodecs.length : 0;
|
7298
|
+
if (unknownCodecs) {
|
7299
|
+
// Treat unknown codec as audio or video codec based on passing `isTypeSupported` check
|
7300
|
+
// (allows for playback of any supported codec even if not indexed in utils/codecs)
|
7301
|
+
for (var i = unknownUnsupportedCodecCount; i--;) {
|
7302
|
+
var unknownCodec = unknownCodecs[i];
|
7303
|
+
if (_this2.isAudioSupported(unknownCodec)) {
|
7304
|
+
levelParsed.audioCodec = audioCodec = audioCodec ? audioCodec + "," + unknownCodec : unknownCodec;
|
7305
|
+
unknownUnsupportedCodecCount--;
|
7306
|
+
sampleEntryCodesISO.audio[audioCodec.substring(0, 4)] = 2;
|
7307
|
+
} else if (_this2.isVideoSupported(unknownCodec)) {
|
7308
|
+
levelParsed.videoCodec = videoCodec = videoCodec ? videoCodec + "," + unknownCodec : unknownCodec;
|
7309
|
+
unknownUnsupportedCodecCount--;
|
7310
|
+
sampleEntryCodesISO.video[videoCodec.substring(0, 4)] = 2;
|
7311
|
+
}
|
7312
|
+
}
|
7313
|
+
}
|
7271
7314
|
resolutionFound || (resolutionFound = !!(width && height));
|
7272
7315
|
videoCodecFound || (videoCodecFound = !!videoCodec);
|
7273
7316
|
audioCodecFound || (audioCodecFound = !!audioCodec);
|
7274
|
-
if (
|
7317
|
+
if (unknownUnsupportedCodecCount || audioCodec && !_this2.isAudioSupported(audioCodec) || videoCodec && !_this2.isVideoSupported(videoCodec)) {
|
7275
7318
|
return;
|
7276
7319
|
}
|
7277
7320
|
var CODECS = attributes.CODECS,
|
@@ -7302,8 +7345,14 @@
|
|
7302
7345
|
});
|
7303
7346
|
this.filterAndSortMediaOptions(levels, data, resolutionFound, videoCodecFound, audioCodecFound);
|
7304
7347
|
};
|
7348
|
+
_proto.isAudioSupported = function isAudioSupported(codec) {
|
7349
|
+
return areCodecsMediaSourceSupported(codec, 'audio', this.hls.config.preferManagedMediaSource);
|
7350
|
+
};
|
7351
|
+
_proto.isVideoSupported = function isVideoSupported(codec) {
|
7352
|
+
return areCodecsMediaSourceSupported(codec, 'video', this.hls.config.preferManagedMediaSource);
|
7353
|
+
};
|
7305
7354
|
_proto.filterAndSortMediaOptions = function filterAndSortMediaOptions(filteredLevels, data, resolutionFound, videoCodecFound, audioCodecFound) {
|
7306
|
-
var
|
7355
|
+
var _this3 = this;
|
7307
7356
|
var audioTracks = [];
|
7308
7357
|
var subtitleTracks = [];
|
7309
7358
|
var levels = filteredLevels;
|
@@ -7321,12 +7370,12 @@
|
|
7321
7370
|
if (levels.length === 0) {
|
7322
7371
|
// Dispatch error after MANIFEST_LOADED is done propagating
|
7323
7372
|
Promise.resolve().then(function () {
|
7324
|
-
if (
|
7373
|
+
if (_this3.hls) {
|
7325
7374
|
if (data.levels.length) {
|
7326
|
-
|
7375
|
+
_this3.warn("One or more CODECS in variant not supported: " + JSON.stringify(data.levels[0].attrs));
|
7327
7376
|
}
|
7328
7377
|
var error = new Error('no level with compatible codecs found in manifest');
|
7329
|
-
|
7378
|
+
_this3.hls.trigger(Events.ERROR, {
|
7330
7379
|
type: ErrorTypes.MEDIA_ERROR,
|
7331
7380
|
details: ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,
|
7332
7381
|
fatal: true,
|
@@ -7339,9 +7388,8 @@
|
|
7339
7388
|
return;
|
7340
7389
|
}
|
7341
7390
|
if (data.audioTracks) {
|
7342
|
-
var preferManagedMediaSource = this.hls.config.preferManagedMediaSource;
|
7343
7391
|
audioTracks = data.audioTracks.filter(function (track) {
|
7344
|
-
return !track.audioCodec ||
|
7392
|
+
return !track.audioCodec || _this3.isAudioSupported(track.audioCodec);
|
7345
7393
|
});
|
7346
7394
|
// Assign ids after filtering as array indices by group-id
|
7347
7395
|
assignTrackIdsByGroup(audioTracks);
|
@@ -7537,18 +7585,18 @@
|
|
7537
7585
|
}
|
7538
7586
|
};
|
7539
7587
|
_proto.removeLevel = function removeLevel(levelIndex) {
|
7540
|
-
var
|
7588
|
+
var _this4 = this,
|
7541
7589
|
_this$currentLevel;
|
7542
7590
|
var levels = this._levels.filter(function (level, index) {
|
7543
7591
|
if (index !== levelIndex) {
|
7544
7592
|
return true;
|
7545
7593
|
}
|
7546
|
-
if (
|
7547
|
-
|
7594
|
+
if (_this4.steering) {
|
7595
|
+
_this4.steering.removeLevel(level);
|
7548
7596
|
}
|
7549
|
-
if (level ===
|
7550
|
-
|
7551
|
-
|
7597
|
+
if (level === _this4.currentLevel) {
|
7598
|
+
_this4.currentLevel = null;
|
7599
|
+
_this4.currentLevelIndex = -1;
|
7552
7600
|
if (level.details) {
|
7553
7601
|
level.details.fragments.forEach(function (f) {
|
7554
7602
|
return f.level = -1;
|
@@ -15993,7 +16041,7 @@
|
|
15993
16041
|
}
|
15994
16042
|
var initData = this.initData = parseInitSegment(initSegment);
|
15995
16043
|
|
15996
|
-
// Get codec from initSegment
|
16044
|
+
// Get codec from initSegment
|
15997
16045
|
if (initData.audio) {
|
15998
16046
|
audioCodec = getParsedTrackCodec(initData.audio, ElementaryStreamTypes.AUDIO);
|
15999
16047
|
}
|
@@ -16147,20 +16195,13 @@
|
|
16147
16195
|
var preferManagedMediaSource = false;
|
16148
16196
|
return getCodecCompatibleName(parsedCodec, preferManagedMediaSource);
|
16149
16197
|
}
|
16150
|
-
|
16151
|
-
|
16152
|
-
return result;
|
16198
|
+
logger.warn("Unhandled audio codec \"" + parsedCodec + "\" in mp4 MAP");
|
16199
|
+
return parsedCodec || 'mp4a';
|
16153
16200
|
}
|
16154
16201
|
// Provide defaults based on codec type
|
16155
16202
|
// This allows for some playback of some fmp4 playlists without CODECS defined in manifest
|
16156
|
-
|
16157
|
-
|
16158
|
-
return 'hvc1.1.6.L120.90';
|
16159
|
-
}
|
16160
|
-
if (parsedCodec === 'av01') {
|
16161
|
-
return 'av01.0.04M.08';
|
16162
|
-
}
|
16163
|
-
return 'avc1.42e01e';
|
16203
|
+
logger.warn("Unhandled video codec \"" + parsedCodec + "\" in mp4 MAP");
|
16204
|
+
return parsedCodec || 'avc1';
|
16164
16205
|
}
|
16165
16206
|
|
16166
16207
|
var now;
|
@@ -17037,7 +17078,7 @@
|
|
17037
17078
|
return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
|
17038
17079
|
}
|
17039
17080
|
|
17040
|
-
var version = "1.5.14-0.canary.
|
17081
|
+
var version = "1.5.14-0.canary.10669";
|
17041
17082
|
|
17042
17083
|
// ensure the worker ends up in the bundle
|
17043
17084
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -18764,7 +18805,13 @@
|
|
18764
18805
|
video = tracks.video,
|
18765
18806
|
audiovideo = tracks.audiovideo;
|
18766
18807
|
if (audio) {
|
18767
|
-
var audioCodec = currentLevel.audioCodec;
|
18808
|
+
var audioCodec = pickMostCompleteCodecName(audio.codec, currentLevel.audioCodec);
|
18809
|
+
// Add level and profile to make up for passthrough-remuxer not being able to parse full codec
|
18810
|
+
// (logger warning "Unhandled audio codec...")
|
18811
|
+
if (audioCodec === 'mp4a') {
|
18812
|
+
audioCodec = 'mp4a.40.5';
|
18813
|
+
}
|
18814
|
+
// Handle `audioCodecSwitch`
|
18768
18815
|
var ua = navigator.userAgent.toLowerCase();
|
18769
18816
|
if (this.audioCodecSwitch) {
|
18770
18817
|
if (audioCodec) {
|
@@ -18799,7 +18846,24 @@
|
|
18799
18846
|
if (video) {
|
18800
18847
|
video.levelCodec = currentLevel.videoCodec;
|
18801
18848
|
video.id = 'main';
|
18802
|
-
|
18849
|
+
var parsedVideoCodec = video.codec;
|
18850
|
+
if ((parsedVideoCodec == null ? void 0 : parsedVideoCodec.length) === 4) {
|
18851
|
+
// Make up for passthrough-remuxer not being able to parse full codec
|
18852
|
+
// (logger warning "Unhandled video codec...")
|
18853
|
+
switch (parsedVideoCodec) {
|
18854
|
+
case 'hvc1':
|
18855
|
+
case 'hev1':
|
18856
|
+
video.codec = 'hvc1.1.6.L120.90';
|
18857
|
+
break;
|
18858
|
+
case 'av01':
|
18859
|
+
video.codec = 'av01.0.04M.08';
|
18860
|
+
break;
|
18861
|
+
case 'avc1':
|
18862
|
+
video.codec = 'avc1.42e01e';
|
18863
|
+
break;
|
18864
|
+
}
|
18865
|
+
}
|
18866
|
+
this.log("Init video buffer, container:" + video.container + ", codecs[level/parsed]=[" + (currentLevel.videoCodec || '') + "/" + parsedVideoCodec + (video.codec !== parsedVideoCodec ? ' parsed-corrected=' + video.codec : '') + "}]");
|
18803
18867
|
delete tracks.audiovideo;
|
18804
18868
|
}
|
18805
18869
|
if (audiovideo) {
|
@@ -19145,28 +19209,31 @@
|
|
19145
19209
|
function getMediaDecodingInfoPromise(level, audioTracksByGroup, mediaCapabilities) {
|
19146
19210
|
var videoCodecs = level.videoCodec;
|
19147
19211
|
var audioCodecs = level.audioCodec;
|
19148
|
-
if (!videoCodecs
|
19212
|
+
if (!videoCodecs && !audioCodecs || !mediaCapabilities) {
|
19149
19213
|
return Promise.resolve(SUPPORTED_INFO_DEFAULT);
|
19150
19214
|
}
|
19151
|
-
var
|
19152
|
-
|
19153
|
-
|
19154
|
-
|
19155
|
-
|
19156
|
-
|
19157
|
-
|
19158
|
-
|
19159
|
-
if (videoRange !== 'SDR') {
|
19160
|
-
baseVideoConfiguration.transferFunction = videoRange.toLowerCase();
|
19161
|
-
}
|
19162
|
-
var configurations = videoCodecs.split(',').map(function (videoCodec) {
|
19163
|
-
return {
|
19164
|
-
type: 'media-source',
|
19165
|
-
video: _objectSpread2(_objectSpread2({}, baseVideoConfiguration), {}, {
|
19166
|
-
contentType: mimeTypeForCodec(videoCodec, 'video')
|
19167
|
-
})
|
19215
|
+
var configurations = [];
|
19216
|
+
if (videoCodecs) {
|
19217
|
+
var baseVideoConfiguration = {
|
19218
|
+
width: level.width,
|
19219
|
+
height: level.height,
|
19220
|
+
bitrate: Math.ceil(Math.max(level.bitrate * 0.9, level.averageBitrate)),
|
19221
|
+
// Assume a framerate of 30fps since MediaCapabilities will not accept Level default of 0.
|
19222
|
+
framerate: level.frameRate || 30
|
19168
19223
|
};
|
19169
|
-
|
19224
|
+
var videoRange = level.videoRange;
|
19225
|
+
if (videoRange !== 'SDR') {
|
19226
|
+
baseVideoConfiguration.transferFunction = videoRange.toLowerCase();
|
19227
|
+
}
|
19228
|
+
configurations.push.apply(configurations, videoCodecs.split(',').map(function (videoCodec) {
|
19229
|
+
return {
|
19230
|
+
type: 'media-source',
|
19231
|
+
video: _objectSpread2(_objectSpread2({}, baseVideoConfiguration), {}, {
|
19232
|
+
contentType: mimeTypeForCodec(fillInMissingAV01Params(videoCodec), 'video')
|
19233
|
+
})
|
19234
|
+
};
|
19235
|
+
}));
|
19236
|
+
}
|
19170
19237
|
if (audioCodecs && level.audioGroups) {
|
19171
19238
|
level.audioGroups.forEach(function (audioGroupId) {
|
19172
19239
|
var _audioTracksByGroup$g;
|
@@ -22899,7 +22966,7 @@
|
|
22899
22966
|
if (trackName.slice(0, 5) === 'audio') {
|
22900
22967
|
trackCodec = getCodecCompatibleName(trackCodec, _this9.appendSource);
|
22901
22968
|
}
|
22902
|
-
_this9.log("switching codec " + sbCodec + " to " +
|
22969
|
+
_this9.log("switching codec " + sbCodec + " to " + trackCodec);
|
22903
22970
|
if (trackCodec !== (track.pendingCodec || track.codec)) {
|
22904
22971
|
track.pendingCodec = trackCodec;
|
22905
22972
|
}
|
@@ -23563,7 +23630,7 @@
|
|
23563
23630
|
}
|
23564
23631
|
};
|
23565
23632
|
_proto.getTrackCodec = function getTrackCodec(track, trackName) {
|
23566
|
-
var codec = track.codec
|
23633
|
+
var codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
|
23567
23634
|
if (codec) {
|
23568
23635
|
if (trackName.slice(0, 5) === 'audio') {
|
23569
23636
|
return getCodecCompatibleName(codec, this.appendSource);
|
@@ -34025,6 +34092,16 @@
|
|
34025
34092
|
/**
|
34026
34093
|
* Get the complete list of audio tracks across all media groups
|
34027
34094
|
*/;
|
34095
|
+
/**
|
34096
|
+
* returns mediaCapabilities.decodingInfo for a variant/rendition
|
34097
|
+
*/
|
34098
|
+
_proto.getMediaDecodingInfo = function getMediaDecodingInfo(level, audioTracks) {
|
34099
|
+
if (audioTracks === void 0) {
|
34100
|
+
audioTracks = this.allAudioTracks;
|
34101
|
+
}
|
34102
|
+
var audioTracksByGroup = getAudioTracksByGroup(audioTracks);
|
34103
|
+
return getMediaDecodingInfoPromise(level, audioTracksByGroup, navigator.mediaCapabilities);
|
34104
|
+
};
|
34028
34105
|
return _createClass(Hls, [{
|
34029
34106
|
key: "url",
|
34030
34107
|
get: function get() {
|
package/dist/hls.js.d.ts
CHANGED
@@ -1736,11 +1736,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1736
1736
|
/**
|
1737
1737
|
* Get the complete list of audio tracks across all media groups
|
1738
1738
|
*/
|
1739
|
-
get allAudioTracks():
|
1739
|
+
get allAudioTracks(): MediaPlaylist[];
|
1740
1740
|
/**
|
1741
1741
|
* Get the list of selectable audio tracks
|
1742
1742
|
*/
|
1743
|
-
get audioTracks():
|
1743
|
+
get audioTracks(): MediaPlaylist[];
|
1744
1744
|
/**
|
1745
1745
|
* index of the selected audio track (index in audio track lists)
|
1746
1746
|
*/
|
@@ -1752,11 +1752,11 @@ declare class Hls implements HlsEventEmitter {
|
|
1752
1752
|
/**
|
1753
1753
|
* get the complete list of subtitle tracks across all media groups
|
1754
1754
|
*/
|
1755
|
-
get allSubtitleTracks():
|
1755
|
+
get allSubtitleTracks(): MediaPlaylist[];
|
1756
1756
|
/**
|
1757
1757
|
* get alternate subtitle tracks list from playlist
|
1758
1758
|
*/
|
1759
|
-
get subtitleTracks():
|
1759
|
+
get subtitleTracks(): MediaPlaylist[];
|
1760
1760
|
/**
|
1761
1761
|
* index of the selected subtitle track (index in subtitle track lists)
|
1762
1762
|
*/
|
@@ -1824,6 +1824,10 @@ declare class Hls implements HlsEventEmitter {
|
|
1824
1824
|
* returns Interstitials Program Manager
|
1825
1825
|
*/
|
1826
1826
|
get interstitialsManager(): InterstitialsManager | null;
|
1827
|
+
/**
|
1828
|
+
* returns mediaCapabilities.decodingInfo for a variant/rendition
|
1829
|
+
*/
|
1830
|
+
getMediaDecodingInfo(level: Level, audioTracks?: MediaPlaylist[]): Promise<MediaDecodingInfo>;
|
1827
1831
|
}
|
1828
1832
|
export default Hls;
|
1829
1833
|
|