hls.js 1.6.0-beta.4.0.canary.11068 → 1.6.0-rc.1

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
@@ -96,7 +96,7 @@ export declare class AttrList {
96
96
  constructor(attrs: string | Record<string, any>, parsed?: Pick<ParsedMultivariantPlaylist | LevelDetails, 'variableList' | 'hasVariableRefs' | 'playlistParsingError'>);
97
97
  get clientAttrs(): string[];
98
98
  decimalInteger(attrName: string): number;
99
- hexadecimalInteger(attrName: string): Uint8Array | null;
99
+ hexadecimalInteger(attrName: string): Uint8Array<ArrayBuffer> | null;
100
100
  hexadecimalIntegerAsNumber(attrName: string): number;
101
101
  decimalFloatingPoint(attrName: string): number;
102
102
  optionalFloat(attrName: string, defaultValue: number): number;
@@ -394,6 +394,7 @@ export declare interface BaseTrack {
394
394
  id: 'audio' | 'main';
395
395
  container: string;
396
396
  codec?: string;
397
+ supplemental?: string;
397
398
  levelCodec?: string;
398
399
  pendingCodec?: string;
399
400
  metadata?: {
@@ -759,6 +760,13 @@ export declare type CMCDControllerConfig = {
759
760
  includeKeys?: string[];
760
761
  };
761
762
 
763
+ export declare interface CodecsParsed {
764
+ audioCodec?: string;
765
+ videoCodec?: string;
766
+ textCodec?: string;
767
+ unknownCodecs?: string[];
768
+ }
769
+
762
770
  export declare interface ComponentAPI {
763
771
  destroy(): void;
764
772
  }
@@ -2545,6 +2553,7 @@ export declare class Level {
2545
2553
  readonly height: number;
2546
2554
  readonly id: number;
2547
2555
  readonly name: string;
2556
+ readonly supplemental: CodecsParsed | undefined;
2548
2557
  readonly videoCodec: string | undefined;
2549
2558
  readonly width: number;
2550
2559
  details?: LevelDetails;
@@ -2711,18 +2720,15 @@ export declare interface LevelLoadingData {
2711
2720
  deliveryDirectives: HlsUrlParameters | null;
2712
2721
  }
2713
2722
 
2714
- export declare interface LevelParsed {
2723
+ export declare interface LevelParsed extends CodecsParsed {
2715
2724
  attrs: LevelAttributes;
2716
- audioCodec?: string;
2717
2725
  bitrate: number;
2718
2726
  details?: LevelDetails;
2719
2727
  height?: number;
2720
2728
  id?: number;
2721
2729
  name: string;
2722
- textCodec?: string;
2723
- unknownCodecs?: string[];
2730
+ supplemental?: CodecsParsed;
2724
2731
  url: string;
2725
- videoCodec?: string;
2726
2732
  width?: number;
2727
2733
  }
2728
2734
 
package/dist/hls.d.ts CHANGED
@@ -96,7 +96,7 @@ export declare class AttrList {
96
96
  constructor(attrs: string | Record<string, any>, parsed?: Pick<ParsedMultivariantPlaylist | LevelDetails, 'variableList' | 'hasVariableRefs' | 'playlistParsingError'>);
97
97
  get clientAttrs(): string[];
98
98
  decimalInteger(attrName: string): number;
99
- hexadecimalInteger(attrName: string): Uint8Array | null;
99
+ hexadecimalInteger(attrName: string): Uint8Array<ArrayBuffer> | null;
100
100
  hexadecimalIntegerAsNumber(attrName: string): number;
101
101
  decimalFloatingPoint(attrName: string): number;
102
102
  optionalFloat(attrName: string, defaultValue: number): number;
@@ -394,6 +394,7 @@ export declare interface BaseTrack {
394
394
  id: 'audio' | 'main';
395
395
  container: string;
396
396
  codec?: string;
397
+ supplemental?: string;
397
398
  levelCodec?: string;
398
399
  pendingCodec?: string;
399
400
  metadata?: {
@@ -759,6 +760,13 @@ export declare type CMCDControllerConfig = {
759
760
  includeKeys?: string[];
760
761
  };
761
762
 
763
+ export declare interface CodecsParsed {
764
+ audioCodec?: string;
765
+ videoCodec?: string;
766
+ textCodec?: string;
767
+ unknownCodecs?: string[];
768
+ }
769
+
762
770
  export declare interface ComponentAPI {
763
771
  destroy(): void;
764
772
  }
@@ -2545,6 +2553,7 @@ export declare class Level {
2545
2553
  readonly height: number;
2546
2554
  readonly id: number;
2547
2555
  readonly name: string;
2556
+ readonly supplemental: CodecsParsed | undefined;
2548
2557
  readonly videoCodec: string | undefined;
2549
2558
  readonly width: number;
2550
2559
  details?: LevelDetails;
@@ -2711,18 +2720,15 @@ export declare interface LevelLoadingData {
2711
2720
  deliveryDirectives: HlsUrlParameters | null;
2712
2721
  }
2713
2722
 
2714
- export declare interface LevelParsed {
2723
+ export declare interface LevelParsed extends CodecsParsed {
2715
2724
  attrs: LevelAttributes;
2716
- audioCodec?: string;
2717
2725
  bitrate: number;
2718
2726
  details?: LevelDetails;
2719
2727
  height?: number;
2720
2728
  id?: number;
2721
2729
  name: string;
2722
- textCodec?: string;
2723
- unknownCodecs?: string[];
2730
+ supplemental?: CodecsParsed;
2724
2731
  url: string;
2725
- videoCodec?: string;
2726
2732
  width?: number;
2727
2733
  }
2728
2734
 
package/dist/hls.js CHANGED
@@ -1073,7 +1073,7 @@
1073
1073
  // Some browsers don't allow to use bind on console object anyway
1074
1074
  // fallback to default if needed
1075
1075
  try {
1076
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.4.0.canary.11068");
1076
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-rc.1");
1077
1077
  } catch (e) {
1078
1078
  /* log fn threw an exception. All logger methods are no-ops. */
1079
1079
  return createLogger();
@@ -1878,6 +1878,7 @@
1878
1878
  var sampleEntriesEnd = sampleEntries.subarray(8 + 78);
1879
1879
  var fourCC = bin2str(sampleEntries.subarray(4, 8));
1880
1880
  var codec = fourCC;
1881
+ var supplemental;
1881
1882
  var encrypted = fourCC === 'enca' || fourCC === 'encv';
1882
1883
  if (encrypted) {
1883
1884
  var encBox = findBox(sampleEntries, [fourCC])[0];
@@ -1897,6 +1898,7 @@
1897
1898
  }
1898
1899
  });
1899
1900
  }
1901
+ var codecFourCC = codec;
1900
1902
  switch (codec) {
1901
1903
  case 'avc1':
1902
1904
  case 'avc2':
@@ -1906,6 +1908,7 @@
1906
1908
  // extract profile + compatibility + level out of avcC box
1907
1909
  var avcCBox = findBox(sampleEntriesEnd, ['avcC'])[0];
1908
1910
  codec += '.' + toHex(avcCBox[1]) + toHex(avcCBox[2]) + toHex(avcCBox[3]);
1911
+ supplemental = parseSupplementalDoViCodec(codecFourCC === 'avc1' ? 'dva1' : 'dvav', sampleEntriesEnd);
1909
1912
  break;
1910
1913
  }
1911
1914
  case 'mp4a':
@@ -1956,55 +1959,59 @@
1956
1959
  case 'hvc1':
1957
1960
  case 'hev1':
1958
1961
  {
1959
- var hvcCBox = findBox(sampleEntriesEnd, ['hvcC'])[0];
1960
- var profileByte = hvcCBox[1];
1961
- var profileSpace = ['', 'A', 'B', 'C'][profileByte >> 6];
1962
- var generalProfileIdc = profileByte & 0x1f;
1963
- var profileCompat = readUint32(hvcCBox, 2);
1964
- var tierFlag = (profileByte & 0x20) >> 5 ? 'H' : 'L';
1965
- var levelIDC = hvcCBox[12];
1966
- var constraintIndicator = hvcCBox.subarray(6, 12);
1967
- codec += '.' + profileSpace + generalProfileIdc;
1968
- codec += '.' + profileCompat.toString(16).toUpperCase();
1969
- codec += '.' + tierFlag + levelIDC;
1970
- var constraintString = '';
1971
- for (var _i = constraintIndicator.length; _i--;) {
1972
- var _byte = constraintIndicator[_i];
1973
- if (_byte || constraintString) {
1974
- var encodedByte = _byte.toString(16).toUpperCase();
1975
- constraintString = '.' + encodedByte + constraintString;
1962
+ var hvcCBoxes = findBox(sampleEntriesEnd, ['hvcC']);
1963
+ if (hvcCBoxes) {
1964
+ var hvcCBox = hvcCBoxes[0];
1965
+ var profileByte = hvcCBox[1];
1966
+ var profileSpace = ['', 'A', 'B', 'C'][profileByte >> 6];
1967
+ var generalProfileIdc = profileByte & 0x1f;
1968
+ var profileCompat = readUint32(hvcCBox, 2);
1969
+ var tierFlag = (profileByte & 0x20) >> 5 ? 'H' : 'L';
1970
+ var levelIDC = hvcCBox[12];
1971
+ var constraintIndicator = hvcCBox.subarray(6, 12);
1972
+ codec += '.' + profileSpace + generalProfileIdc;
1973
+ codec += '.' + profileCompat.toString(16).toUpperCase();
1974
+ codec += '.' + tierFlag + levelIDC;
1975
+ var constraintString = '';
1976
+ for (var _i = constraintIndicator.length; _i--;) {
1977
+ var _byte = constraintIndicator[_i];
1978
+ if (_byte || constraintString) {
1979
+ var encodedByte = _byte.toString(16).toUpperCase();
1980
+ constraintString = '.' + encodedByte + constraintString;
1981
+ }
1976
1982
  }
1983
+ codec += constraintString;
1977
1984
  }
1978
- codec += constraintString;
1985
+ supplemental = parseSupplementalDoViCodec(codecFourCC == 'hev1' ? 'dvhe' : 'dvh1', sampleEntriesEnd);
1979
1986
  break;
1980
1987
  }
1981
1988
  case 'dvh1':
1982
1989
  case 'dvhe':
1990
+ case 'dvav':
1991
+ case 'dva1':
1992
+ case 'dav1':
1983
1993
  {
1984
- var dvcCBox = findBox(sampleEntriesEnd, ['dvcC'])[0];
1985
- var profile = dvcCBox[2] >> 1 & 0x7f;
1986
- var level = dvcCBox[2] << 5 & 0x20 | dvcCBox[3] >> 3 & 0x1f;
1987
- codec += '.' + addLeadingZero(profile) + '.' + addLeadingZero(level);
1994
+ codec = parseSupplementalDoViCodec(codec, sampleEntriesEnd) || codec;
1988
1995
  break;
1989
1996
  }
1990
1997
  case 'vp09':
1991
1998
  {
1992
1999
  var vpcCBox = findBox(sampleEntriesEnd, ['vpcC'])[0];
1993
- var _profile = vpcCBox[4];
1994
- var _level = vpcCBox[5];
2000
+ var profile = vpcCBox[4];
2001
+ var level = vpcCBox[5];
1995
2002
  var bitDepth = vpcCBox[6] >> 4 & 0x0f;
1996
- codec += '.' + addLeadingZero(_profile) + '.' + addLeadingZero(_level) + '.' + addLeadingZero(bitDepth);
2003
+ codec += '.' + addLeadingZero(profile) + '.' + addLeadingZero(level) + '.' + addLeadingZero(bitDepth);
1997
2004
  break;
1998
2005
  }
1999
2006
  case 'av01':
2000
2007
  {
2001
2008
  var av1CBox = findBox(sampleEntriesEnd, ['av1C'])[0];
2002
- var _profile2 = av1CBox[1] >>> 5;
2003
- var _level2 = av1CBox[1] & 0x1f;
2009
+ var _profile = av1CBox[1] >>> 5;
2010
+ var _level = av1CBox[1] & 0x1f;
2004
2011
  var _tierFlag = av1CBox[2] >>> 7 ? 'H' : 'M';
2005
2012
  var highBitDepth = (av1CBox[2] & 0x40) >> 6;
2006
2013
  var twelveBit = (av1CBox[2] & 0x20) >> 5;
2007
- var _bitDepth = _profile2 === 2 && highBitDepth ? twelveBit ? 12 : 10 : highBitDepth ? 10 : 8;
2014
+ var _bitDepth = _profile === 2 && highBitDepth ? twelveBit ? 12 : 10 : highBitDepth ? 10 : 8;
2008
2015
  var monochrome = (av1CBox[2] & 0x10) >> 4;
2009
2016
  var chromaSubsamplingX = (av1CBox[2] & 0x08) >> 3;
2010
2017
  var chromaSubsamplingY = (av1CBox[2] & 0x04) >> 2;
@@ -2016,15 +2023,26 @@
2016
2023
  var transferCharacteristics = 1;
2017
2024
  var matrixCoefficients = 1;
2018
2025
  var videoFullRangeFlag = 0;
2019
- codec += '.' + _profile2 + '.' + addLeadingZero(_level2) + _tierFlag + '.' + addLeadingZero(_bitDepth) + '.' + monochrome + '.' + chromaSubsamplingX + chromaSubsamplingY + chromaSamplePosition + '.' + addLeadingZero(colorPrimaries) + '.' + addLeadingZero(transferCharacteristics) + '.' + addLeadingZero(matrixCoefficients) + '.' + videoFullRangeFlag;
2026
+ codec += '.' + _profile + '.' + addLeadingZero(_level) + _tierFlag + '.' + addLeadingZero(_bitDepth) + '.' + monochrome + '.' + chromaSubsamplingX + chromaSubsamplingY + chromaSamplePosition + '.' + addLeadingZero(colorPrimaries) + '.' + addLeadingZero(transferCharacteristics) + '.' + addLeadingZero(matrixCoefficients) + '.' + videoFullRangeFlag;
2027
+ supplemental = parseSupplementalDoViCodec('dav1', sampleEntriesEnd);
2020
2028
  break;
2021
2029
  }
2022
2030
  }
2023
2031
  return {
2024
2032
  codec: codec,
2025
- encrypted: encrypted
2033
+ encrypted: encrypted,
2034
+ supplemental: supplemental
2026
2035
  };
2027
2036
  }
2037
+ function parseSupplementalDoViCodec(fourCC, sampleEntriesEnd) {
2038
+ var dvvCResult = findBox(sampleEntriesEnd, ['dvvC']); // used by DoVi Profile 8 to 10
2039
+ var dvXCBox = dvvCResult.length ? dvvCResult[0] : findBox(sampleEntriesEnd, ['dvcC'])[0]; // used by DoVi Profiles up to 7 and 20
2040
+ if (dvXCBox) {
2041
+ var doViProfile = dvXCBox[2] >> 1 & 0x7f;
2042
+ var doViLevel = dvXCBox[2] << 5 & 0x20 | dvXCBox[3] >> 3 & 0x1f;
2043
+ return fourCC + '.' + addLeadingZero(doViProfile) + '.' + addLeadingZero(doViLevel);
2044
+ }
2045
+ }
2028
2046
  function skipBERInteger(bytes, i) {
2029
2047
  var limit = i + 5;
2030
2048
  while (bytes[i++] & 0x80 && i < limit) {
@@ -2881,6 +2899,7 @@
2881
2899
  avc4: 1,
2882
2900
  avcp: 1,
2883
2901
  av01: 0.8,
2902
+ dav1: 0.8,
2884
2903
  drac: 1,
2885
2904
  dva1: 1,
2886
2905
  dvav: 1,
@@ -3061,6 +3080,18 @@
3061
3080
  smooth: true
3062
3081
  }]
3063
3082
  };
3083
+ function getUnsupportedResult(error, configurations) {
3084
+ return {
3085
+ supported: false,
3086
+ configurations: configurations,
3087
+ decodingInfoResults: [{
3088
+ supported: false,
3089
+ smooth: false,
3090
+ powerEfficient: false
3091
+ }],
3092
+ error: error
3093
+ };
3094
+ }
3064
3095
  var SUPPORTED_INFO_CACHE = {};
3065
3096
  function requiresMediaCapabilitiesDecodingInfo(level, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) {
3066
3097
  // Only test support when configuration is exceeds minimum options
@@ -3123,16 +3154,7 @@
3123
3154
  if (videoCodecsArray.some(function (videoCodec) {
3124
3155
  return isHEVC(videoCodec);
3125
3156
  }) && userAgentHevcSupportIsInaccurate()) {
3126
- return Promise.resolve({
3127
- supported: false,
3128
- configurations: configurations,
3129
- decodingInfoResults: [{
3130
- supported: false,
3131
- smooth: false,
3132
- powerEfficient: false
3133
- }],
3134
- error: new Error("Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (" + ua + ")")
3135
- });
3157
+ return Promise.resolve(getUnsupportedResult(new Error("Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (" + ua + ")"), configurations));
3136
3158
  }
3137
3159
  configurations.push.apply(configurations, videoCodecsArray.map(function (videoCodec) {
3138
3160
  return {
@@ -3272,6 +3294,7 @@
3272
3294
  this.height = void 0;
3273
3295
  this.id = void 0;
3274
3296
  this.name = void 0;
3297
+ this.supplemental = void 0;
3275
3298
  this.videoCodec = void 0;
3276
3299
  this.width = void 0;
3277
3300
  this.details = void 0;
@@ -3305,6 +3328,14 @@
3305
3328
  }).map(function (s) {
3306
3329
  return s.substring(0, 4);
3307
3330
  }).join(',');
3331
+ if ('supplemental' in data) {
3332
+ var _data$supplemental;
3333
+ this.supplemental = data.supplemental;
3334
+ var supplementalVideo = (_data$supplemental = data.supplemental) == null ? void 0 : _data$supplemental.videoCodec;
3335
+ if (supplementalVideo && supplementalVideo !== data.videoCodec) {
3336
+ this.codecSet += "," + supplementalVideo.substring(0, 4);
3337
+ }
3338
+ }
3308
3339
  this.addGroupId('audio', data.attrs.AUDIO);
3309
3340
  this.addGroupId('text', data.attrs.SUBTITLES);
3310
3341
  }
@@ -7677,6 +7708,11 @@
7677
7708
  level.height = resolution.height;
7678
7709
  }
7679
7710
  setCodecs(attrs.CODECS, level);
7711
+ var supplementalCodecs = attrs['SUPPLEMENTAL-CODECS'];
7712
+ if (supplementalCodecs) {
7713
+ level.supplemental = {};
7714
+ setCodecs(supplementalCodecs, level.supplemental);
7715
+ }
7680
7716
  if (!((_level$unknownCodecs = level.unknownCodecs) != null && _level$unknownCodecs.length)) {
7681
7717
  levelsWithKnownCodecs.push(level);
7682
7718
  }
@@ -8267,7 +8303,9 @@
8267
8303
  });
8268
8304
  if (filtered.length) {
8269
8305
  // Comma separated list of all codecs for type
8270
- level[type + "Codec"] = filtered.join(',');
8306
+ level[type + "Codec"] = filtered.map(function (c) {
8307
+ return c.split('/')[0];
8308
+ }).join(',');
8271
8309
  // Remove known codecs so that only unknownCodecs are left after iterating through each type
8272
8310
  codecs = codecs.filter(function (codec) {
8273
8311
  return filtered.indexOf(codec) === -1;
@@ -11749,10 +11787,12 @@
11749
11787
  var _initData$video = initData.video,
11750
11788
  id = _initData$video.id,
11751
11789
  timescale = _initData$video.timescale,
11752
- codec = _initData$video.codec;
11790
+ codec = _initData$video.codec,
11791
+ supplemental = _initData$video.supplemental;
11753
11792
  videoTrack.id = id;
11754
11793
  videoTrack.timescale = captionTrack.timescale = timescale;
11755
11794
  videoTrack.codec = codec;
11795
+ videoTrack.supplemental = supplemental;
11756
11796
  }
11757
11797
  if (initData.audio) {
11758
11798
  var _initData$audio = initData.audio,
@@ -15769,6 +15809,7 @@
15769
15809
  tracks.video = {
15770
15810
  container: 'video/mp4',
15771
15811
  codec: videoCodec,
15812
+ supplemental: initData.video.supplemental,
15772
15813
  initSegment: initSegment,
15773
15814
  id: 'main'
15774
15815
  };
@@ -16438,7 +16479,7 @@
16438
16479
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16439
16480
  }
16440
16481
 
16441
- var version = "1.6.0-beta.4.0.canary.11068";
16482
+ var version = "1.6.0-rc.1";
16442
16483
 
16443
16484
  // ensure the worker ends up in the bundle
16444
16485
  // If the worker should not be included this gets aliased to empty.js
@@ -18858,7 +18899,8 @@
18858
18899
  codec = parsedTrack.codec,
18859
18900
  levelCodec = parsedTrack.levelCodec,
18860
18901
  container = parsedTrack.container,
18861
- metadata = parsedTrack.metadata;
18902
+ metadata = parsedTrack.metadata,
18903
+ supplemental = parsedTrack.supplemental;
18862
18904
  var track = tracks[trackName];
18863
18905
  var transferredTrack = (_this9$transferData = _this9.transferData) == null ? void 0 : (_this9$transferData$t = _this9$transferData.tracks) == null ? void 0 : _this9$transferData$t[trackName];
18864
18906
  var sbTrack = transferredTrack != null && transferredTrack.buffer ? transferredTrack : track;
@@ -18869,6 +18911,7 @@
18869
18911
  buffer: undefined,
18870
18912
  listeners: [],
18871
18913
  codec: codec,
18914
+ supplemental: supplemental,
18872
18915
  container: container,
18873
18916
  levelCodec: levelCodec,
18874
18917
  metadata: metadata,
@@ -19481,6 +19524,7 @@
19481
19524
  buffer: buffer,
19482
19525
  container: track.container,
19483
19526
  codec: track.codec,
19527
+ supplemental: track.supplemental,
19484
19528
  levelCodec: track.levelCodec,
19485
19529
  id: track.id,
19486
19530
  metadata: track.metadata
@@ -19551,6 +19595,11 @@
19551
19595
  this.bufferCreated();
19552
19596
  };
19553
19597
  _proto.getTrackCodec = function getTrackCodec(track, trackName) {
19598
+ // Use supplemental video codec when supported when adding SourceBuffer (#5558)
19599
+ var supplementalCodec = track.supplemental;
19600
+ if (supplementalCodec && trackName === 'video' && areCodecsMediaSourceSupported(supplementalCodec, trackName)) {
19601
+ return supplementalCodec;
19602
+ }
19554
19603
  var codec = pickMostCompleteCodecName(track.codec, track.levelCodec);
19555
19604
  if (codec) {
19556
19605
  if (trackName.slice(0, 5) === 'audio') {
@@ -19572,6 +19621,7 @@
19572
19621
  codec: codec,
19573
19622
  container: track.container,
19574
19623
  levelCodec: track.levelCodec,
19624
+ supplemental: track.supplemental,
19575
19625
  metadata: track.metadata,
19576
19626
  id: track.id,
19577
19627
  listeners: []
@@ -32126,6 +32176,7 @@
32126
32176
  videoCodecFound || (videoCodecFound = !!videoCodec);
32127
32177
  audioCodecFound || (audioCodecFound = !!audioCodec);
32128
32178
  if (unknownUnsupportedCodecCount || audioCodec && !_this2.isAudioSupported(audioCodec) || videoCodec && !_this2.isVideoSupported(videoCodec)) {
32179
+ _this2.log("Some or all CODECS not supported \"" + attributes.CODECS + "\"");
32129
32180
  return;
32130
32181
  }
32131
32182
  var CODECS = attributes.CODECS,
@@ -32137,7 +32188,7 @@
32137
32188
  var contentSteeringPrefix = (PATHWAY || '.') + "-";
32138
32189
  var levelKey = "" + contentSteeringPrefix + levelParsed.bitrate + "-" + RESOLUTION + "-" + FRAMERATE + "-" + CODECS + "-" + VIDEO_RANGE + "-" + HDCP;
32139
32190
  if (!redundantSet[levelKey]) {
32140
- var level = new Level(levelParsed);
32191
+ var level = _this2.createLevel(levelParsed);
32141
32192
  redundantSet[levelKey] = level;
32142
32193
  generatePathwaySet[levelKey] = 1;
32143
32194
  levels.push(level);
@@ -32146,7 +32197,7 @@
32146
32197
  // Content Steering controller to handles Pathway fallback on error
32147
32198
  var pathwayCount = generatePathwaySet[levelKey] += 1;
32148
32199
  levelParsed.attrs['PATHWAY-ID'] = new Array(pathwayCount + 1).join('.');
32149
- var _level = new Level(levelParsed);
32200
+ var _level = _this2.createLevel(levelParsed);
32150
32201
  redundantSet[levelKey] = _level;
32151
32202
  levels.push(_level);
32152
32203
  } else {
@@ -32156,6 +32207,16 @@
32156
32207
  });
32157
32208
  this.filterAndSortMediaOptions(levels, data, resolutionFound, videoCodecFound, audioCodecFound);
32158
32209
  };
32210
+ _proto.createLevel = function createLevel(levelParsed) {
32211
+ var level = new Level(levelParsed);
32212
+ var supplemental = levelParsed.supplemental;
32213
+ if (supplemental != null && supplemental.videoCodec && !this.isVideoSupported(supplemental.videoCodec)) {
32214
+ var error = new Error("SUPPLEMENTAL-CODECS not supported \"" + supplemental.videoCodec + "\"");
32215
+ this.log(error.message);
32216
+ level.supportedResult = getUnsupportedResult(error, []);
32217
+ }
32218
+ return level;
32219
+ };
32159
32220
  _proto.isAudioSupported = function isAudioSupported(codec) {
32160
32221
  return areCodecsMediaSourceSupported(codec, 'audio', this.hls.config.preferManagedMediaSource);
32161
32222
  };
@@ -32182,17 +32243,25 @@
32182
32243
  // Dispatch error after MANIFEST_LOADED is done propagating
32183
32244
  Promise.resolve().then(function () {
32184
32245
  if (_this3.hls) {
32246
+ var message = 'no level with compatible codecs found in manifest';
32247
+ var reason = message;
32185
32248
  if (data.levels.length) {
32186
- _this3.warn("One or more CODECS in variant not supported: " + stringify(data.levels[0].attrs));
32249
+ reason = "one or more CODECS in variant not supported: " + stringify(data.levels.map(function (level) {
32250
+ return level.attrs.CODECS;
32251
+ }).filter(function (value, index, array) {
32252
+ return array.indexOf(value) === index;
32253
+ }));
32254
+ _this3.warn(reason);
32255
+ message += " (" + reason + ")";
32187
32256
  }
32188
- var error = new Error('no level with compatible codecs found in manifest');
32257
+ var error = new Error(message);
32189
32258
  _this3.hls.trigger(Events.ERROR, {
32190
32259
  type: ErrorTypes.MEDIA_ERROR,
32191
32260
  details: ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,
32192
32261
  fatal: true,
32193
32262
  url: data.url,
32194
32263
  error: error,
32195
- reason: error.message
32264
+ reason: reason
32196
32265
  });
32197
32266
  }
32198
32267
  });
@@ -33713,7 +33782,7 @@
33713
33782
  break;
33714
33783
  }
33715
33784
  }
33716
- this.log("Init video buffer, container:" + video.container + ", codecs[level/parsed]=[" + (currentLevel.videoCodec || '') + "/" + parsedVideoCodec + (video.codec !== parsedVideoCodec ? ' parsed-corrected=' + video.codec : '') + "}]");
33785
+ this.log("Init video buffer, container:" + video.container + ", codecs[level/parsed]=[" + (currentLevel.videoCodec || '') + "/" + parsedVideoCodec + "]" + (video.codec !== parsedVideoCodec ? ' parsed-corrected=' + video.codec : '') + (video.supplemental ? ' supplemental=' + video.supplemental : ''));
33717
33786
  delete tracks.audiovideo;
33718
33787
  }
33719
33788
  if (audiovideo) {
package/dist/hls.js.d.ts CHANGED
@@ -96,7 +96,7 @@ export declare class AttrList {
96
96
  constructor(attrs: string | Record<string, any>, parsed?: Pick<ParsedMultivariantPlaylist | LevelDetails, 'variableList' | 'hasVariableRefs' | 'playlistParsingError'>);
97
97
  get clientAttrs(): string[];
98
98
  decimalInteger(attrName: string): number;
99
- hexadecimalInteger(attrName: string): Uint8Array | null;
99
+ hexadecimalInteger(attrName: string): Uint8Array<ArrayBuffer> | null;
100
100
  hexadecimalIntegerAsNumber(attrName: string): number;
101
101
  decimalFloatingPoint(attrName: string): number;
102
102
  optionalFloat(attrName: string, defaultValue: number): number;
@@ -394,6 +394,7 @@ export declare interface BaseTrack {
394
394
  id: 'audio' | 'main';
395
395
  container: string;
396
396
  codec?: string;
397
+ supplemental?: string;
397
398
  levelCodec?: string;
398
399
  pendingCodec?: string;
399
400
  metadata?: {
@@ -759,6 +760,13 @@ export declare type CMCDControllerConfig = {
759
760
  includeKeys?: string[];
760
761
  };
761
762
 
763
+ export declare interface CodecsParsed {
764
+ audioCodec?: string;
765
+ videoCodec?: string;
766
+ textCodec?: string;
767
+ unknownCodecs?: string[];
768
+ }
769
+
762
770
  export declare interface ComponentAPI {
763
771
  destroy(): void;
764
772
  }
@@ -2545,6 +2553,7 @@ export declare class Level {
2545
2553
  readonly height: number;
2546
2554
  readonly id: number;
2547
2555
  readonly name: string;
2556
+ readonly supplemental: CodecsParsed | undefined;
2548
2557
  readonly videoCodec: string | undefined;
2549
2558
  readonly width: number;
2550
2559
  details?: LevelDetails;
@@ -2711,18 +2720,15 @@ export declare interface LevelLoadingData {
2711
2720
  deliveryDirectives: HlsUrlParameters | null;
2712
2721
  }
2713
2722
 
2714
- export declare interface LevelParsed {
2723
+ export declare interface LevelParsed extends CodecsParsed {
2715
2724
  attrs: LevelAttributes;
2716
- audioCodec?: string;
2717
2725
  bitrate: number;
2718
2726
  details?: LevelDetails;
2719
2727
  height?: number;
2720
2728
  id?: number;
2721
2729
  name: string;
2722
- textCodec?: string;
2723
- unknownCodecs?: string[];
2730
+ supplemental?: CodecsParsed;
2724
2731
  url: string;
2725
- videoCodec?: string;
2726
2732
  width?: number;
2727
2733
  }
2728
2734