hls.js 1.5.14-0.canary.10668 → 1.5.14-0.canary.10670

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 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(): Array<MediaPlaylist>;
1739
+ get allAudioTracks(): MediaPlaylist[];
1740
1740
  /**
1741
1741
  * Get the list of selectable audio tracks
1742
1742
  */
1743
- get audioTracks(): Array<MediaPlaylist>;
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(): Array<MediaPlaylist>;
1755
+ get allSubtitleTracks(): MediaPlaylist[];
1756
1756
  /**
1757
1757
  * get alternate subtitle tracks list from playlist
1758
1758
  */
1759
- get subtitleTracks(): Array<MediaPlaylist>;
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(): Array<MediaPlaylist>;
1739
+ get allAudioTracks(): MediaPlaylist[];
1740
1740
  /**
1741
1741
  * Get the list of selectable audio tracks
1742
1742
  */
1743
- get audioTracks(): Array<MediaPlaylist>;
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(): Array<MediaPlaylist>;
1755
+ get allSubtitleTracks(): MediaPlaylist[];
1756
1756
  /**
1757
1757
  * get alternate subtitle tracks list from playlist
1758
1758
  */
1759
- get subtitleTracks(): Array<MediaPlaylist>;
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.10668");
545
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.14-0.canary.10670");
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=\"" + codec + "\"",
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=\"" + codec + "\"",
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=\"" + codec + "\"";
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 !== 'mp4a') {
3204
+ if (parsedCodec && (parsedCodec.length > 4 || ['ac-3', 'ec-3', 'alac', 'fLaC', 'Opus'].indexOf(parsedCodec) !== -1)) {
3205
3205
  return parsedCodec;
3206
3206
  }
3207
- return levelCodec ? levelCodec.split(',')[0] : levelCodec;
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(codec) {
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 = codec.split(',');
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 (unknownCodecs != null && unknownCodecs.length || audioCodec && !areCodecsMediaSourceSupported(audioCodec, 'audio', preferManagedMediaSource) || videoCodec && !areCodecsMediaSourceSupported(videoCodec, 'video', preferManagedMediaSource)) {
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 _this2 = this;
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 (_this2.hls) {
7373
+ if (_this3.hls) {
7325
7374
  if (data.levels.length) {
7326
- _this2.warn("One or more CODECS in variant not supported: " + JSON.stringify(data.levels[0].attrs));
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
- _this2.hls.trigger(Events.ERROR, {
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 || areCodecsMediaSourceSupported(track.audioCodec, 'audio', preferManagedMediaSource);
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 _this3 = this,
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 (_this3.steering) {
7547
- _this3.steering.removeLevel(level);
7594
+ if (_this4.steering) {
7595
+ _this4.steering.removeLevel(level);
7548
7596
  }
7549
- if (level === _this3.currentLevel) {
7550
- _this3.currentLevel = null;
7551
- _this3.currentLevelIndex = -1;
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;
@@ -12872,7 +12920,7 @@
12872
12920
  track.params[_prop] = _config2[_prop];
12873
12921
  }
12874
12922
  }
12875
- if (_this2.initVPS !== null || track.pps.length === 0) {
12923
+ if (track.vps !== undefined && track.vps[0] === _this2.initVPS) {
12876
12924
  track.pps.push(unit.data);
12877
12925
  }
12878
12926
  }
@@ -12923,6 +12971,12 @@
12923
12971
  }
12924
12972
  return new Uint8Array(dst.buffer, 0, dstIdx);
12925
12973
  };
12974
+ _proto.pushAccessUnit = function pushAccessUnit(VideoSample, videoTrack) {
12975
+ _BaseVideoParser.prototype.pushAccessUnit.call(this, VideoSample, videoTrack);
12976
+ if (this.initVPS) {
12977
+ this.initVPS = null; // null initVPS to prevent possible track's sps/pps growth until next VPS
12978
+ }
12979
+ };
12926
12980
  _proto.readVPS = function readVPS(vps) {
12927
12981
  var eg = new ExpGolomb(vps);
12928
12982
  // remove header
@@ -15993,7 +16047,7 @@
15993
16047
  }
15994
16048
  var initData = this.initData = parseInitSegment(initSegment);
15995
16049
 
15996
- // Get codec from initSegment or fallback to default
16050
+ // Get codec from initSegment
15997
16051
  if (initData.audio) {
15998
16052
  audioCodec = getParsedTrackCodec(initData.audio, ElementaryStreamTypes.AUDIO);
15999
16053
  }
@@ -16147,20 +16201,13 @@
16147
16201
  var preferManagedMediaSource = false;
16148
16202
  return getCodecCompatibleName(parsedCodec, preferManagedMediaSource);
16149
16203
  }
16150
- var result = 'mp4a.40.5';
16151
- this.logger.info("Parsed audio codec \"" + parsedCodec + "\" or audio object type not handled. Using \"" + result + "\"");
16152
- return result;
16204
+ logger.warn("Unhandled audio codec \"" + parsedCodec + "\" in mp4 MAP");
16205
+ return parsedCodec || 'mp4a';
16153
16206
  }
16154
16207
  // Provide defaults based on codec type
16155
16208
  // This allows for some playback of some fmp4 playlists without CODECS defined in manifest
16156
- this.logger.warn("Unhandled video codec \"" + parsedCodec + "\"");
16157
- if (parsedCodec === 'hvc1' || parsedCodec === 'hev1') {
16158
- return 'hvc1.1.6.L120.90';
16159
- }
16160
- if (parsedCodec === 'av01') {
16161
- return 'av01.0.04M.08';
16162
- }
16163
- return 'avc1.42e01e';
16209
+ logger.warn("Unhandled video codec \"" + parsedCodec + "\" in mp4 MAP");
16210
+ return parsedCodec || 'avc1';
16164
16211
  }
16165
16212
 
16166
16213
  var now;
@@ -17037,7 +17084,7 @@
17037
17084
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
17038
17085
  }
17039
17086
 
17040
- var version = "1.5.14-0.canary.10668";
17087
+ var version = "1.5.14-0.canary.10670";
17041
17088
 
17042
17089
  // ensure the worker ends up in the bundle
17043
17090
  // If the worker should not be included this gets aliased to empty.js
@@ -18764,7 +18811,13 @@
18764
18811
  video = tracks.video,
18765
18812
  audiovideo = tracks.audiovideo;
18766
18813
  if (audio) {
18767
- var audioCodec = currentLevel.audioCodec;
18814
+ var audioCodec = pickMostCompleteCodecName(audio.codec, currentLevel.audioCodec);
18815
+ // Add level and profile to make up for passthrough-remuxer not being able to parse full codec
18816
+ // (logger warning "Unhandled audio codec...")
18817
+ if (audioCodec === 'mp4a') {
18818
+ audioCodec = 'mp4a.40.5';
18819
+ }
18820
+ // Handle `audioCodecSwitch`
18768
18821
  var ua = navigator.userAgent.toLowerCase();
18769
18822
  if (this.audioCodecSwitch) {
18770
18823
  if (audioCodec) {
@@ -18799,7 +18852,24 @@
18799
18852
  if (video) {
18800
18853
  video.levelCodec = currentLevel.videoCodec;
18801
18854
  video.id = 'main';
18802
- this.log("Init video buffer, container:" + video.container + ", codecs[level/parsed]=[" + (currentLevel.videoCodec || '') + "/" + video.codec + "]");
18855
+ var parsedVideoCodec = video.codec;
18856
+ if ((parsedVideoCodec == null ? void 0 : parsedVideoCodec.length) === 4) {
18857
+ // Make up for passthrough-remuxer not being able to parse full codec
18858
+ // (logger warning "Unhandled video codec...")
18859
+ switch (parsedVideoCodec) {
18860
+ case 'hvc1':
18861
+ case 'hev1':
18862
+ video.codec = 'hvc1.1.6.L120.90';
18863
+ break;
18864
+ case 'av01':
18865
+ video.codec = 'av01.0.04M.08';
18866
+ break;
18867
+ case 'avc1':
18868
+ video.codec = 'avc1.42e01e';
18869
+ break;
18870
+ }
18871
+ }
18872
+ this.log("Init video buffer, container:" + video.container + ", codecs[level/parsed]=[" + (currentLevel.videoCodec || '') + "/" + parsedVideoCodec + (video.codec !== parsedVideoCodec ? ' parsed-corrected=' + video.codec : '') + "}]");
18803
18873
  delete tracks.audiovideo;
18804
18874
  }
18805
18875
  if (audiovideo) {
@@ -19145,28 +19215,31 @@
19145
19215
  function getMediaDecodingInfoPromise(level, audioTracksByGroup, mediaCapabilities) {
19146
19216
  var videoCodecs = level.videoCodec;
19147
19217
  var audioCodecs = level.audioCodec;
19148
- if (!videoCodecs || !audioCodecs || !mediaCapabilities) {
19218
+ if (!videoCodecs && !audioCodecs || !mediaCapabilities) {
19149
19219
  return Promise.resolve(SUPPORTED_INFO_DEFAULT);
19150
19220
  }
19151
- var baseVideoConfiguration = {
19152
- width: level.width,
19153
- height: level.height,
19154
- bitrate: Math.ceil(Math.max(level.bitrate * 0.9, level.averageBitrate)),
19155
- // Assume a framerate of 30fps since MediaCapabilities will not accept Level default of 0.
19156
- framerate: level.frameRate || 30
19157
- };
19158
- var videoRange = level.videoRange;
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
- })
19221
+ var configurations = [];
19222
+ if (videoCodecs) {
19223
+ var baseVideoConfiguration = {
19224
+ width: level.width,
19225
+ height: level.height,
19226
+ bitrate: Math.ceil(Math.max(level.bitrate * 0.9, level.averageBitrate)),
19227
+ // Assume a framerate of 30fps since MediaCapabilities will not accept Level default of 0.
19228
+ framerate: level.frameRate || 30
19168
19229
  };
19169
- });
19230
+ var videoRange = level.videoRange;
19231
+ if (videoRange !== 'SDR') {
19232
+ baseVideoConfiguration.transferFunction = videoRange.toLowerCase();
19233
+ }
19234
+ configurations.push.apply(configurations, videoCodecs.split(',').map(function (videoCodec) {
19235
+ return {
19236
+ type: 'media-source',
19237
+ video: _objectSpread2(_objectSpread2({}, baseVideoConfiguration), {}, {
19238
+ contentType: mimeTypeForCodec(fillInMissingAV01Params(videoCodec), 'video')
19239
+ })
19240
+ };
19241
+ }));
19242
+ }
19170
19243
  if (audioCodecs && level.audioGroups) {
19171
19244
  level.audioGroups.forEach(function (audioGroupId) {
19172
19245
  var _audioTracksByGroup$g;
@@ -22899,7 +22972,7 @@
22899
22972
  if (trackName.slice(0, 5) === 'audio') {
22900
22973
  trackCodec = getCodecCompatibleName(trackCodec, _this9.appendSource);
22901
22974
  }
22902
- _this9.log("switching codec " + sbCodec + " to " + codec);
22975
+ _this9.log("switching codec " + sbCodec + " to " + trackCodec);
22903
22976
  if (trackCodec !== (track.pendingCodec || track.codec)) {
22904
22977
  track.pendingCodec = trackCodec;
22905
22978
  }
@@ -23563,7 +23636,7 @@
23563
23636
  }
23564
23637
  };
23565
23638
  _proto.getTrackCodec = function getTrackCodec(track, trackName) {
23566
- var codec = track.codec || track.levelCodec;
23639
+ var codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
23567
23640
  if (codec) {
23568
23641
  if (trackName.slice(0, 5) === 'audio') {
23569
23642
  return getCodecCompatibleName(codec, this.appendSource);
@@ -34025,6 +34098,16 @@
34025
34098
  /**
34026
34099
  * Get the complete list of audio tracks across all media groups
34027
34100
  */;
34101
+ /**
34102
+ * returns mediaCapabilities.decodingInfo for a variant/rendition
34103
+ */
34104
+ _proto.getMediaDecodingInfo = function getMediaDecodingInfo(level, audioTracks) {
34105
+ if (audioTracks === void 0) {
34106
+ audioTracks = this.allAudioTracks;
34107
+ }
34108
+ var audioTracksByGroup = getAudioTracksByGroup(audioTracks);
34109
+ return getMediaDecodingInfoPromise(level, audioTracksByGroup, navigator.mediaCapabilities);
34110
+ };
34028
34111
  return _createClass(Hls, [{
34029
34112
  key: "url",
34030
34113
  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(): Array<MediaPlaylist>;
1739
+ get allAudioTracks(): MediaPlaylist[];
1740
1740
  /**
1741
1741
  * Get the list of selectable audio tracks
1742
1742
  */
1743
- get audioTracks(): Array<MediaPlaylist>;
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(): Array<MediaPlaylist>;
1755
+ get allSubtitleTracks(): MediaPlaylist[];
1756
1756
  /**
1757
1757
  * get alternate subtitle tracks list from playlist
1758
1758
  */
1759
- get subtitleTracks(): Array<MediaPlaylist>;
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