hls.js 1.6.0-beta.2.0.canary.10878 → 1.6.0-beta.2.0.canary.10882

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.
@@ -173,10 +173,10 @@ var PlaylistLevelType = {
173
173
  class EWMA {
174
174
  // About half of the estimated value will be from the last |halfLife| samples by weight.
175
175
  constructor(halfLife, estimate = 0, weight = 0) {
176
- this.halfLife = void 0;
177
- this.alpha_ = void 0;
178
- this.estimate_ = void 0;
179
- this.totalWeight_ = void 0;
176
+ this.halfLife = undefined;
177
+ this.alpha_ = undefined;
178
+ this.estimate_ = undefined;
179
+ this.totalWeight_ = undefined;
180
180
  this.halfLife = halfLife;
181
181
  // Larger values of alpha expire historical data more slowly.
182
182
  this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;
@@ -212,13 +212,13 @@ class EWMA {
212
212
 
213
213
  class EwmaBandWidthEstimator {
214
214
  constructor(slow, fast, defaultEstimate, defaultTTFB = 100) {
215
- this.defaultEstimate_ = void 0;
216
- this.minWeight_ = void 0;
217
- this.minDelayMs_ = void 0;
218
- this.slow_ = void 0;
219
- this.fast_ = void 0;
220
- this.defaultTTFB_ = void 0;
221
- this.ttfb_ = void 0;
215
+ this.defaultEstimate_ = undefined;
216
+ this.minWeight_ = undefined;
217
+ this.minDelayMs_ = undefined;
218
+ this.slow_ = undefined;
219
+ this.fast_ = undefined;
220
+ this.defaultTTFB_ = undefined;
221
+ this.ttfb_ = undefined;
222
222
  this.defaultEstimate_ = defaultEstimate;
223
223
  this.minWeight_ = 0.001;
224
224
  this.minDelayMs_ = 50;
@@ -290,9 +290,9 @@ class EwmaBandWidthEstimator {
290
290
  function _defineProperty(e, r, t) {
291
291
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
292
292
  value: t,
293
- enumerable: !0,
294
- configurable: !0,
295
- writable: !0
293
+ enumerable: true,
294
+ configurable: true,
295
+ writable: true
296
296
  }) : e[r] = t, e;
297
297
  }
298
298
  function _extends() {
@@ -317,7 +317,7 @@ function ownKeys(e, r) {
317
317
  function _objectSpread2(e) {
318
318
  for (var r = 1; r < arguments.length; r++) {
319
319
  var t = null != arguments[r] ? arguments[r] : {};
320
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
320
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
321
321
  _defineProperty(e, r, t[r]);
322
322
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
323
323
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
@@ -328,7 +328,7 @@ function _objectSpread2(e) {
328
328
  function _toPrimitive(t, r) {
329
329
  if ("object" != typeof t || !t) return t;
330
330
  var e = t[Symbol.toPrimitive];
331
- if (void 0 !== e) {
331
+ if (undefined !== e) {
332
332
  var i = e.call(t, r || "default");
333
333
  if ("object" != typeof i) return i;
334
334
  throw new TypeError("@@toPrimitive must return a primitive value.");
@@ -342,12 +342,12 @@ function _toPropertyKey(t) {
342
342
 
343
343
  class Logger {
344
344
  constructor(label, logger) {
345
- this.trace = void 0;
346
- this.debug = void 0;
347
- this.log = void 0;
348
- this.warn = void 0;
349
- this.info = void 0;
350
- this.error = void 0;
345
+ this.trace = undefined;
346
+ this.debug = undefined;
347
+ this.log = undefined;
348
+ this.warn = undefined;
349
+ this.info = undefined;
350
+ this.error = undefined;
351
351
  const lb = `[${label}]:`;
352
352
  this.trace = noop;
353
353
  this.debug = logger.debug.bind(null, lb);
@@ -401,7 +401,7 @@ function enableLogs(debugConfig, context, id) {
401
401
  // Some browsers don't allow to use bind on console object anyway
402
402
  // fallback to default if needed
403
403
  try {
404
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10878"}`);
404
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10882"}`);
405
405
  } catch (e) {
406
406
  /* log fn threw an exception. All logger methods are no-ops. */
407
407
  return createLogger();
@@ -535,7 +535,7 @@ function areCodecsMediaSourceSupported(codecs, type, preferManagedMediaSource =
535
535
  function isCodecMediaSourceSupported(codec, type, preferManagedMediaSource = true) {
536
536
  var _MediaSource$isTypeSu;
537
537
  const MediaSource = getMediaSource(preferManagedMediaSource);
538
- return (_MediaSource$isTypeSu = MediaSource == null ? void 0 : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
538
+ return (_MediaSource$isTypeSu = MediaSource == null ? undefined : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
539
539
  }
540
540
  function mimeTypeForCodec(codec, type) {
541
541
  return `${type}/mp4;codecs=${codec}`;
@@ -678,9 +678,9 @@ function getSkipValue(details) {
678
678
  }
679
679
  class HlsUrlParameters {
680
680
  constructor(msn, part, skip) {
681
- this.msn = void 0;
682
- this.part = void 0;
683
- this.skip = void 0;
681
+ this.msn = undefined;
682
+ this.part = undefined;
683
+ this.skip = undefined;
684
684
  this.msn = msn;
685
685
  this.part = part;
686
686
  this.skip = skip;
@@ -701,27 +701,27 @@ class HlsUrlParameters {
701
701
  }
702
702
  class Level {
703
703
  constructor(data) {
704
- this._attrs = void 0;
705
- this.audioCodec = void 0;
706
- this.bitrate = void 0;
707
- this.codecSet = void 0;
708
- this.url = void 0;
709
- this.frameRate = void 0;
710
- this.height = void 0;
711
- this.id = void 0;
712
- this.name = void 0;
713
- this.videoCodec = void 0;
714
- this.width = void 0;
715
- this.details = void 0;
704
+ this._attrs = undefined;
705
+ this.audioCodec = undefined;
706
+ this.bitrate = undefined;
707
+ this.codecSet = undefined;
708
+ this.url = undefined;
709
+ this.frameRate = undefined;
710
+ this.height = undefined;
711
+ this.id = undefined;
712
+ this.name = undefined;
713
+ this.videoCodec = undefined;
714
+ this.width = undefined;
715
+ this.details = undefined;
716
716
  this.fragmentError = 0;
717
717
  this.loadError = 0;
718
- this.loaded = void 0;
718
+ this.loaded = undefined;
719
719
  this.realBitrate = 0;
720
- this.supportedPromise = void 0;
721
- this.supportedResult = void 0;
720
+ this.supportedPromise = undefined;
721
+ this.supportedResult = undefined;
722
722
  this._avgBitrate = 0;
723
- this._audioGroups = void 0;
724
- this._subtitleGroups = void 0;
723
+ this._audioGroups = undefined;
724
+ this._subtitleGroups = undefined;
725
725
  // Deprecated (retained for backwards compatibility)
726
726
  this._urlId = 0;
727
727
  this.url = [data.url];
@@ -814,11 +814,11 @@ class Level {
814
814
  }
815
815
  get audioGroupId() {
816
816
  var _this$audioGroups;
817
- return (_this$audioGroups = this.audioGroups) == null ? void 0 : _this$audioGroups[0];
817
+ return (_this$audioGroups = this.audioGroups) == null ? undefined : _this$audioGroups[0];
818
818
  }
819
819
  get textGroupId() {
820
820
  var _this$subtitleGroups;
821
- return (_this$subtitleGroups = this.subtitleGroups) == null ? void 0 : _this$subtitleGroups[0];
821
+ return (_this$subtitleGroups = this.subtitleGroups) == null ? undefined : _this$subtitleGroups[0];
822
822
  }
823
823
  addFallback() {}
824
824
  }
@@ -885,9 +885,9 @@ function getVideoSelectionOptions(currentVideoRange, videoPreference) {
885
885
 
886
886
  function getStartCodecTier(codecTiers, currentVideoRange, currentBw, audioPreference, videoPreference) {
887
887
  const codecSets = Object.keys(codecTiers);
888
- const channelsPreference = audioPreference == null ? void 0 : audioPreference.channels;
889
- const audioCodecPreference = audioPreference == null ? void 0 : audioPreference.audioCodec;
890
- const videoCodecPreference = videoPreference == null ? void 0 : videoPreference.videoCodec;
888
+ const channelsPreference = audioPreference == null ? undefined : audioPreference.channels;
889
+ const audioCodecPreference = audioPreference == null ? undefined : audioPreference.audioCodec;
890
+ const videoCodecPreference = videoPreference == null ? undefined : videoPreference.videoCodec;
891
891
  const preferStereo = channelsPreference && parseInt(channelsPreference) === 2;
892
892
  // Use first level set to determine stereo, and minimum resolution and framerate
893
893
  let hasStereo = false;
@@ -1062,13 +1062,13 @@ function getCodecTiers(levels, audioTracksByGroup, minAutoLevel, maxAutoLevel) {
1062
1062
  }
1063
1063
  function useAlternateAudio(audioTrackUrl, hls) {
1064
1064
  var _hls$levels$hls$loadL;
1065
- return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? void 0 : _hls$levels$hls$loadL.uri);
1065
+ return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? undefined : _hls$levels$hls$loadL.uri);
1066
1066
  }
1067
1067
 
1068
1068
  class AbrController extends Logger {
1069
1069
  constructor(_hls) {
1070
1070
  super('abr', _hls.logger);
1071
- this.hls = void 0;
1071
+ this.hls = undefined;
1072
1072
  this.lastLevelLoadSec = 0;
1073
1073
  this.lastLoadedFragLevel = -1;
1074
1074
  this.firstSelection = -1;
@@ -1080,7 +1080,7 @@ class AbrController extends Logger {
1080
1080
  this.fragCurrent = null;
1081
1081
  this.partCurrent = null;
1082
1082
  this.bitrateTestDelay = 0;
1083
- this.bwEstimator = void 0;
1083
+ this.bwEstimator = undefined;
1084
1084
  /*
1085
1085
  This method monitors the download rate of the current fragment, and will downswitch if that fragment will not load
1086
1086
  quickly enough to prevent underbuffering
@@ -1148,7 +1148,7 @@ class AbrController extends Logger {
1148
1148
  return;
1149
1149
  }
1150
1150
  const bwe = loadRate ? loadRate * 8 : bwEstimate;
1151
- const live = ((_this$hls$latestLevel = this.hls.latestLevelDetails) == null ? void 0 : _this$hls$latestLevel.live) === true;
1151
+ const live = ((_this$hls$latestLevel = this.hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.live) === true;
1152
1152
  const abrBandWidthUpFactor = this.hls.config.abrBandWidthUpFactor;
1153
1153
  let fragLevelNextLoadedDelay = Number.POSITIVE_INFINITY;
1154
1154
  let nextLoadLevel;
@@ -1557,7 +1557,7 @@ class AbrController extends Logger {
1557
1557
  // If no matching level found, see if min auto level would be a better option
1558
1558
  const minLevel = hls.levels[minAutoLevel];
1559
1559
  const autoLevel = hls.levels[hls.loadLevel];
1560
- if ((minLevel == null ? void 0 : minLevel.bitrate) < (autoLevel == null ? void 0 : autoLevel.bitrate)) {
1560
+ if ((minLevel == null ? undefined : minLevel.bitrate) < (autoLevel == null ? undefined : autoLevel.bitrate)) {
1561
1561
  return minAutoLevel;
1562
1562
  }
1563
1563
  // or if bitrate is not lower, continue to use loadLevel
@@ -1601,7 +1601,7 @@ class AbrController extends Logger {
1601
1601
  const firstSelection = loadLevel === -1 || lastLoadedFragLevel === -1;
1602
1602
  let currentCodecSet;
1603
1603
  let currentVideoRange = 'SDR';
1604
- let currentFrameRate = (level == null ? void 0 : level.frameRate) || 0;
1604
+ let currentFrameRate = (level == null ? undefined : level.frameRate) || 0;
1605
1605
  const {
1606
1606
  audioPreference,
1607
1607
  videoPreference
@@ -1629,8 +1629,8 @@ class AbrController extends Logger {
1629
1629
  currentBw = Math.max(currentBw, minBitrate);
1630
1630
  this.log(`picked start tier ${JSON.stringify(startTier)}`);
1631
1631
  } else {
1632
- currentCodecSet = level == null ? void 0 : level.codecSet;
1633
- currentVideoRange = level == null ? void 0 : level.videoRange;
1632
+ currentCodecSet = level == null ? undefined : level.codecSet;
1633
+ currentVideoRange = level == null ? undefined : level.videoRange;
1634
1634
  }
1635
1635
  const currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;
1636
1636
  const ttfbEstimateSec = this.bwEstimator.getEstimateTTFB() / 1000;
@@ -1652,7 +1652,7 @@ class AbrController extends Logger {
1652
1652
  }
1653
1653
  }
1654
1654
  const levelDetails = levelInfo.details;
1655
- const avgDuration = (partCurrent ? levelDetails == null ? void 0 : levelDetails.partTarget : levelDetails == null ? void 0 : levelDetails.averagetargetduration) || currentFragDuration;
1655
+ const avgDuration = (partCurrent ? levelDetails == null ? undefined : levelDetails.partTarget : levelDetails == null ? undefined : levelDetails.averagetargetduration) || currentFragDuration;
1656
1656
  let adjustedbw;
1657
1657
  // follow algorithm captured from stagefright :
1658
1658
  // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
@@ -1918,7 +1918,7 @@ function shouldRetry(retryConfig, retryCount, isTimeout, loaderResponse) {
1918
1918
  if (!retryConfig) {
1919
1919
  return false;
1920
1920
  }
1921
- const httpStatus = loaderResponse == null ? void 0 : loaderResponse.code;
1921
+ const httpStatus = loaderResponse == null ? undefined : loaderResponse.code;
1922
1922
  const retry = retryCount < retryConfig.maxNumRetry && (retryForHttpStatus(httpStatus) || !!isTimeout);
1923
1923
  return retryConfig.shouldRetry ? retryConfig.shouldRetry(retryConfig, retryCount, isTimeout, loaderResponse, retry) : retry;
1924
1924
  }
@@ -1944,7 +1944,7 @@ var ErrorActionFlags = {
1944
1944
  class ErrorController extends Logger {
1945
1945
  constructor(hls) {
1946
1946
  super('error-controller', hls.logger);
1947
- this.hls = void 0;
1947
+ this.hls = undefined;
1948
1948
  this.playlistError = 0;
1949
1949
  this.penalizedRenditions = {};
1950
1950
  this.hls = hls;
@@ -1977,7 +1977,7 @@ class ErrorController extends Logger {
1977
1977
  this.playlistError = 0;
1978
1978
  }
1979
1979
  getVariantLevelIndex(frag) {
1980
- return (frag == null ? void 0 : frag.type) === PlaylistLevelType.MAIN ? frag.level : this.hls.loadLevel;
1980
+ return (frag == null ? undefined : frag.type) === PlaylistLevelType.MAIN ? frag.level : this.hls.loadLevel;
1981
1981
  }
1982
1982
  onManifestLoading() {
1983
1983
  this.playlistError = 0;
@@ -2032,7 +2032,7 @@ class ErrorController extends Logger {
2032
2032
  return;
2033
2033
  case ErrorDetails.LEVEL_LOAD_ERROR:
2034
2034
  case ErrorDetails.LEVEL_LOAD_TIMEOUT:
2035
- if (typeof (context == null ? void 0 : context.level) === 'number') {
2035
+ if (typeof (context == null ? undefined : context.level) === 'number') {
2036
2036
  data.errorAction = this.getPlaylistRetryOrSwitchAction(data, context.level);
2037
2037
  }
2038
2038
  return;
@@ -2055,7 +2055,7 @@ class ErrorController extends Logger {
2055
2055
  case ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:
2056
2056
  {
2057
2057
  const level = hls.levels[hls.loadLevel];
2058
- const restrictedHdcpLevel = level == null ? void 0 : level.attrs['HDCP-LEVEL'];
2058
+ const restrictedHdcpLevel = level == null ? undefined : level.attrs['HDCP-LEVEL'];
2059
2059
  if (restrictedHdcpLevel) {
2060
2060
  data.errorAction = {
2061
2061
  action: NetworkErrorAction.SendAlternateToPenaltyBox,
@@ -2177,7 +2177,7 @@ class ErrorController extends Logger {
2177
2177
  if (!hls.autoLevelEnabled) {
2178
2178
  hls.loadLevel = -1;
2179
2179
  }
2180
- const fragErrorType = (_data$frag2 = data.frag) == null ? void 0 : _data$frag2.type;
2180
+ const fragErrorType = (_data$frag2 = data.frag) == null ? undefined : _data$frag2.type;
2181
2181
  // Find alternate audio codec if available on audio codec error
2182
2182
  const isAudioCodecError = fragErrorType === PlaylistLevelType.AUDIO && errorDetails === ErrorDetails.FRAG_PARSING_ERROR || data.sourceBufferName === 'audio' && (errorDetails === ErrorDetails.BUFFER_ADD_CODEC_ERROR || errorDetails === ErrorDetails.BUFFER_APPEND_ERROR);
2183
2183
  const findAudioCodecAlternate = isAudioCodecError && levels.some(({
@@ -2237,7 +2237,7 @@ class ErrorController extends Logger {
2237
2237
  }
2238
2238
  onErrorOut(event, data) {
2239
2239
  var _data$errorAction;
2240
- switch ((_data$errorAction = data.errorAction) == null ? void 0 : _data$errorAction.action) {
2240
+ switch ((_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.action) {
2241
2241
  case NetworkErrorAction.DoNothing:
2242
2242
  break;
2243
2243
  case NetworkErrorAction.SendAlternateToPenaltyBox:
@@ -2461,16 +2461,16 @@ function isSCTE35Attribute(attrName) {
2461
2461
  class DateRange {
2462
2462
  constructor(dateRangeAttr, dateRangeWithSameId, tagCount = 0) {
2463
2463
  var _dateRangeWithSameId$;
2464
- this.attr = void 0;
2465
- this.tagAnchor = void 0;
2466
- this.tagOrder = void 0;
2467
- this._startDate = void 0;
2468
- this._endDate = void 0;
2469
- this._dateAtEnd = void 0;
2470
- this._cue = void 0;
2471
- this._badValueForSameId = void 0;
2472
- this.tagAnchor = (dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.tagAnchor) || null;
2473
- this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.tagOrder) != null ? _dateRangeWithSameId$ : tagCount;
2464
+ this.attr = undefined;
2465
+ this.tagAnchor = undefined;
2466
+ this.tagOrder = undefined;
2467
+ this._startDate = undefined;
2468
+ this._endDate = undefined;
2469
+ this._dateAtEnd = undefined;
2470
+ this._cue = undefined;
2471
+ this._badValueForSameId = undefined;
2472
+ this.tagAnchor = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagAnchor) || null;
2473
+ this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagOrder) != null ? _dateRangeWithSameId$ : tagCount;
2474
2474
  if (dateRangeWithSameId) {
2475
2475
  const previousAttr = dateRangeWithSameId.attr;
2476
2476
  for (const key in previousAttr) {
@@ -2493,7 +2493,7 @@ class DateRange {
2493
2493
  this._startDate = new Date(dateRangeAttr["START-DATE"]);
2494
2494
  }
2495
2495
  if ("END-DATE" in this.attr) {
2496
- const endDate = (dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.endDate) || new Date(this.attr["END-DATE"]);
2496
+ const endDate = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.endDate) || new Date(this.attr["END-DATE"]);
2497
2497
  if (isFiniteNumber(endDate.getTime())) {
2498
2498
  this._endDate = endDate;
2499
2499
  }
@@ -2780,9 +2780,9 @@ class BaseSegment {
2780
2780
  this._stats = null;
2781
2781
  this._streams = null;
2782
2782
  // baseurl is the URL to the playlist
2783
- this.base = void 0;
2783
+ this.base = undefined;
2784
2784
  // relurl is the portion of the URL that comes from inside the playlist.
2785
- this.relurl = void 0;
2785
+ this.relurl = undefined;
2786
2786
  if (typeof base === 'string') {
2787
2787
  base = {
2788
2788
  url: base
@@ -2796,7 +2796,7 @@ class BaseSegment {
2796
2796
  const params = value.split('@', 2);
2797
2797
  let start;
2798
2798
  if (params.length === 1) {
2799
- start = (previous == null ? void 0 : previous.byteRangeEndOffset) || 0;
2799
+ start = (previous == null ? undefined : previous.byteRangeEndOffset) || 0;
2800
2800
  } else {
2801
2801
  start = parseInt(params[1]);
2802
2802
  }
@@ -2879,7 +2879,7 @@ class Fragment extends BaseSegment {
2879
2879
  this._programDateTime = null;
2880
2880
  this._ref = null;
2881
2881
  // Approximate bit rate of the fragment expressed in bits per second (bps) as indicated by the last EXT-X-BITRATE (kbps) tag
2882
- this._bitrate = void 0;
2882
+ this._bitrate = undefined;
2883
2883
  this.rawProgramDateTime = null;
2884
2884
  this.tagList = [];
2885
2885
  // EXTINF has to be present for a m3u8 to be considered valid
@@ -2889,9 +2889,9 @@ class Fragment extends BaseSegment {
2889
2889
  // levelkeys are the EXT-X-KEY tags that apply to this segment for decryption
2890
2890
  // core difference from the private field _decryptdata is the lack of the initialized IV
2891
2891
  // _decryptdata will set the IV for this segment based on the segment number in the fragment
2892
- this.levelkeys = void 0;
2892
+ this.levelkeys = undefined;
2893
2893
  // A string representing the fragment type
2894
- this.type = void 0;
2894
+ this.type = undefined;
2895
2895
  // A reference to the loader. Set while the fragment is loading, and removed afterwards. Used to abort fragment loading
2896
2896
  this.loader = null;
2897
2897
  // A reference to the key loader. Set while the key is loading, and removed afterwards. Used to abort key loading
@@ -2901,25 +2901,25 @@ class Fragment extends BaseSegment {
2901
2901
  // The continuity counter of the fragment
2902
2902
  this.cc = 0;
2903
2903
  // The starting Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
2904
- this.startPTS = void 0;
2904
+ this.startPTS = undefined;
2905
2905
  // The ending Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
2906
- this.endPTS = void 0;
2906
+ this.endPTS = undefined;
2907
2907
  // The starting Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
2908
- this.startDTS = void 0;
2908
+ this.startDTS = undefined;
2909
2909
  // The ending Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
2910
- this.endDTS = void 0;
2910
+ this.endDTS = undefined;
2911
2911
  // The start time of the fragment, as listed in the manifest. Updated after transmux complete.
2912
2912
  this.start = 0;
2913
2913
  // The offset time (seconds) of the fragment from the start of the Playlist
2914
2914
  this.playlistOffset = 0;
2915
2915
  // Set by `updateFragPTSDTS` in level-helper
2916
- this.deltaPTS = void 0;
2916
+ this.deltaPTS = undefined;
2917
2917
  // The maximum starting Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
2918
- this.maxStartPTS = void 0;
2918
+ this.maxStartPTS = undefined;
2919
2919
  // The minimum ending Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
2920
- this.minEndPTS = void 0;
2920
+ this.minEndPTS = undefined;
2921
2921
  // Init Segment bytes (unset for media segments)
2922
- this.data = void 0;
2922
+ this.data = undefined;
2923
2923
  // A flag indicating whether the segment was downloaded in order to test bitrate, and was not buffered
2924
2924
  this.bitrateTest = false;
2925
2925
  // #EXTINF segment title
@@ -2927,9 +2927,9 @@ class Fragment extends BaseSegment {
2927
2927
  // The Media Initialization Section for this segment
2928
2928
  this.initSegment = null;
2929
2929
  // Fragment is the last fragment in the media playlist
2930
- this.endList = void 0;
2930
+ this.endList = undefined;
2931
2931
  // Fragment is marked by an EXT-X-GAP tag indicating that it does not contain media data and should not be loaded
2932
- this.gap = void 0;
2932
+ this.gap = undefined;
2933
2933
  // Deprecated
2934
2934
  this.urlId = 0;
2935
2935
  this.type = type;
@@ -3061,8 +3061,8 @@ class Fragment extends BaseSegment {
3061
3061
  }
3062
3062
  abortRequests() {
3063
3063
  var _this$loader, _this$keyLoader;
3064
- (_this$loader = this.loader) == null ? void 0 : _this$loader.abort();
3065
- (_this$keyLoader = this.keyLoader) == null ? void 0 : _this$keyLoader.abort();
3064
+ (_this$loader = this.loader) == null ? undefined : _this$loader.abort();
3065
+ (_this$keyLoader = this.keyLoader) == null ? undefined : _this$keyLoader.abort();
3066
3066
  }
3067
3067
  setElementaryStreamInfo(type, startPTS, endPTS, startDTS, endDTS, partial = false) {
3068
3068
  const {
@@ -3096,9 +3096,9 @@ class Part extends BaseSegment {
3096
3096
  this.duration = 0;
3097
3097
  this.gap = false;
3098
3098
  this.independent = false;
3099
- this.relurl = void 0;
3100
- this.fragment = void 0;
3101
- this.index = void 0;
3099
+ this.relurl = undefined;
3100
+ this.fragment = undefined;
3101
+ this.index = undefined;
3102
3102
  this.duration = partAttrs.decimalFloatingPoint('DURATION');
3103
3103
  this.gap = partAttrs.bool('GAP');
3104
3104
  this.independent = partAttrs.bool('INDEPENDENT');
@@ -3136,21 +3136,21 @@ class LevelDetails {
3136
3136
  constructor(baseUrl) {
3137
3137
  this.PTSKnown = false;
3138
3138
  this.alignedSliding = false;
3139
- this.averagetargetduration = void 0;
3139
+ this.averagetargetduration = undefined;
3140
3140
  this.endCC = 0;
3141
3141
  this.endSN = 0;
3142
- this.fragments = void 0;
3143
- this.fragmentHint = void 0;
3142
+ this.fragments = undefined;
3143
+ this.fragmentHint = undefined;
3144
3144
  this.partList = null;
3145
- this.dateRanges = void 0;
3145
+ this.dateRanges = undefined;
3146
3146
  this.dateRangeTagCount = 0;
3147
3147
  this.live = true;
3148
3148
  this.requestScheduled = -1;
3149
3149
  this.ageHeader = 0;
3150
- this.advancedDateTime = void 0;
3150
+ this.advancedDateTime = undefined;
3151
3151
  this.updated = true;
3152
3152
  this.advanced = true;
3153
- this.availabilityDelay = void 0;
3153
+ this.availabilityDelay = undefined;
3154
3154
  // Manifest reload synchronization
3155
3155
  this.misses = 0;
3156
3156
  this.startCC = 0;
@@ -3159,30 +3159,30 @@ class LevelDetails {
3159
3159
  this.targetduration = 0;
3160
3160
  this.totalduration = 0;
3161
3161
  this.type = null;
3162
- this.url = void 0;
3162
+ this.url = undefined;
3163
3163
  this.m3u8 = '';
3164
3164
  this.version = null;
3165
3165
  this.canBlockReload = false;
3166
3166
  this.canSkipUntil = 0;
3167
3167
  this.canSkipDateRanges = false;
3168
3168
  this.skippedSegments = 0;
3169
- this.recentlyRemovedDateranges = void 0;
3169
+ this.recentlyRemovedDateranges = undefined;
3170
3170
  this.partHoldBack = 0;
3171
3171
  this.holdBack = 0;
3172
3172
  this.partTarget = 0;
3173
- this.preloadHint = void 0;
3174
- this.renditionReports = void 0;
3173
+ this.preloadHint = undefined;
3174
+ this.renditionReports = undefined;
3175
3175
  this.tuneInGoal = 0;
3176
- this.deltaUpdateFailed = void 0;
3176
+ this.deltaUpdateFailed = undefined;
3177
3177
  this.driftStartTime = 0;
3178
3178
  this.driftEndTime = 0;
3179
3179
  this.driftStart = 0;
3180
3180
  this.driftEnd = 0;
3181
- this.encryptedFragments = void 0;
3181
+ this.encryptedFragments = undefined;
3182
3182
  this.playlistParsingError = null;
3183
3183
  this.variableList = null;
3184
3184
  this.hasVariableRefs = false;
3185
- this.appliedTimelineOffset = void 0;
3185
+ this.appliedTimelineOffset = undefined;
3186
3186
  this.fragments = [];
3187
3187
  this.encryptedFragments = [];
3188
3188
  this.dateRanges = {};
@@ -3932,8 +3932,8 @@ function getDuration(data, initData) {
3932
3932
  continue;
3933
3933
  }
3934
3934
  const trackDefault = track.default;
3935
- const tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ? void 0 : trackDefault.flags);
3936
- let sampleDuration = trackDefault == null ? void 0 : trackDefault.duration;
3935
+ const tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ? undefined : trackDefault.flags);
3936
+ let sampleDuration = trackDefault == null ? undefined : trackDefault.duration;
3937
3937
  if (tfhdFlags & 0x000008) {
3938
3938
  // 0x000008 indicates the presence of the default_sample_duration field
3939
3939
  if (tfhdFlags & 0x000002) {
@@ -4463,12 +4463,12 @@ class LevelKey {
4463
4463
  static clearKeyUriToKeyIdMap() {
4464
4464
  }
4465
4465
  constructor(method, uri, format, formatversions = [1], iv = null) {
4466
- this.uri = void 0;
4467
- this.method = void 0;
4468
- this.keyFormat = void 0;
4469
- this.keyFormatVersions = void 0;
4470
- this.encrypted = void 0;
4471
- this.isCommonEncryption = void 0;
4466
+ this.uri = undefined;
4467
+ this.method = undefined;
4468
+ this.keyFormat = undefined;
4469
+ this.keyFormatVersions = undefined;
4470
+ this.encrypted = undefined;
4471
+ this.isCommonEncryption = undefined;
4472
4472
  this.iv = null;
4473
4473
  this.key = null;
4474
4474
  this.keyId = null;
@@ -5100,7 +5100,7 @@ function findFragmentWithStartDate(details, startDateTime, programDateTimes, ind
5100
5100
  const pdtStart = pdtFragment.programDateTime;
5101
5101
  if (startDateTime >= pdtStart || index === 0) {
5102
5102
  var _programDateTimes;
5103
- const durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ? void 0 : _programDateTimes.start) || endTime) - pdtFragment.start;
5103
+ const durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ? undefined : _programDateTimes.start) || endTime) - pdtFragment.start;
5104
5104
  if (startDateTime <= pdtStart + durationBetweenPdt * 1000) {
5105
5105
  // map to fragment with date-time range
5106
5106
  const startIndex = programDateTimes[index].sn - details.startSN;
@@ -5365,7 +5365,7 @@ function mergeDetails(oldDetails, newDetails) {
5365
5365
  if (currentInitSegment) {
5366
5366
  fragmentsToCheck.forEach(frag => {
5367
5367
  var _currentInitSegment;
5368
- if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ? void 0 : _currentInitSegment.relurl))) {
5368
+ if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ? undefined : _currentInitSegment.relurl))) {
5369
5369
  frag.initSegment = currentInitSegment;
5370
5370
  }
5371
5371
  });
@@ -5597,7 +5597,7 @@ function findPart(partList, sn, partIndex) {
5597
5597
  function reassignFragmentLevelIndexes(levels) {
5598
5598
  levels.forEach((level, index) => {
5599
5599
  var _level$details;
5600
- const fragments = (_level$details = level.details) == null ? void 0 : _level$details.fragments;
5600
+ const fragments = (_level$details = level.details) == null ? undefined : _level$details.fragments;
5601
5601
  if (fragments) {
5602
5602
  fragments.forEach(fragment => {
5603
5603
  fragment.level = index;
@@ -5612,7 +5612,7 @@ function reassignFragmentLevelIndexes(levels) {
5612
5612
  class BasePlaylistController extends Logger {
5613
5613
  constructor(hls, logPrefix) {
5614
5614
  super(logPrefix, hls.logger);
5615
- this.hls = void 0;
5615
+ this.hls = undefined;
5616
5616
  this.canLoad = false;
5617
5617
  this.timer = -1;
5618
5618
  this.hls = hls;
@@ -5637,7 +5637,7 @@ class BasePlaylistController extends Logger {
5637
5637
  this.clearTimer();
5638
5638
  }
5639
5639
  switchParams(playlistUri, previous, current) {
5640
- const renditionReports = previous == null ? void 0 : previous.renditionReports;
5640
+ const renditionReports = previous == null ? undefined : previous.renditionReports;
5641
5641
  if (renditionReports) {
5642
5642
  let foundIndex = -1;
5643
5643
  for (let i = 0; i < renditionReports.length; i++) {
@@ -5660,8 +5660,8 @@ class BasePlaylistController extends Logger {
5660
5660
  }
5661
5661
  if (foundIndex !== -1) {
5662
5662
  const attr = renditionReports[foundIndex];
5663
- const msn = parseInt(attr['LAST-MSN']) || (previous == null ? void 0 : previous.lastPartSn);
5664
- let part = parseInt(attr['LAST-PART']) || (previous == null ? void 0 : previous.lastPartIndex);
5663
+ const msn = parseInt(attr['LAST-MSN']) || (previous == null ? undefined : previous.lastPartSn);
5664
+ let part = parseInt(attr['LAST-PART']) || (previous == null ? undefined : previous.lastPartIndex);
5665
5665
  if (this.hls.config.lowLatencyMode) {
5666
5666
  const currentGoal = Math.min(previous.age - previous.partTarget, previous.targetduration);
5667
5667
  if (part >= 0 && currentGoal > previous.partTarget) {
@@ -5879,7 +5879,7 @@ class FragmentTracker {
5879
5879
  this.fragments = Object.create(null);
5880
5880
  this.timeRanges = Object.create(null);
5881
5881
  this.bufferPadding = 0.2;
5882
- this.hls = void 0;
5882
+ this.hls = undefined;
5883
5883
  this.hasGaps = false;
5884
5884
  this.hls = hls;
5885
5885
  this._registerListeners();
@@ -5948,7 +5948,7 @@ class FragmentTracker {
5948
5948
  const keys = Object.keys(fragments);
5949
5949
  for (let i = keys.length; i--;) {
5950
5950
  const fragmentEntity = fragments[keys[i]];
5951
- if ((fragmentEntity == null ? void 0 : fragmentEntity.body.type) === levelType && (!buffered || fragmentEntity.buffered)) {
5951
+ if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === levelType && (!buffered || fragmentEntity.buffered)) {
5952
5952
  const frag = fragmentEntity.body;
5953
5953
  if (frag.start <= position && position <= frag.end) {
5954
5954
  return frag;
@@ -5969,7 +5969,7 @@ class FragmentTracker {
5969
5969
  }
5970
5970
  // Check if any flagged fragments have been unloaded
5971
5971
  // excluding anything newer than appendedPartSn
5972
- const appendedPartSn = (appendedPart == null ? void 0 : appendedPart.fragment.sn) || -1;
5972
+ const appendedPartSn = (appendedPart == null ? undefined : appendedPart.fragment.sn) || -1;
5973
5973
  Object.keys(this.fragments).forEach(key => {
5974
5974
  const fragmentEntity = this.fragments[key];
5975
5975
  if (!fragmentEntity) {
@@ -6239,7 +6239,7 @@ class FragmentTracker {
6239
6239
  }
6240
6240
  for (let i = keys.length; i--;) {
6241
6241
  const fragmentEntity = fragments[keys[i]];
6242
- if ((fragmentEntity == null ? void 0 : fragmentEntity.body.type) === type) {
6242
+ if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === type) {
6243
6243
  return true;
6244
6244
  }
6245
6245
  }
@@ -6287,7 +6287,7 @@ class FragmentTracker {
6287
6287
  this.endListFragments = Object.create(null);
6288
6288
  this.activePartLists = Object.create(null);
6289
6289
  this.hasGaps = false;
6290
- const partlist = (_this$hls = this.hls) == null ? void 0 : (_this$hls$latestLevel = _this$hls.latestLevelDetails) == null ? void 0 : _this$hls$latestLevel.partList;
6290
+ const partlist = (_this$hls = this.hls) == null ? undefined : (_this$hls$latestLevel = _this$hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.partList;
6291
6291
  if (partlist) {
6292
6292
  partlist.forEach(part => part.clearElementaryStreamInfo());
6293
6293
  }
@@ -6295,7 +6295,7 @@ class FragmentTracker {
6295
6295
  }
6296
6296
  function isPartial(fragmentEntity) {
6297
6297
  var _fragmentEntity$range, _fragmentEntity$range2, _fragmentEntity$range3;
6298
- return fragmentEntity.buffered && (fragmentEntity.body.gap || ((_fragmentEntity$range = fragmentEntity.range.video) == null ? void 0 : _fragmentEntity$range.partial) || ((_fragmentEntity$range2 = fragmentEntity.range.audio) == null ? void 0 : _fragmentEntity$range2.partial) || ((_fragmentEntity$range3 = fragmentEntity.range.audiovideo) == null ? void 0 : _fragmentEntity$range3.partial));
6298
+ return fragmentEntity.buffered && (fragmentEntity.body.gap || ((_fragmentEntity$range = fragmentEntity.range.video) == null ? undefined : _fragmentEntity$range.partial) || ((_fragmentEntity$range2 = fragmentEntity.range.audio) == null ? undefined : _fragmentEntity$range2.partial) || ((_fragmentEntity$range3 = fragmentEntity.range.audiovideo) == null ? undefined : _fragmentEntity$range3.partial));
6299
6299
  }
6300
6300
  function getFragmentKey(fragment) {
6301
6301
  return `${fragment.type}_${fragment.level}_${fragment.sn}`;
@@ -6303,9 +6303,9 @@ function getFragmentKey(fragment) {
6303
6303
 
6304
6304
  class AESCrypto {
6305
6305
  constructor(subtle, iv, aesMode) {
6306
- this.subtle = void 0;
6307
- this.aesIV = void 0;
6308
- this.aesMode = void 0;
6306
+ this.subtle = undefined;
6307
+ this.aesIV = undefined;
6308
+ this.aesMode = undefined;
6309
6309
  this.subtle = subtle;
6310
6310
  this.aesIV = iv;
6311
6311
  this.aesMode = aesMode;
@@ -6350,8 +6350,8 @@ class AESDecryptor {
6350
6350
  this.key = new Uint32Array(0);
6351
6351
  this.ksRows = 0;
6352
6352
  this.keySize = 0;
6353
- this.keySchedule = void 0;
6354
- this.invKeySchedule = void 0;
6353
+ this.keySchedule = undefined;
6354
+ this.invKeySchedule = undefined;
6355
6355
  this.initTable();
6356
6356
  }
6357
6357
 
@@ -6565,9 +6565,9 @@ class AESDecryptor {
6565
6565
 
6566
6566
  class FastAESKey {
6567
6567
  constructor(subtle, key, aesMode) {
6568
- this.subtle = void 0;
6569
- this.key = void 0;
6570
- this.aesMode = void 0;
6568
+ this.subtle = undefined;
6569
+ this.key = undefined;
6570
+ this.aesMode = undefined;
6571
6571
  this.subtle = subtle;
6572
6572
  this.key = key;
6573
6573
  this.aesMode = aesMode;
@@ -6597,7 +6597,7 @@ class Decrypter {
6597
6597
  removePKCS7Padding = true
6598
6598
  } = {}) {
6599
6599
  this.logEnabled = true;
6600
- this.removePKCS7Padding = void 0;
6600
+ this.removePKCS7Padding = undefined;
6601
6601
  this.subtle = null;
6602
6602
  this.softwareDecrypter = null;
6603
6603
  this.key = null;
@@ -6605,8 +6605,8 @@ class Decrypter {
6605
6605
  this.remainderData = null;
6606
6606
  this.currentIV = null;
6607
6607
  this.currentResult = null;
6608
- this.useSoftware = void 0;
6609
- this.enableSoftwareAES = void 0;
6608
+ this.useSoftware = undefined;
6609
+ this.enableSoftwareAES = undefined;
6610
6610
  this.enableSoftwareAES = config.enableSoftwareAES;
6611
6611
  this.removePKCS7Padding = removePKCS7Padding;
6612
6612
  // built in decryptor expects PKCS7 padding
@@ -6774,7 +6774,7 @@ const MIN_CHUNK_SIZE = Math.pow(2, 17); // 128kb
6774
6774
 
6775
6775
  class FragmentLoader {
6776
6776
  constructor(config) {
6777
- this.config = void 0;
6777
+ this.config = undefined;
6778
6778
  this.loader = null;
6779
6779
  this.partLoadTimeout = -1;
6780
6780
  this.config = config;
@@ -7040,7 +7040,7 @@ function createLoaderContext(frag, part = null) {
7040
7040
  var _frag$decryptdata;
7041
7041
  let byteRangeStart = start;
7042
7042
  let byteRangeEnd = end;
7043
- if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ? void 0 : _frag$decryptdata.method)) {
7043
+ if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ? undefined : _frag$decryptdata.method)) {
7044
7044
  // MAP segment encrypted with method 'AES-128' or 'AES-256' (cbc), when served with HTTP Range,
7045
7045
  // has the unencrypted size specified in the range.
7046
7046
  // Ref: https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08#section-6.3.6
@@ -7080,7 +7080,7 @@ function isMethodFullSegmentAesCbc(method) {
7080
7080
  class LoadError extends Error {
7081
7081
  constructor(data) {
7082
7082
  super(data.error.message);
7083
- this.data = void 0;
7083
+ this.data = undefined;
7084
7084
  this.data = data;
7085
7085
  }
7086
7086
  }
@@ -7117,7 +7117,7 @@ class LoadError extends Error {
7117
7117
  class TaskLoop extends Logger {
7118
7118
  constructor(label, logger) {
7119
7119
  super(label, logger);
7120
- this._boundTick = void 0;
7120
+ this._boundTick = undefined;
7121
7121
  this._tickTimer = null;
7122
7122
  this._tickInterval = null;
7123
7123
  this._tickCallCount = 0;
@@ -7209,12 +7209,12 @@ class TaskLoop extends Logger {
7209
7209
 
7210
7210
  class ChunkMetadata {
7211
7211
  constructor(level, sn, id, size = 0, part = -1, partial = false) {
7212
- this.level = void 0;
7213
- this.sn = void 0;
7214
- this.part = void 0;
7215
- this.id = void 0;
7216
- this.size = void 0;
7217
- this.partial = void 0;
7212
+ this.level = undefined;
7213
+ this.sn = undefined;
7214
+ this.part = undefined;
7215
+ this.id = undefined;
7216
+ this.size = undefined;
7217
+ this.partial = undefined;
7218
7218
  this.transmuxing = getNewPerformanceTiming();
7219
7219
  this.buffering = {
7220
7220
  audio: getNewPerformanceTiming(),
@@ -7368,7 +7368,7 @@ class BufferHelper {
7368
7368
  function findFirstFragWithCC(fragments, cc) {
7369
7369
  for (let i = 0, len = fragments.length; i < len; i++) {
7370
7370
  var _fragments$i;
7371
- if (((_fragments$i = fragments[i]) == null ? void 0 : _fragments$i.cc) === cc) {
7371
+ if (((_fragments$i = fragments[i]) == null ? undefined : _fragments$i.cc) === cc) {
7372
7372
  return fragments[i];
7373
7373
  }
7374
7374
  }
@@ -7529,16 +7529,16 @@ const State = {
7529
7529
  class BaseStreamController extends TaskLoop {
7530
7530
  constructor(hls, fragmentTracker, keyLoader, logPrefix, playlistType) {
7531
7531
  super(logPrefix, hls.logger);
7532
- this.hls = void 0;
7532
+ this.hls = undefined;
7533
7533
  this.fragPrevious = null;
7534
7534
  this.fragCurrent = null;
7535
- this.fragmentTracker = void 0;
7535
+ this.fragmentTracker = undefined;
7536
7536
  this.transmuxer = null;
7537
7537
  this._state = State.STOPPED;
7538
- this.playlistType = void 0;
7538
+ this.playlistType = undefined;
7539
7539
  this.media = null;
7540
7540
  this.mediaBuffer = null;
7541
- this.config = void 0;
7541
+ this.config = undefined;
7542
7542
  this.bitrateTest = false;
7543
7543
  this.lastCurrentTime = 0;
7544
7544
  this.nextLoadPosition = 0;
@@ -7546,15 +7546,15 @@ class BaseStreamController extends TaskLoop {
7546
7546
  this.startTimeOffset = null;
7547
7547
  this.retryDate = 0;
7548
7548
  this.levels = null;
7549
- this.fragmentLoader = void 0;
7550
- this.keyLoader = void 0;
7549
+ this.fragmentLoader = undefined;
7550
+ this.keyLoader = undefined;
7551
7551
  this.levelLastLoaded = null;
7552
7552
  this.startFragRequested = false;
7553
- this.decrypter = void 0;
7553
+ this.decrypter = undefined;
7554
7554
  this.initPTS = [];
7555
7555
  this.buffering = true;
7556
7556
  this.loadingParts = false;
7557
- this.loopSn = void 0;
7557
+ this.loopSn = undefined;
7558
7558
  this.onMediaSeeking = () => {
7559
7559
  const {
7560
7560
  config,
@@ -7729,7 +7729,7 @@ class BaseStreamController extends TaskLoop {
7729
7729
  getLevelDetails() {
7730
7730
  if (this.levels && this.levelLastLoaded !== null) {
7731
7731
  var _this$levelLastLoaded;
7732
- return (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details;
7732
+ return (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details;
7733
7733
  }
7734
7734
  }
7735
7735
  onMediaAttached(event, data) {
@@ -7848,7 +7848,7 @@ class BaseStreamController extends TaskLoop {
7848
7848
  if (this.state === State.STOPPED || this.state === State.ERROR) {
7849
7849
  return;
7850
7850
  }
7851
- this.warn(`Frag error: ${(reason == null ? void 0 : reason.message) || reason}`);
7851
+ this.warn(`Frag error: ${(reason == null ? undefined : reason.message) || reason}`);
7852
7852
  this.resetFragmentLoading(fragment);
7853
7853
  });
7854
7854
  }
@@ -7869,7 +7869,7 @@ class BaseStreamController extends TaskLoop {
7869
7869
  if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength, frag.duration)) {
7870
7870
  fragmentTracker.removeFragment(frag);
7871
7871
  }
7872
- } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? void 0 : _this$mediaBuffer.buffered.length) === 0) {
7872
+ } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? undefined : _this$mediaBuffer.buffered.length) === 0) {
7873
7873
  // Stop gap for bad tracker / buffer flush behavior
7874
7874
  fragmentTracker.removeAllFragments();
7875
7875
  } else if (fragmentTracker.hasParts(frag.type)) {
@@ -7902,7 +7902,7 @@ class BaseStreamController extends TaskLoop {
7902
7902
  }
7903
7903
  waitForLive(levelInfo) {
7904
7904
  const details = levelInfo.details;
7905
- return (details == null ? void 0 : details.live) && details.type !== 'EVENT' && (this.levelLastLoaded !== levelInfo || details.expired);
7905
+ return (details == null ? undefined : details.live) && details.type !== 'EVENT' && (this.levelLastLoaded !== levelInfo || details.expired);
7906
7906
  }
7907
7907
  flushMainBuffer(startOffset, endOffset, type = null) {
7908
7908
  if (!(startOffset - endOffset)) {
@@ -7919,7 +7919,7 @@ class BaseStreamController extends TaskLoop {
7919
7919
  }
7920
7920
  _loadInitSegment(fragment, level) {
7921
7921
  this._doFragLoad(fragment, level).then(data => {
7922
- const frag = data == null ? void 0 : data.frag;
7922
+ const frag = data == null ? undefined : data.frag;
7923
7923
  if (!frag || this.fragContextChanged(frag) || !this.levels) {
7924
7924
  throw new Error('init load aborted');
7925
7925
  }
@@ -8006,7 +8006,7 @@ class BaseStreamController extends TaskLoop {
8006
8006
  return;
8007
8007
  }
8008
8008
  }
8009
- const level = (_this$levels = this.levels) == null ? void 0 : _this$levels[frag.level];
8009
+ const level = (_this$levels = this.levels) == null ? undefined : _this$levels[frag.level];
8010
8010
  if (level != null && level.fragmentError) {
8011
8011
  this.log(`Resetting level fragment error count of ${level.fragmentError} on frag buffered`);
8012
8012
  level.fragmentError = 0;
@@ -8037,7 +8037,7 @@ class BaseStreamController extends TaskLoop {
8037
8037
  _doFragLoad(frag, level, targetBufferTime = null, progressCallback) {
8038
8038
  var _frag$decryptdata;
8039
8039
  this.fragCurrent = frag;
8040
- const details = level == null ? void 0 : level.details;
8040
+ const details = level == null ? undefined : level.details;
8041
8041
  if (!this.levels || !details) {
8042
8042
  throw new Error(`frag load aborted, missing level${details ? '' : ' detail'}s`);
8043
8043
  }
@@ -8068,7 +8068,7 @@ class BaseStreamController extends TaskLoop {
8068
8068
  if (isMediaFragment(frag) && (!fragPrevious || frag.sn !== fragPrevious.sn)) {
8069
8069
  const shouldLoadParts = this.shouldLoadParts(level.details, frag.end);
8070
8070
  if (shouldLoadParts !== this.loadingParts) {
8071
- this.log(`LL-Part loading ${shouldLoadParts ? 'ON' : 'OFF'} loading sn ${fragPrevious == null ? void 0 : fragPrevious.sn}->${frag.sn}`);
8071
+ this.log(`LL-Part loading ${shouldLoadParts ? 'ON' : 'OFF'} loading sn ${fragPrevious == null ? undefined : fragPrevious.sn}->${frag.sn}`);
8072
8072
  this.loadingParts = shouldLoadParts;
8073
8073
  }
8074
8074
  }
@@ -8131,7 +8131,7 @@ class BaseStreamController extends TaskLoop {
8131
8131
  let result;
8132
8132
  if (dataOnProgress && keyLoadingPromise) {
8133
8133
  result = keyLoadingPromise.then(keyLoadedData => {
8134
- if (!keyLoadedData || this.fragContextChanged(keyLoadedData == null ? void 0 : keyLoadedData.frag)) {
8134
+ if (!keyLoadedData || this.fragContextChanged(keyLoadedData == null ? undefined : keyLoadedData.frag)) {
8135
8135
  return null;
8136
8136
  }
8137
8137
  return this.fragmentLoader.load(frag, progressCallback);
@@ -8159,7 +8159,7 @@ class BaseStreamController extends TaskLoop {
8159
8159
  return new Promise((resolve, reject) => {
8160
8160
  var _level$details2;
8161
8161
  const partsLoaded = [];
8162
- const initialPartList = (_level$details2 = level.details) == null ? void 0 : _level$details2.partList;
8162
+ const initialPartList = (_level$details2 = level.details) == null ? undefined : _level$details2.partList;
8163
8163
  const loadPart = part => {
8164
8164
  this.fragmentLoader.loadPart(frag, part, progressCallback).then(partLoadedData => {
8165
8165
  partsLoaded[part.index] = partLoadedData;
@@ -8237,10 +8237,10 @@ class BaseStreamController extends TaskLoop {
8237
8237
  // Buffer must be ahead of first part + duration of parts after last segment
8238
8238
  // and playback must be at or past segment adjacent to part list
8239
8239
  const firstPart = details.partList[0];
8240
- const safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ? void 0 : _details$fragmentHint.duration) || 0);
8240
+ const safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ? undefined : _details$fragmentHint.duration) || 0);
8241
8241
  if (bufferEnd >= safePartStart) {
8242
8242
  var _this$media;
8243
- const playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ? void 0 : _this$media.currentTime) || this.lastCurrentTime : this.getLoadPosition();
8243
+ const playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ? undefined : _this$media.currentTime) || this.lastCurrentTime : this.getLoadPosition();
8244
8244
  if (playhead > firstPart.start - firstPart.fragment.duration) {
8245
8245
  return true;
8246
8246
  }
@@ -8380,7 +8380,7 @@ class BaseStreamController extends TaskLoop {
8380
8380
  }
8381
8381
  getAppendedFrag(position, playlistType = PlaylistLevelType.MAIN) {
8382
8382
  var _this$fragmentTracker;
8383
- const fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ? void 0 : _this$fragmentTracker.getAppendedFrag(position, playlistType);
8383
+ const fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ? undefined : _this$fragmentTracker.getAppendedFrag(position, playlistType);
8384
8384
  if (fragOrPart && 'fragment' in fragOrPart) {
8385
8385
  return fragOrPart.fragment;
8386
8386
  }
@@ -8420,7 +8420,7 @@ class BaseStreamController extends TaskLoop {
8420
8420
  const mainStart = this.hls.startPosition;
8421
8421
  const liveSyncPosition = this.hls.liveSyncPosition;
8422
8422
  const startPosition = frag ? (mainStart !== -1 && mainStart >= start ? mainStart : liveSyncPosition) || frag.start : pos;
8423
- this.log(`Setting startPosition to ${startPosition} to match initial live edge. mainStart: ${mainStart} liveSyncPosition: ${liveSyncPosition} frag.start: ${(_frag = frag) == null ? void 0 : _frag.start}`);
8423
+ this.log(`Setting startPosition to ${startPosition} to match initial live edge. mainStart: ${mainStart} liveSyncPosition: ${liveSyncPosition} frag.start: ${(_frag = frag) == null ? undefined : _frag.start}`);
8424
8424
  this.startPosition = this.nextLoadPosition = startPosition;
8425
8425
  }
8426
8426
  } else if (pos <= start) {
@@ -8694,7 +8694,7 @@ class BaseStreamController extends TaskLoop {
8694
8694
  }
8695
8695
  if (this.fragContextChanged(frag)) {
8696
8696
  var _this$fragCurrent;
8697
- this.warn(`Frag load error must match current frag to retry ${frag.url} > ${(_this$fragCurrent = this.fragCurrent) == null ? void 0 : _this$fragCurrent.url}`);
8697
+ this.warn(`Frag load error must match current frag to retry ${frag.url} > ${(_this$fragCurrent = this.fragCurrent) == null ? undefined : _this$fragCurrent.url}`);
8698
8698
  return;
8699
8699
  }
8700
8700
  const gapTagEncountered = data.details === ErrorDetails.FRAG_GAP;
@@ -8752,7 +8752,7 @@ class BaseStreamController extends TaskLoop {
8752
8752
  // reduce max buf len if current position is buffered
8753
8753
  const buffered = bufferedInfo && bufferedInfo.len > 0.5;
8754
8754
  if (buffered) {
8755
- this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ? void 0 : frag.duration) || 10);
8755
+ this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ? undefined : frag.duration) || 10);
8756
8756
  }
8757
8757
  const flushBuffer = !buffered;
8758
8758
  if (flushBuffer) {
@@ -8862,7 +8862,7 @@ class BaseStreamController extends TaskLoop {
8862
8862
  }
8863
8863
  return result;
8864
8864
  }, false);
8865
- if (!parsed && ((_this$transmuxer = this.transmuxer) == null ? void 0 : _this$transmuxer.error) === null) {
8865
+ if (!parsed && ((_this$transmuxer = this.transmuxer) == null ? undefined : _this$transmuxer.error) === null) {
8866
8866
  const error = new Error(`Found no media in fragment ${frag.sn} of ${this.playlistLabel()} ${frag.level} resetting transmuxer to fallback to playlist timing`);
8867
8867
  if (level.fragmentError === 0) {
8868
8868
  // Mark and track the odd empty segment as a gap to avoid reloading
@@ -8907,7 +8907,7 @@ class BaseStreamController extends TaskLoop {
8907
8907
  }
8908
8908
  resetTransmuxer() {
8909
8909
  var _this$transmuxer2;
8910
- (_this$transmuxer2 = this.transmuxer) == null ? void 0 : _this$transmuxer2.reset();
8910
+ (_this$transmuxer2 = this.transmuxer) == null ? undefined : _this$transmuxer2.reset();
8911
8911
  }
8912
8912
  recoverWorkerError(data) {
8913
8913
  if (data.event === 'demuxerWorker') {
@@ -8934,7 +8934,7 @@ class BaseStreamController extends TaskLoop {
8934
8934
 
8935
8935
  class BufferOperationQueue {
8936
8936
  constructor(sourceBufferReference) {
8937
- this.tracks = void 0;
8937
+ this.tracks = undefined;
8938
8938
  this.queues = {
8939
8939
  video: [],
8940
8940
  audio: [],
@@ -8987,7 +8987,7 @@ class BufferOperationQueue {
8987
8987
  }
8988
8988
  [this.queues.video, this.queues.audio, this.queues.audiovideo].forEach(queue => {
8989
8989
  var _queue$;
8990
- const label = (_queue$ = queue[0]) == null ? void 0 : _queue$.label;
8990
+ const label = (_queue$ = queue[0]) == null ? undefined : _queue$.label;
8991
8991
  if (label === 'async-blocker' || label === 'async-blocker-prepend') {
8992
8992
  queue[0].execute();
8993
8993
  queue.splice(0, 1);
@@ -9022,7 +9022,7 @@ class BufferOperationQueue {
9022
9022
  }
9023
9023
 
9024
9024
  // Only shift the current operation off, otherwise the updateend handler will do this for us
9025
- const sb = (_this$tracks$type = this.tracks[type]) == null ? void 0 : _this$tracks$type.buffer;
9025
+ const sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
9026
9026
  if (!(sb != null && sb.updating)) {
9027
9027
  this.shiftAndExecuteNext(type);
9028
9028
  }
@@ -9038,7 +9038,7 @@ class BufferOperationQueue {
9038
9038
  }
9039
9039
  current(type) {
9040
9040
  var _this$queues;
9041
- return ((_this$queues = this.queues) == null ? void 0 : _this$queues[type][0]) || null;
9041
+ return ((_this$queues = this.queues) == null ? undefined : _this$queues[type][0]) || null;
9042
9042
  }
9043
9043
  toString() {
9044
9044
  const {
@@ -9059,8 +9059,8 @@ ${this.list('audiovideo')}}`;
9059
9059
  }
9060
9060
  listSbInfo(type) {
9061
9061
  var _this$tracks2;
9062
- const track = (_this$tracks2 = this.tracks) == null ? void 0 : _this$tracks2[type];
9063
- const sb = track == null ? void 0 : track.buffer;
9062
+ const track = (_this$tracks2 = this.tracks) == null ? undefined : _this$tracks2[type];
9063
+ const sb = track == null ? undefined : track.buffer;
9064
9064
  if (!sb) {
9065
9065
  return 'none';
9066
9066
  }
@@ -9068,7 +9068,7 @@ ${this.list('audiovideo')}}`;
9068
9068
  }
9069
9069
  listOps(type) {
9070
9070
  var _this$queues3;
9071
- return ((_this$queues3 = this.queues) == null ? void 0 : _this$queues3[type].map(op => op.label).join(', ')) || '';
9071
+ return ((_this$queues3 = this.queues) == null ? undefined : _this$queues3[type].map(op => op.label).join(', ')) || '';
9072
9072
  }
9073
9073
  }
9074
9074
 
@@ -9083,8 +9083,8 @@ class HlsJsTrackRemovedError extends Error {
9083
9083
  class BufferController extends Logger {
9084
9084
  constructor(hls, fragmentTracker) {
9085
9085
  super('buffer-controller', hls.logger);
9086
- this.hls = void 0;
9087
- this.fragmentTracker = void 0;
9086
+ this.hls = undefined;
9087
+ this.fragmentTracker = undefined;
9088
9088
  // The level details used to determine duration, target-duration and live
9089
9089
  this.details = null;
9090
9090
  // cache the self generated object url to detect hijack of video tag
@@ -9104,11 +9104,11 @@ class BufferController extends Logger {
9104
9104
  // Keep track of video append position for unblocking audio
9105
9105
  this.lastVideoAppendEnd = 0;
9106
9106
  // Whether or not to use ManagedMediaSource API and append source element to media element.
9107
- this.appendSource = void 0;
9107
+ this.appendSource = undefined;
9108
9108
  // Transferred MediaSource information used to detmerine if duration end endstream may be appended
9109
- this.transferData = void 0;
9109
+ this.transferData = undefined;
9110
9110
  // Directives used to override default MediaSource handling
9111
- this.overrides = void 0;
9111
+ this.overrides = undefined;
9112
9112
  // Error counters
9113
9113
  this.appendErrors = {
9114
9114
  audio: 0,
@@ -9124,7 +9124,7 @@ class BufferController extends Logger {
9124
9124
  if (!this.hls) {
9125
9125
  return;
9126
9126
  }
9127
- if (((_this$mediaSource = this.mediaSource) == null ? void 0 : _this$mediaSource.readyState) !== 'open') {
9127
+ if (((_this$mediaSource = this.mediaSource) == null ? undefined : _this$mediaSource.readyState) !== 'open') {
9128
9128
  return;
9129
9129
  }
9130
9130
  this.hls.pauseBuffering();
@@ -9297,7 +9297,7 @@ class BufferController extends Logger {
9297
9297
  // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
9298
9298
  // it will contain the expected nb of source buffers, no need to compute it
9299
9299
  let codecEvents = 2;
9300
- if (data.audio && !data.video || !data.altAudio || !false) {
9300
+ if (data.audio && !data.video || !data.altAudio || true) {
9301
9301
  codecEvents = 1;
9302
9302
  }
9303
9303
  this.bufferCodecEventsTotal = codecEvents;
@@ -9346,7 +9346,7 @@ class BufferController extends Logger {
9346
9346
  }
9347
9347
  assignMediaSource(ms) {
9348
9348
  var _this$transferData2, _ms$constructor;
9349
- this.log(`${((_this$transferData2 = this.transferData) == null ? void 0 : _this$transferData2.mediaSource) === ms ? 'transferred' : 'created'} media source: ${(_ms$constructor = ms.constructor) == null ? void 0 : _ms$constructor.name}`);
9349
+ this.log(`${((_this$transferData2 = this.transferData) == null ? undefined : _this$transferData2.mediaSource) === ms ? 'transferred' : 'created'} media source: ${(_ms$constructor = ms.constructor) == null ? undefined : _ms$constructor.name}`);
9350
9350
  // MediaSource listeners are arrow functions with a lexical scope, and do not need to be bound
9351
9351
  ms.addEventListener('sourceopen', this._onMediaSourceOpen);
9352
9352
  ms.addEventListener('sourceended', this._onMediaSourceEnded);
@@ -9387,7 +9387,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9387
9387
  data.tracks = undefined;
9388
9388
  const currentTime = media.currentTime;
9389
9389
  const details = this.details;
9390
- const startTime = Math.max(currentTime, (details == null ? void 0 : details.fragments[0].start) || 0);
9390
+ const startTime = Math.max(currentTime, (details == null ? undefined : details.fragments[0].start) || 0);
9391
9391
  if (startTime - currentTime > 1) {
9392
9392
  this.log(`attachTransferred: waiting for playback to reach new tracks start time ${currentTime} -> ${startTime}`);
9393
9393
  return;
@@ -9432,7 +9432,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9432
9432
  }
9433
9433
  get mediaSourceOpenOrEnded() {
9434
9434
  var _this$mediaSource2;
9435
- const readyState = (_this$mediaSource2 = this.mediaSource) == null ? void 0 : _this$mediaSource2.readyState;
9435
+ const readyState = (_this$mediaSource2 = this.mediaSource) == null ? undefined : _this$mediaSource2.readyState;
9436
9436
  return readyState === 'open' || readyState === 'ended';
9437
9437
  }
9438
9438
  onMediaDetaching(event, data) {
@@ -9527,7 +9527,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9527
9527
  }
9528
9528
  resetBuffer(type) {
9529
9529
  var _this$tracks$type;
9530
- const sb = (_this$tracks$type = this.tracks[type]) == null ? void 0 : _this$tracks$type.buffer;
9530
+ const sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
9531
9531
  this.removeBuffer(type);
9532
9532
  if (sb) {
9533
9533
  try {
@@ -9579,10 +9579,10 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9579
9579
  metadata
9580
9580
  } = parsedTrack;
9581
9581
  let track = tracks[trackName];
9582
- const transferredTrack = (_this$transferData3 = this.transferData) == null ? void 0 : (_this$transferData3$t = _this$transferData3.tracks) == null ? void 0 : _this$transferData3$t[trackName];
9582
+ const transferredTrack = (_this$transferData3 = this.transferData) == null ? undefined : (_this$transferData3$t = _this$transferData3.tracks) == null ? undefined : _this$transferData3$t[trackName];
9583
9583
  const sbTrack = transferredTrack != null && transferredTrack.buffer ? transferredTrack : track;
9584
- const sbCodec = (sbTrack == null ? void 0 : sbTrack.pendingCodec) || (sbTrack == null ? void 0 : sbTrack.codec);
9585
- const trackLevelCodec = sbTrack == null ? void 0 : sbTrack.levelCodec;
9584
+ const sbCodec = (sbTrack == null ? undefined : sbTrack.pendingCodec) || (sbTrack == null ? undefined : sbTrack.codec);
9585
+ const trackLevelCodec = sbTrack == null ? undefined : sbTrack.levelCodec;
9586
9586
  const forceChangeType = !sbTrack || !!this.hls.config.assetPlayerId;
9587
9587
  if (!track) {
9588
9588
  track = tracks[trackName] = {
@@ -9597,9 +9597,9 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9597
9597
  }
9598
9598
  // check if SourceBuffer codec needs to change
9599
9599
  const currentCodecFull = pickMostCompleteCodecName(sbCodec, trackLevelCodec);
9600
- const currentCodec = currentCodecFull == null ? void 0 : currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
9600
+ const currentCodec = currentCodecFull == null ? undefined : currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
9601
9601
  let trackCodec = pickMostCompleteCodecName(codec, levelCodec);
9602
- const nextCodec = (_trackCodec = trackCodec) == null ? void 0 : _trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
9602
+ const nextCodec = (_trackCodec = trackCodec) == null ? undefined : _trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
9603
9603
  if (trackCodec && (currentCodec !== nextCodec || forceChangeType)) {
9604
9604
  if (trackName.slice(0, 5) === 'audio') {
9605
9605
  trackCodec = getCodecCompatibleName(trackCodec, this.appendSource);
@@ -9665,7 +9665,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9665
9665
  var _this$fragmentTracker;
9666
9666
  const pStart = partOrFrag.start;
9667
9667
  const pTime = pStart + partOrFrag.duration * 0.05;
9668
- const atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ? void 0 : _this$fragmentTracker.gap) === true;
9668
+ const atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ? undefined : _this$fragmentTracker.gap) === true;
9669
9669
  if (atGap) {
9670
9670
  return;
9671
9671
  }
@@ -9674,7 +9674,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9674
9674
  execute: () => {
9675
9675
  var _this$fragmentTracker2;
9676
9676
  const videoTrack = this.tracks.video;
9677
- if (this.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this$fragmentTracker2 = this.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ? void 0 : _this$fragmentTracker2.gap) === true) {
9677
+ if (this.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this$fragmentTracker2 = this.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ? undefined : _this$fragmentTracker2.gap) === true) {
9678
9678
  this.blockedAudioAppend = null;
9679
9679
  this.shiftAndExecuteNext('audio');
9680
9680
  }
@@ -9733,14 +9733,14 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9733
9733
  // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
9734
9734
  const audioTrack = tracks.audio;
9735
9735
  let checkTimestampOffset = false;
9736
- if (type === 'audio' && (audioTrack == null ? void 0 : audioTrack.container) === 'audio/mpeg') {
9736
+ if (type === 'audio' && (audioTrack == null ? undefined : audioTrack.container) === 'audio/mpeg') {
9737
9737
  checkTimestampOffset = !this.lastMpegAudioChunk || chunkMeta.id === 1 || this.lastMpegAudioChunk.sn !== chunkMeta.sn;
9738
9738
  this.lastMpegAudioChunk = chunkMeta;
9739
9739
  }
9740
9740
 
9741
9741
  // Block audio append until overlapping video append
9742
9742
  const videoTrack = this.tracks.video;
9743
- const videoSb = videoTrack == null ? void 0 : videoTrack.buffer;
9743
+ const videoSb = videoTrack == null ? undefined : videoTrack.buffer;
9744
9744
  if (videoSb && sn !== 'initSegment') {
9745
9745
  const partOrFrag = part || frag;
9746
9746
  const blockedAudioAppend = this.blockedAudioAppend;
@@ -9945,7 +9945,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9945
9945
  get bufferedToEnd() {
9946
9946
  return this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
9947
9947
  var _this$tracks$type2, _this$tracks$type3;
9948
- return type && (!((_this$tracks$type2 = this.tracks[type]) != null && _this$tracks$type2.ended) || ((_this$tracks$type3 = this.tracks[type]) == null ? void 0 : _this$tracks$type3.ending));
9948
+ return type && (!((_this$tracks$type2 = this.tracks[type]) != null && _this$tracks$type2.ended) || ((_this$tracks$type3 = this.tracks[type]) == null ? undefined : _this$tracks$type3.ending));
9949
9949
  });
9950
9950
  }
9951
9951
 
@@ -9965,7 +9965,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
9965
9965
  }
9966
9966
  }
9967
9967
  });
9968
- const allowEndOfStream = ((_this$overrides = this.overrides) == null ? void 0 : _this$overrides.endOfStream) !== false;
9968
+ const allowEndOfStream = ((_this$overrides = this.overrides) == null ? undefined : _this$overrides.endOfStream) !== false;
9969
9969
  const allTracksEnding = this.sourceBufferCount > 0 && !this.sourceBuffers.some(([type]) => {
9970
9970
  var _this$tracks$type4;
9971
9971
  return type && !((_this$tracks$type4 = this.tracks[type]) != null && _this$tracks$type4.ended);
@@ -10018,7 +10018,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10018
10018
  onError(event, data) {
10019
10019
  if (data.details === ErrorDetails.BUFFER_APPEND_ERROR && data.frag) {
10020
10020
  var _data$errorAction;
10021
- const nextAutoLevel = (_data$errorAction = data.errorAction) == null ? void 0 : _data$errorAction.nextAutoLevel;
10021
+ const nextAutoLevel = (_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.nextAutoLevel;
10022
10022
  if (isFiniteNumber(nextAutoLevel) && nextAutoLevel !== data.frag.level) {
10023
10023
  this.resetAppendErrors();
10024
10024
  }
@@ -10126,7 +10126,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10126
10126
  details,
10127
10127
  mediaSource
10128
10128
  } = this;
10129
- if (!details || !this.media || (mediaSource == null ? void 0 : mediaSource.readyState) !== 'open') {
10129
+ if (!details || !this.media || (mediaSource == null ? undefined : mediaSource.readyState) !== 'open') {
10130
10130
  return null;
10131
10131
  }
10132
10132
  const playlistEnd = details.edge;
@@ -10147,7 +10147,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10147
10147
  duration: Infinity
10148
10148
  };
10149
10149
  }
10150
- const overrideDuration = (_this$overrides2 = this.overrides) == null ? void 0 : _this$overrides2.duration;
10150
+ const overrideDuration = (_this$overrides2 = this.overrides) == null ? undefined : _this$overrides2.duration;
10151
10151
  if (overrideDuration) {
10152
10152
  return {
10153
10153
  duration: overrideDuration
@@ -10199,7 +10199,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10199
10199
  // 2 tracks is the max (one for audio, one for video). If we've reach this max go ahead and create the buffers.
10200
10200
  if (this.tracksReady) {
10201
10201
  var _this$transferData4;
10202
- const transferredTracks = (_this$transferData4 = this.transferData) == null ? void 0 : _this$transferData4.tracks;
10202
+ const transferredTracks = (_this$transferData4 = this.transferData) == null ? undefined : _this$transferData4.tracks;
10203
10203
  if (transferredTracks && Object.keys(transferredTracks).length) {
10204
10204
  this.attachTransferred();
10205
10205
  } else {
@@ -10325,8 +10325,8 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10325
10325
  }
10326
10326
  get mediaSrc() {
10327
10327
  var _this$media2, _this$media2$querySel;
10328
- const media = ((_this$media2 = this.media) == null ? void 0 : (_this$media2$querySel = _this$media2.querySelector) == null ? void 0 : _this$media2$querySel.call(_this$media2, 'source')) || this.media;
10329
- return media == null ? void 0 : media.src;
10328
+ const media = ((_this$media2 = this.media) == null ? undefined : (_this$media2$querySel = _this$media2.querySelector) == null ? undefined : _this$media2$querySel.call(_this$media2, 'source')) || this.media;
10329
+ return media == null ? undefined : media.src;
10330
10330
  }
10331
10331
  onSBUpdateStart(type) {
10332
10332
  const operation = this.currentOp(type);
@@ -10337,7 +10337,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10337
10337
  }
10338
10338
  onSBUpdateEnd(type) {
10339
10339
  var _this$mediaSource4;
10340
- if (((_this$mediaSource4 = this.mediaSource) == null ? void 0 : _this$mediaSource4.readyState) === 'closed') {
10340
+ if (((_this$mediaSource4 = this.mediaSource) == null ? undefined : _this$mediaSource4.readyState) === 'closed') {
10341
10341
  this.resetBuffer(type);
10342
10342
  return;
10343
10343
  }
@@ -10350,7 +10350,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10350
10350
  }
10351
10351
  onSBUpdateError(type, event) {
10352
10352
  var _this$mediaSource5;
10353
- const error = new Error(`${type} SourceBuffer error. MediaSource readyState: ${(_this$mediaSource5 = this.mediaSource) == null ? void 0 : _this$mediaSource5.readyState}`);
10353
+ const error = new Error(`${type} SourceBuffer error. MediaSource readyState: ${(_this$mediaSource5 = this.mediaSource) == null ? undefined : _this$mediaSource5.readyState}`);
10354
10354
  this.error(`${error}`, event);
10355
10355
  // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
10356
10356
  // SourceBuffer errors are not necessarily fatal; if so, the HTMLMediaElement will fire an error event
@@ -10375,7 +10375,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10375
10375
  mediaSource
10376
10376
  } = this;
10377
10377
  const track = this.tracks[type];
10378
- const sb = track == null ? void 0 : track.buffer;
10378
+ const sb = track == null ? undefined : track.buffer;
10379
10379
  if (!media || !mediaSource || !sb) {
10380
10380
  this.warn(`Attempting to remove from the ${type} SourceBuffer, but it does not exist`);
10381
10381
  this.shiftAndExecuteNext(type);
@@ -10398,7 +10398,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10398
10398
  // This method must result in an updateend event; if append is not called, onSBUpdateEnd must be called manually
10399
10399
  appendExecutor(data, type) {
10400
10400
  const track = this.tracks[type];
10401
- const sb = track == null ? void 0 : track.buffer;
10401
+ const sb = track == null ? undefined : track.buffer;
10402
10402
  if (!sb) {
10403
10403
  throw new HlsJsTrackRemovedError(`Attempting to append to the ${type} SourceBuffer, but it does not exist`);
10404
10404
  }
@@ -10454,7 +10454,7 @@ transfer tracks: ${JSON.stringify(transferredTracks, (key, value) => key === 'in
10454
10454
  stepOperationQueue(bufferNames) {
10455
10455
  bufferNames.forEach(type => {
10456
10456
  var _this$tracks$type5;
10457
- const sb = (_this$tracks$type5 = this.tracks[type]) == null ? void 0 : _this$tracks$type5.buffer;
10457
+ const sb = (_this$tracks$type5 = this.tracks[type]) == null ? undefined : _this$tracks$type5.buffer;
10458
10458
  // Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
10459
10459
  // true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
10460
10460
  // While this is a workaround, it's probably useful to have around
@@ -10548,14 +10548,14 @@ function sourceBufferNameToIndex(type) {
10548
10548
 
10549
10549
  class CapLevelController {
10550
10550
  constructor(hls) {
10551
- this.hls = void 0;
10552
- this.autoLevelCapping = void 0;
10553
- this.firstLevel = void 0;
10554
- this.media = void 0;
10555
- this.restrictedLevels = void 0;
10556
- this.timer = void 0;
10557
- this.clientRect = void 0;
10558
- this.streamController = void 0;
10551
+ this.hls = undefined;
10552
+ this.autoLevelCapping = undefined;
10553
+ this.firstLevel = undefined;
10554
+ this.media = undefined;
10555
+ this.restrictedLevels = undefined;
10556
+ this.timer = undefined;
10557
+ this.clientRect = undefined;
10558
+ this.streamController = undefined;
10559
10559
  this.hls = hls;
10560
10560
  this.autoLevelCapping = Number.POSITIVE_INFINITY;
10561
10561
  this.firstLevel = -1;
@@ -10783,7 +10783,7 @@ const PATHWAY_PENALTY_DURATION_MS = 300000;
10783
10783
  class ContentSteeringController extends Logger {
10784
10784
  constructor(hls) {
10785
10785
  super('content-steering', hls.logger);
10786
- this.hls = void 0;
10786
+ this.hls = undefined;
10787
10787
  this.loader = null;
10788
10788
  this.uri = null;
10789
10789
  this.pathwayId = '.';
@@ -10902,7 +10902,7 @@ class ContentSteeringController extends Logger {
10902
10902
  const {
10903
10903
  errorAction
10904
10904
  } = data;
10905
- if ((errorAction == null ? void 0 : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox && errorAction.flags === ErrorActionFlags.MoveAllAlternatesMatchingHost) {
10905
+ if ((errorAction == null ? undefined : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox && errorAction.flags === ErrorActionFlags.MoveAllAlternatesMatchingHost) {
10906
10906
  const levels = this.levels;
10907
10907
  let pathwayPriority = this._pathwayPriority;
10908
10908
  let errorPathway = this.pathwayId;
@@ -11100,7 +11100,7 @@ class ContentSteeringController extends Logger {
11100
11100
  onSuccess: (response, stats, context, networkDetails) => {
11101
11101
  this.log(`Loaded steering manifest: "${url}"`);
11102
11102
  const steeringData = response.data;
11103
- if ((steeringData == null ? void 0 : steeringData.VERSION) !== 1) {
11103
+ if ((steeringData == null ? undefined : steeringData.VERSION) !== 1) {
11104
11104
  this.log(`Steering VERSION ${steeringData.VERSION} not supported!`);
11105
11105
  return;
11106
11106
  }
@@ -11144,7 +11144,7 @@ class ContentSteeringController extends Logger {
11144
11144
  let ttl = this.timeToLoad * 1000;
11145
11145
  if (error.code === 429) {
11146
11146
  const loader = this.loader;
11147
- if (typeof (loader == null ? void 0 : loader.getResponseHeader) === 'function') {
11147
+ if (typeof (loader == null ? undefined : loader.getResponseHeader) === 'function') {
11148
11148
  const retryAfter = loader.getResponseHeader('Retry-After');
11149
11149
  if (retryAfter) {
11150
11150
  ttl = parseFloat(retryAfter) * 1000;
@@ -11167,7 +11167,7 @@ class ContentSteeringController extends Logger {
11167
11167
  this.clearTimeout();
11168
11168
  this.reloadTimer = self.setTimeout(() => {
11169
11169
  var _this$hls;
11170
- const media = (_this$hls = this.hls) == null ? void 0 : _this$hls.media;
11170
+ const media = (_this$hls = this.hls) == null ? undefined : _this$hls.media;
11171
11171
  if (media && !media.ended) {
11172
11172
  this.loadSteeringManifest(uri);
11173
11173
  return;
@@ -11201,7 +11201,7 @@ function performUriReplacement(uri, stableId, perOptionKey, uriReplacement) {
11201
11201
  } = uriReplacement;
11202
11202
  let perVariantUri;
11203
11203
  if (stableId) {
11204
- perVariantUri = perOptionUris == null ? void 0 : perOptionUris[stableId];
11204
+ perVariantUri = perOptionUris == null ? undefined : perOptionUris[stableId];
11205
11205
  if (perVariantUri) {
11206
11206
  uri = perVariantUri;
11207
11207
  }
@@ -11222,15 +11222,15 @@ function performUriReplacement(uri, stableId, perOptionKey, uriReplacement) {
11222
11222
 
11223
11223
  class FPSController {
11224
11224
  constructor(hls) {
11225
- this.hls = void 0;
11225
+ this.hls = undefined;
11226
11226
  this.isVideoPlaybackQualityAvailable = false;
11227
- this.timer = void 0;
11227
+ this.timer = undefined;
11228
11228
  this.media = null;
11229
- this.lastTime = void 0;
11229
+ this.lastTime = undefined;
11230
11230
  this.lastDroppedFrames = 0;
11231
11231
  this.lastDecodedFrames = 0;
11232
11232
  // stream controller must be provided as a dependency!
11233
- this.streamController = void 0;
11233
+ this.streamController = undefined;
11234
11234
  this.hls = hls;
11235
11235
  this.registerListeners();
11236
11236
  }
@@ -12437,8 +12437,8 @@ function dummyTrack(type = '', inputTimeScale = 90000) {
12437
12437
 
12438
12438
  class BaseAudioDemuxer {
12439
12439
  constructor() {
12440
- this._audioTrack = void 0;
12441
- this._id3Track = void 0;
12440
+ this._audioTrack = undefined;
12441
+ this._id3Track = undefined;
12442
12442
  this.frameIndex = 0;
12443
12443
  this.cachedData = null;
12444
12444
  this.basePTS = null;
@@ -12730,8 +12730,8 @@ function probe(data, offset) {
12730
12730
  class AACDemuxer extends BaseAudioDemuxer {
12731
12731
  constructor(observer, config) {
12732
12732
  super();
12733
- this.observer = void 0;
12734
- this.config = void 0;
12733
+ this.observer = undefined;
12734
+ this.config = undefined;
12735
12735
  this.observer = observer;
12736
12736
  this.config = config;
12737
12737
  }
@@ -12763,7 +12763,7 @@ class AACDemuxer extends BaseAudioDemuxer {
12763
12763
  // Layer bits (position 14 and 15) in header should be always 0 for ADTS
12764
12764
  // More info https://wiki.multimedia.cx/index.php?title=ADTS
12765
12765
  const id3Data = getId3Data(data, 0);
12766
- let offset = (id3Data == null ? void 0 : id3Data.length) || 0;
12766
+ let offset = (id3Data == null ? undefined : id3Data.length) || 0;
12767
12767
  if (probe(data, offset)) {
12768
12768
  return false;
12769
12769
  }
@@ -12839,7 +12839,7 @@ class MP3Demuxer extends BaseAudioDemuxer {
12839
12839
  // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
12840
12840
  // More info http://www.mp3-tech.org/programmer/frame_header.html
12841
12841
  const id3Data = getId3Data(data, 0);
12842
- let offset = (id3Data == null ? void 0 : id3Data.length) || 0;
12842
+ let offset = (id3Data == null ? undefined : id3Data.length) || 0;
12843
12843
 
12844
12844
  // Check for ac-3|ec-3 sync bytes and return false if present
12845
12845
  if (id3Data && data[offset] === 0x0b && data[offset + 1] === 0x77 && getId3Timestamp(id3Data) !== undefined &&
@@ -12871,11 +12871,11 @@ class MP4Demuxer {
12871
12871
  constructor(observer, config) {
12872
12872
  this.remainderData = null;
12873
12873
  this.timeOffset = 0;
12874
- this.config = void 0;
12875
- this.videoTrack = void 0;
12876
- this.audioTrack = void 0;
12877
- this.id3Track = void 0;
12878
- this.txtTrack = void 0;
12874
+ this.config = undefined;
12875
+ this.videoTrack = undefined;
12876
+ this.audioTrack = undefined;
12877
+ this.id3Track = undefined;
12878
+ this.txtTrack = undefined;
12879
12879
  this.config = config;
12880
12880
  }
12881
12881
  resetTimeStamp() {}
@@ -13021,8 +13021,8 @@ function getEmsgStartTime(emsgInfo, timeOffset) {
13021
13021
 
13022
13022
  class SampleAesDecrypter {
13023
13023
  constructor(observer, config, keyData) {
13024
- this.keyData = void 0;
13025
- this.decrypter = void 0;
13024
+ this.keyData = undefined;
13025
+ this.decrypter = undefined;
13026
13026
  this.keyData = keyData;
13027
13027
  this.decrypter = new Decrypter(config, {
13028
13028
  removePKCS7Padding: false
@@ -13280,10 +13280,10 @@ class BaseVideoParser {
13280
13280
 
13281
13281
  class ExpGolomb {
13282
13282
  constructor(data) {
13283
- this.data = void 0;
13284
- this.bytesAvailable = void 0;
13285
- this.word = void 0;
13286
- this.bitsAvailable = void 0;
13283
+ this.data = undefined;
13284
+ this.bytesAvailable = undefined;
13285
+ this.word = undefined;
13286
+ this.bitsAvailable = undefined;
13287
13287
  this.data = data;
13288
13288
  // the number of bytes left to examine in this.data
13289
13289
  this.bytesAvailable = data.byteLength;
@@ -13498,7 +13498,7 @@ class AvcVideoParser extends BaseVideoParser {
13498
13498
  spsfound = true;
13499
13499
  const sps = unit.data;
13500
13500
  const config = this.readSPS(sps);
13501
- if (!track.sps || track.width !== config.width || track.height !== config.height || ((_track$pixelRatio = track.pixelRatio) == null ? void 0 : _track$pixelRatio[0]) !== config.pixelRatio[0] || ((_track$pixelRatio2 = track.pixelRatio) == null ? void 0 : _track$pixelRatio2[1]) !== config.pixelRatio[1]) {
13501
+ if (!track.sps || track.width !== config.width || track.height !== config.height || ((_track$pixelRatio = track.pixelRatio) == null ? undefined : _track$pixelRatio[0]) !== config.pixelRatio[0] || ((_track$pixelRatio2 = track.pixelRatio) == null ? undefined : _track$pixelRatio2[1]) !== config.pixelRatio[1]) {
13502
13502
  track.width = config.width;
13503
13503
  track.height = config.height;
13504
13504
  track.pixelRatio = config.pixelRatio;
@@ -13744,22 +13744,22 @@ class AvcVideoParser extends BaseVideoParser {
13744
13744
  const PACKET_LENGTH = 188;
13745
13745
  class TSDemuxer {
13746
13746
  constructor(observer, config, typeSupported, logger) {
13747
- this.logger = void 0;
13748
- this.observer = void 0;
13749
- this.config = void 0;
13750
- this.typeSupported = void 0;
13747
+ this.logger = undefined;
13748
+ this.observer = undefined;
13749
+ this.config = undefined;
13750
+ this.typeSupported = undefined;
13751
13751
  this.sampleAes = null;
13752
13752
  this.pmtParsed = false;
13753
- this.audioCodec = void 0;
13754
- this.videoCodec = void 0;
13753
+ this.audioCodec = undefined;
13754
+ this.videoCodec = undefined;
13755
13755
  this._pmtId = -1;
13756
- this._videoTrack = void 0;
13757
- this._audioTrack = void 0;
13758
- this._id3Track = void 0;
13759
- this._txtTrack = void 0;
13756
+ this._videoTrack = undefined;
13757
+ this._audioTrack = undefined;
13758
+ this._id3Track = undefined;
13759
+ this._txtTrack = undefined;
13760
13760
  this.aacOverFlow = null;
13761
13761
  this.remainderData = null;
13762
- this.videoParser = void 0;
13762
+ this.videoParser = undefined;
13763
13763
  this.observer = observer;
13764
13764
  this.config = config;
13765
13765
  this.typeSupported = typeSupported;
@@ -15168,17 +15168,17 @@ class MP4 {
15168
15168
  }
15169
15169
  }
15170
15170
  }
15171
- MP4.types = void 0;
15172
- MP4.HDLR_TYPES = void 0;
15173
- MP4.STTS = void 0;
15174
- MP4.STSC = void 0;
15175
- MP4.STCO = void 0;
15176
- MP4.STSZ = void 0;
15177
- MP4.VMHD = void 0;
15178
- MP4.SMHD = void 0;
15179
- MP4.STSD = void 0;
15180
- MP4.FTYP = void 0;
15181
- MP4.DINF = void 0;
15171
+ MP4.types = undefined;
15172
+ MP4.HDLR_TYPES = undefined;
15173
+ MP4.STTS = undefined;
15174
+ MP4.STSC = undefined;
15175
+ MP4.STCO = undefined;
15176
+ MP4.STSZ = undefined;
15177
+ MP4.VMHD = undefined;
15178
+ MP4.SMHD = undefined;
15179
+ MP4.STSD = undefined;
15180
+ MP4.FTYP = undefined;
15181
+ MP4.DINF = undefined;
15182
15182
 
15183
15183
  const MPEG_TS_CLOCK_FREQ_HZ = 90000;
15184
15184
  function toTimescaleFromBase(baseTime, destScale, srcBase = 1, round = false) {
@@ -15212,10 +15212,10 @@ function createMp4Sample(isKeyframe, duration, size, cts) {
15212
15212
  }
15213
15213
  class MP4Remuxer {
15214
15214
  constructor(observer, config, typeSupported, logger) {
15215
- this.logger = void 0;
15216
- this.observer = void 0;
15217
- this.config = void 0;
15218
- this.typeSupported = void 0;
15215
+ this.logger = undefined;
15216
+ this.observer = undefined;
15217
+ this.config = undefined;
15218
+ this.typeSupported = undefined;
15219
15219
  this.ISGenerated = false;
15220
15220
  this._initPTS = null;
15221
15221
  this._initDTS = null;
@@ -15224,7 +15224,7 @@ class MP4Remuxer {
15224
15224
  this.videoSampleDuration = null;
15225
15225
  this.isAudioContiguous = false;
15226
15226
  this.isVideoContiguous = false;
15227
- this.videoTrackConfig = void 0;
15227
+ this.videoTrackConfig = undefined;
15228
15228
  this.observer = observer;
15229
15229
  this.config = config;
15230
15230
  this.typeSupported = typeSupported;
@@ -15306,7 +15306,7 @@ class MP4Remuxer {
15306
15306
  if (this.ISGenerated) {
15307
15307
  var _videoTrack$pixelRati, _config$pixelRatio, _videoTrack$pixelRati2, _config$pixelRatio2;
15308
15308
  const config = this.videoTrackConfig;
15309
- if (config && (videoTrack.width !== config.width || videoTrack.height !== config.height || ((_videoTrack$pixelRati = videoTrack.pixelRatio) == null ? void 0 : _videoTrack$pixelRati[0]) !== ((_config$pixelRatio = config.pixelRatio) == null ? void 0 : _config$pixelRatio[0]) || ((_videoTrack$pixelRati2 = videoTrack.pixelRatio) == null ? void 0 : _videoTrack$pixelRati2[1]) !== ((_config$pixelRatio2 = config.pixelRatio) == null ? void 0 : _config$pixelRatio2[1])) || !config && enoughVideoSamples || this.nextAudioPts === null && enoughAudioSamples) {
15309
+ if (config && (videoTrack.width !== config.width || videoTrack.height !== config.height || ((_videoTrack$pixelRati = videoTrack.pixelRatio) == null ? undefined : _videoTrack$pixelRati[0]) !== ((_config$pixelRatio = config.pixelRatio) == null ? undefined : _config$pixelRatio[0]) || ((_videoTrack$pixelRati2 = videoTrack.pixelRatio) == null ? undefined : _videoTrack$pixelRati2[1]) !== ((_config$pixelRatio2 = config.pixelRatio) == null ? undefined : _config$pixelRatio2[1])) || !config && enoughVideoSamples || this.nextAudioPts === null && enoughAudioSamples) {
15310
15310
  this.resetInitSegment();
15311
15311
  }
15312
15312
  }
@@ -16056,13 +16056,13 @@ function flushTextTrackUserdataCueSamples(track, timeOffset, initPTS) {
16056
16056
 
16057
16057
  class PassThroughRemuxer {
16058
16058
  constructor(observer, config, typeSupported, logger) {
16059
- this.logger = void 0;
16059
+ this.logger = undefined;
16060
16060
  this.emitInitSegment = false;
16061
- this.audioCodec = void 0;
16062
- this.videoCodec = void 0;
16063
- this.initData = void 0;
16061
+ this.audioCodec = undefined;
16062
+ this.videoCodec = undefined;
16063
+ this.initData = undefined;
16064
16064
  this.initPTS = null;
16065
- this.initTracks = void 0;
16065
+ this.initTracks = undefined;
16066
16066
  this.lastEndTime = null;
16067
16067
  this.logger = logger;
16068
16068
  }
@@ -16234,7 +16234,7 @@ function isInvalidInitPts(initPTS, startDTS, timeOffset, duration) {
16234
16234
  return Math.abs(startTime - timeOffset) > minDuration;
16235
16235
  }
16236
16236
  function getParsedTrackCodec(track, type) {
16237
- const parsedCodec = track == null ? void 0 : track.codec;
16237
+ const parsedCodec = track == null ? undefined : track.codec;
16238
16238
  if (parsedCodec && parsedCodec.length > 4) {
16239
16239
  return parsedCodec;
16240
16240
  }
@@ -16279,18 +16279,18 @@ const muxConfig = [{
16279
16279
  class Transmuxer {
16280
16280
  constructor(observer, typeSupported, config, vendor, id, logger) {
16281
16281
  this.asyncResult = false;
16282
- this.logger = void 0;
16283
- this.observer = void 0;
16284
- this.typeSupported = void 0;
16285
- this.config = void 0;
16286
- this.id = void 0;
16287
- this.demuxer = void 0;
16288
- this.remuxer = void 0;
16289
- this.decrypter = void 0;
16290
- this.probe = void 0;
16282
+ this.logger = undefined;
16283
+ this.observer = undefined;
16284
+ this.typeSupported = undefined;
16285
+ this.config = undefined;
16286
+ this.id = undefined;
16287
+ this.demuxer = undefined;
16288
+ this.remuxer = undefined;
16289
+ this.decrypter = undefined;
16290
+ this.probe = undefined;
16291
16291
  this.decryptionPromise = null;
16292
- this.transmuxConfig = void 0;
16293
- this.currentTransmuxState = void 0;
16292
+ this.transmuxConfig = undefined;
16293
+ this.currentTransmuxState = undefined;
16294
16294
  this.observer = observer;
16295
16295
  this.typeSupported = typeSupported;
16296
16296
  this.config = config;
@@ -16595,7 +16595,7 @@ class Transmuxer {
16595
16595
  }
16596
16596
  function getEncryptionType(data, decryptData) {
16597
16597
  let encryptionType = null;
16598
- if (data.byteLength > 0 && (decryptData == null ? void 0 : decryptData.key) != null && decryptData.iv !== null && decryptData.method != null) {
16598
+ if (data.byteLength > 0 && (decryptData == null ? undefined : decryptData.key) != null && decryptData.iv !== null && decryptData.method != null) {
16599
16599
  encryptionType = decryptData;
16600
16600
  }
16601
16601
  return encryptionType;
@@ -16609,11 +16609,11 @@ function isPromise(p) {
16609
16609
  }
16610
16610
  class TransmuxConfig {
16611
16611
  constructor(audioCodec, videoCodec, initSegmentData, duration, defaultInitPts) {
16612
- this.audioCodec = void 0;
16613
- this.videoCodec = void 0;
16614
- this.initSegmentData = void 0;
16615
- this.duration = void 0;
16616
- this.defaultInitPts = void 0;
16612
+ this.audioCodec = undefined;
16613
+ this.videoCodec = undefined;
16614
+ this.initSegmentData = undefined;
16615
+ this.duration = undefined;
16616
+ this.defaultInitPts = undefined;
16617
16617
  this.audioCodec = audioCodec;
16618
16618
  this.videoCodec = videoCodec;
16619
16619
  this.initSegmentData = initSegmentData;
@@ -16623,12 +16623,12 @@ class TransmuxConfig {
16623
16623
  }
16624
16624
  class TransmuxState {
16625
16625
  constructor(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange) {
16626
- this.discontinuity = void 0;
16627
- this.contiguous = void 0;
16628
- this.accurateTimeOffset = void 0;
16629
- this.trackSwitch = void 0;
16630
- this.timeOffset = void 0;
16631
- this.initSegmentChange = void 0;
16626
+ this.discontinuity = undefined;
16627
+ this.contiguous = undefined;
16628
+ this.accurateTimeOffset = undefined;
16629
+ this.trackSwitch = undefined;
16630
+ this.timeOffset = undefined;
16631
+ this.initSegmentChange = undefined;
16632
16632
  this.discontinuity = discontinuity;
16633
16633
  this.contiguous = contiguous;
16634
16634
  this.accurateTimeOffset = accurateTimeOffset;
@@ -16654,15 +16654,15 @@ function fetchSupported() {
16654
16654
  const BYTERANGE = /(\d+)-(\d+)\/(\d+)/;
16655
16655
  class FetchLoader {
16656
16656
  constructor(config) {
16657
- this.fetchSetup = void 0;
16658
- this.requestTimeout = void 0;
16657
+ this.fetchSetup = undefined;
16658
+ this.requestTimeout = undefined;
16659
16659
  this.request = null;
16660
16660
  this.response = null;
16661
- this.controller = void 0;
16661
+ this.controller = undefined;
16662
16662
  this.context = null;
16663
16663
  this.config = null;
16664
16664
  this.callbacks = null;
16665
- this.stats = void 0;
16665
+ this.stats = undefined;
16666
16666
  this.loader = null;
16667
16667
  this.fetchSetup = config.fetchSetup || getRequest;
16668
16668
  this.controller = new self.AbortController();
@@ -16735,7 +16735,7 @@ class FetchLoader {
16735
16735
  }
16736
16736
  stats.loading.first = first;
16737
16737
  stats.total = getContentLength(response.headers) || stats.total;
16738
- const onProgress = (_this$callbacks2 = this.callbacks) == null ? void 0 : _this$callbacks2.onProgress;
16738
+ const onProgress = (_this$callbacks2 = this.callbacks) == null ? undefined : _this$callbacks2.onProgress;
16739
16739
  if (onProgress && isFiniteNumber(config.highWaterMark)) {
16740
16740
  return this.loadProgressively(response, stats, context, config.highWaterMark, onProgress);
16741
16741
  }
@@ -16763,11 +16763,11 @@ class FetchLoader {
16763
16763
  data: responseData,
16764
16764
  code: response.status
16765
16765
  };
16766
- const onProgress = (_this$callbacks3 = this.callbacks) == null ? void 0 : _this$callbacks3.onProgress;
16766
+ const onProgress = (_this$callbacks3 = this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
16767
16767
  if (onProgress && !isFiniteNumber(config.highWaterMark)) {
16768
16768
  onProgress(stats, context, responseData, response);
16769
16769
  }
16770
- (_this$callbacks4 = this.callbacks) == null ? void 0 : _this$callbacks4.onSuccess(loaderResponse, stats, context, response);
16770
+ (_this$callbacks4 = this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(loaderResponse, stats, context, response);
16771
16771
  }).catch(error => {
16772
16772
  var _this$callbacks5;
16773
16773
  self.clearTimeout(this.requestTimeout);
@@ -16778,7 +16778,7 @@ class FetchLoader {
16778
16778
  // when destroying, 'error' itself can be undefined
16779
16779
  const code = !error ? 0 : error.code || 0;
16780
16780
  const text = !error ? null : error.message;
16781
- (_this$callbacks5 = this.callbacks) == null ? void 0 : _this$callbacks5.onError({
16781
+ (_this$callbacks5 = this.callbacks) == null ? undefined : _this$callbacks5.onError({
16782
16782
  code,
16783
16783
  text
16784
16784
  }, context, error ? error.details : null, stats);
@@ -16869,8 +16869,8 @@ function getRequest(context, initParams) {
16869
16869
  class FetchError extends Error {
16870
16870
  constructor(message, code, details) {
16871
16871
  super(message);
16872
- this.code = void 0;
16873
- this.details = void 0;
16872
+ this.code = undefined;
16873
+ this.details = undefined;
16874
16874
  this.code = code;
16875
16875
  this.details = details;
16876
16876
  }
@@ -16879,15 +16879,15 @@ class FetchError extends Error {
16879
16879
  const AGE_HEADER_LINE_REGEX = /^age:\s*[\d.]+\s*$/im;
16880
16880
  class XhrLoader {
16881
16881
  constructor(config) {
16882
- this.xhrSetup = void 0;
16883
- this.requestTimeout = void 0;
16884
- this.retryTimeout = void 0;
16885
- this.retryDelay = void 0;
16882
+ this.xhrSetup = undefined;
16883
+ this.requestTimeout = undefined;
16884
+ this.retryTimeout = undefined;
16885
+ this.retryDelay = undefined;
16886
16886
  this.config = null;
16887
16887
  this.callbacks = null;
16888
16888
  this.context = null;
16889
16889
  this.loader = null;
16890
- this.stats = void 0;
16890
+ this.stats = undefined;
16891
16891
  this.xhrSetup = config ? config.xhrSetup || null : null;
16892
16892
  this.stats = new LoadStats();
16893
16893
  this.retryDelay = 0;
@@ -16958,7 +16958,7 @@ class XhrLoader {
16958
16958
  }).catch(error => {
16959
16959
  var _this$callbacks2;
16960
16960
  // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
16961
- (_this$callbacks2 = this.callbacks) == null ? void 0 : _this$callbacks2.onError({
16961
+ (_this$callbacks2 = this.callbacks) == null ? undefined : _this$callbacks2.onError({
16962
16962
  code: xhr.status,
16963
16963
  text: error.message
16964
16964
  }, context, xhr, stats);
@@ -17037,7 +17037,7 @@ class XhrLoader {
17037
17037
  const len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
17038
17038
  stats.loaded = stats.total = len;
17039
17039
  stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
17040
- const onProgress = (_this$callbacks3 = this.callbacks) == null ? void 0 : _this$callbacks3.onProgress;
17040
+ const onProgress = (_this$callbacks3 = this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
17041
17041
  if (onProgress) {
17042
17042
  onProgress(stats, context, data, xhr);
17043
17043
  }
@@ -17046,7 +17046,7 @@ class XhrLoader {
17046
17046
  data: data,
17047
17047
  code: status
17048
17048
  };
17049
- (_this$callbacks4 = this.callbacks) == null ? void 0 : _this$callbacks4.onSuccess(_response, stats, context, xhr);
17049
+ (_this$callbacks4 = this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(_response, stats, context, xhr);
17050
17050
  return;
17051
17051
  }
17052
17052
  }
@@ -17065,7 +17065,7 @@ class XhrLoader {
17065
17065
  } else {
17066
17066
  var _this$callbacks5;
17067
17067
  logger.error(`${status} while loading ${context.url}`);
17068
- (_this$callbacks5 = this.callbacks) == null ? void 0 : _this$callbacks5.onError({
17068
+ (_this$callbacks5 = this.callbacks) == null ? undefined : _this$callbacks5.onError({
17069
17069
  code: status,
17070
17070
  text: xhr.statusText
17071
17071
  }, context, xhr, stats);
@@ -17081,7 +17081,7 @@ class XhrLoader {
17081
17081
  this.retry(retryConfig);
17082
17082
  } else {
17083
17083
  var _this$context;
17084
- logger.warn(`timeout while loading ${(_this$context = this.context) == null ? void 0 : _this$context.url}`);
17084
+ logger.warn(`timeout while loading ${(_this$context = this.context) == null ? undefined : _this$context.url}`);
17085
17085
  const callbacks = this.callbacks;
17086
17086
  if (callbacks) {
17087
17087
  this.abortInternal();
@@ -17096,7 +17096,7 @@ class XhrLoader {
17096
17096
  } = this;
17097
17097
  this.retryDelay = getRetryDelay(retryConfig, stats.retry);
17098
17098
  stats.retry++;
17099
- logger.warn(`${status ? 'HTTP Status ' + status : 'Timeout'} while loading ${context == null ? void 0 : context.url}, retrying ${stats.retry}/${retryConfig.maxNumRetry} in ${this.retryDelay}ms`);
17099
+ logger.warn(`${status ? 'HTTP Status ' + status : 'Timeout'} while loading ${context == null ? undefined : context.url}, retrying ${stats.retry}/${retryConfig.maxNumRetry} in ${this.retryDelay}ms`);
17100
17100
  // abort and reset internal state
17101
17101
  this.abortInternal();
17102
17102
  this.loader = null;
@@ -17655,7 +17655,7 @@ function hexToArrayBuffer(str) {
17655
17655
  }
17656
17656
  class ID3TrackController {
17657
17657
  constructor(hls) {
17658
- this.hls = void 0;
17658
+ this.hls = undefined;
17659
17659
  this.id3Track = null;
17660
17660
  this.media = null;
17661
17661
  this.dateRangeCuesAppended = {};
@@ -17707,7 +17707,7 @@ class ID3TrackController {
17707
17707
  onMediaAttaching(event, data) {
17708
17708
  var _data$overrides;
17709
17709
  this.media = data.media;
17710
- if (((_data$overrides = data.overrides) == null ? void 0 : _data$overrides.cueRemoval) === false) {
17710
+ if (((_data$overrides = data.overrides) == null ? undefined : _data$overrides.cueRemoval) === false) {
17711
17711
  this.removeCues = false;
17712
17712
  }
17713
17713
  }
@@ -17814,7 +17814,7 @@ class ID3TrackController {
17814
17814
  }
17815
17815
  updateId3CueEnds(startTime, type) {
17816
17816
  var _this$id3Track;
17817
- const cues = (_this$id3Track = this.id3Track) == null ? void 0 : _this$id3Track.cues;
17817
+ const cues = (_this$id3Track = this.id3Track) == null ? undefined : _this$id3Track.cues;
17818
17818
  if (cues) {
17819
17819
  for (let i = cues.length; i--;) {
17820
17820
  const cue = cues[i];
@@ -17901,7 +17901,7 @@ class ID3TrackController {
17901
17901
  }
17902
17902
  // Exit if the playlist does not have Date Ranges or does not have Program Date Time
17903
17903
  const lastFragment = details.fragments[details.fragments.length - 1];
17904
- if (ids.length === 0 || !isFiniteNumber(lastFragment == null ? void 0 : lastFragment.programDateTime)) {
17904
+ if (ids.length === 0 || !isFiniteNumber(lastFragment == null ? undefined : lastFragment.programDateTime)) {
17905
17905
  return;
17906
17906
  }
17907
17907
  if (!this.id3Track) {
@@ -17915,8 +17915,8 @@ class ID3TrackController {
17915
17915
 
17916
17916
  // Process DateRanges to determine end-time (known DURATION, END-DATE, or END-ON-NEXT)
17917
17917
  const appendedDateRangeCues = dateRangeCuesAppended[id];
17918
- const cues = (appendedDateRangeCues == null ? void 0 : appendedDateRangeCues.cues) || {};
17919
- let durationKnown = (appendedDateRangeCues == null ? void 0 : appendedDateRangeCues.durationKnown) || false;
17918
+ const cues = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.cues) || {};
17919
+ let durationKnown = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.durationKnown) || false;
17920
17920
  let endTime = MAX_CUE_ENDTIME;
17921
17921
  const {
17922
17922
  duration,
@@ -17987,8 +17987,8 @@ class ID3TrackController {
17987
17987
 
17988
17988
  class LatencyController {
17989
17989
  constructor(hls) {
17990
- this.hls = void 0;
17991
- this.config = void 0;
17990
+ this.hls = undefined;
17991
+ this.config = undefined;
17992
17992
  this.media = null;
17993
17993
  this.currentTime = 0;
17994
17994
  this.stallCount = 0;
@@ -18050,7 +18050,7 @@ class LatencyController {
18050
18050
  if (config.liveMaxLatencyDuration !== undefined) {
18051
18051
  return config.liveMaxLatencyDuration;
18052
18052
  }
18053
- const levelDetails = (_this$hls = this.hls) == null ? void 0 : _this$hls.latestLevelDetails;
18053
+ const levelDetails = (_this$hls = this.hls) == null ? undefined : _this$hls.latestLevelDetails;
18054
18054
  return levelDetails ? config.liveMaxLatencyDurationCount * levelDetails.targetduration : 0;
18055
18055
  }
18056
18056
  get targetLatency() {
@@ -18199,12 +18199,12 @@ class LevelController extends BasePlaylistController {
18199
18199
  this._levels = [];
18200
18200
  this._firstLevel = -1;
18201
18201
  this._maxAutoLevel = -1;
18202
- this._startLevel = void 0;
18202
+ this._startLevel = undefined;
18203
18203
  this.currentLevel = null;
18204
18204
  this.currentLevelIndex = -1;
18205
18205
  this.manualLevelIndex = -1;
18206
- this.steering = void 0;
18207
- this.onParsedComplete = void 0;
18206
+ this.steering = undefined;
18207
+ this.onParsedComplete = undefined;
18208
18208
  this.steering = contentSteeringController;
18209
18209
  this._registerListeners();
18210
18210
  }
@@ -18276,7 +18276,7 @@ class LevelController extends BasePlaylistController {
18276
18276
  // Returns empty and set to undefined for 'mp4a.40.34' with fallback to 'audio/mpeg' SourceBuffer
18277
18277
  levelParsed.audioCodec = audioCodec = getCodecCompatibleName(audioCodec, preferManagedMediaSource) || undefined;
18278
18278
  }
18279
- if (((_videoCodec = videoCodec) == null ? void 0 : _videoCodec.indexOf('avc1')) === 0) {
18279
+ if (((_videoCodec = videoCodec) == null ? undefined : _videoCodec.indexOf('avc1')) === 0) {
18280
18280
  videoCodec = levelParsed.videoCodec = convertAVC1ToAVCOTI(videoCodec);
18281
18281
  }
18282
18282
 
@@ -18447,7 +18447,7 @@ class LevelController extends BasePlaylistController {
18447
18447
  const bandwidthEstimate = this.hls.bandwidthEstimate;
18448
18448
  this.log(`manifest loaded, ${levels.length} level(s) found, first bitrate: ${firstLevelBitrate}`);
18449
18449
  // Update default bwe to first variant bitrate as long it has not been configured or set
18450
- if (((_this$hls$userConfig = this.hls.userConfig) == null ? void 0 : _this$hls$userConfig.abrEwmaDefaultEstimate) === undefined) {
18450
+ if (((_this$hls$userConfig = this.hls.userConfig) == null ? undefined : _this$hls$userConfig.abrEwmaDefaultEstimate) === undefined) {
18451
18451
  const startingBwEstimate = Math.min(firstLevelBitrate, this.hls.config.abrEwmaDefaultEstimateMax);
18452
18452
  if (startingBwEstimate > bandwidthEstimate && bandwidthEstimate === this.hls.abrEwmaDefaultEstimate) {
18453
18453
  this.hls.bandwidthEstimate = startingBwEstimate;
@@ -18548,7 +18548,7 @@ class LevelController extends BasePlaylistController {
18548
18548
  const levelDetails = level.details;
18549
18549
  if (!levelDetails || levelDetails.live) {
18550
18550
  // level not retrieved yet, or live playlist we need to (re)load it
18551
- const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details, levelDetails);
18551
+ const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? undefined : lastLevel.details, levelDetails);
18552
18552
  this.loadPlaylist(hlsUrlParameters);
18553
18553
  }
18554
18554
  }
@@ -18673,8 +18673,8 @@ class LevelController extends BasePlaylistController {
18673
18673
  const currentLevelIndex = this.currentLevelIndex;
18674
18674
  const pathwayId = currentLevel.attrs['PATHWAY-ID'];
18675
18675
  const details = currentLevel.details;
18676
- const age = details == null ? void 0 : details.age;
18677
- this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${pathwayId ? ' Pathway ' + pathwayId : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
18676
+ const age = details == null ? undefined : details.age;
18677
+ this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : ''}${pathwayId ? ' Pathway ' + pathwayId : ''}${age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : ''} ${url}`);
18678
18678
  this.hls.trigger(Events.LEVEL_LOADING, {
18679
18679
  url,
18680
18680
  level: currentLevelIndex,
@@ -18775,10 +18775,10 @@ const SKIP_BUFFER_RANGE_START = 0.05;
18775
18775
  class GapController extends Logger {
18776
18776
  constructor(config, media, fragmentTracker, hls) {
18777
18777
  super('gap-controller', hls.logger);
18778
- this.config = void 0;
18778
+ this.config = undefined;
18779
18779
  this.media = null;
18780
- this.fragmentTracker = void 0;
18781
- this.hls = void 0;
18780
+ this.fragmentTracker = undefined;
18781
+ this.hls = undefined;
18782
18782
  this.nudgeRetry = 0;
18783
18783
  this.stallReported = false;
18784
18784
  this.stalled = null;
@@ -18906,7 +18906,7 @@ class GapController extends Logger {
18906
18906
  const stalledDuration = tnow - stalled;
18907
18907
  if (!seeking && stalledDuration >= STALL_MINIMUM_DURATION_MS) {
18908
18908
  // Dispatch MEDIA_ENDED when media.ended/ended event is not signalled at end of stream
18909
- if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ? void 0 : levelDetails.edge) || 0)) < 1) {
18909
+ if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ? undefined : levelDetails.edge) || 0)) < 1) {
18910
18910
  if (stalledDuration < 1000 || this.ended) {
18911
18911
  return;
18912
18912
  }
@@ -19113,7 +19113,7 @@ class GapController extends Logger {
19113
19113
  }
19114
19114
  }
19115
19115
 
19116
- const version = "1.6.0-beta.2.0.canary.10878";
19116
+ const version = "1.6.0-beta.2.0.canary.10882";
19117
19117
 
19118
19118
  // ensure the worker ends up in the bundle
19119
19119
  // If the worker should not be included this gets aliased to empty.js
@@ -19179,17 +19179,17 @@ let transmuxerInstanceCount = 0;
19179
19179
  class TransmuxerInterface {
19180
19180
  constructor(_hls, id, onTransmuxComplete, onFlush) {
19181
19181
  this.error = null;
19182
- this.hls = void 0;
19183
- this.id = void 0;
19182
+ this.hls = undefined;
19183
+ this.id = undefined;
19184
19184
  this.instanceNo = transmuxerInstanceCount++;
19185
- this.observer = void 0;
19185
+ this.observer = undefined;
19186
19186
  this.frag = null;
19187
19187
  this.part = null;
19188
- this.useWorker = void 0;
19188
+ this.useWorker = undefined;
19189
19189
  this.workerContext = null;
19190
19190
  this.transmuxer = null;
19191
- this.onTransmuxComplete = void 0;
19192
- this.onFlush = void 0;
19191
+ this.onTransmuxComplete = undefined;
19192
+ this.onFlush = undefined;
19193
19193
  this.onWorkerMessage = event => {
19194
19194
  const data = event.data;
19195
19195
  const hls = this.hls;
@@ -19200,7 +19200,7 @@ class TransmuxerInterface {
19200
19200
  case 'init':
19201
19201
  {
19202
19202
  var _this$workerContext;
19203
- const objectURL = (_this$workerContext = this.workerContext) == null ? void 0 : _this$workerContext.objectURL;
19203
+ const objectURL = (_this$workerContext = this.workerContext) == null ? undefined : _this$workerContext.objectURL;
19204
19204
  if (objectURL) {
19205
19205
  // revoke the Object URL that was used to create transmuxer worker, so as not to leak it
19206
19206
  self.URL.revokeObjectURL(objectURL);
@@ -19377,7 +19377,7 @@ class TransmuxerInterface {
19377
19377
  const trackSwitch = !(lastFrag && chunkMeta.level === lastFrag.level);
19378
19378
  const snDiff = lastFrag ? chunkMeta.sn - lastFrag.sn : -1;
19379
19379
  const partDiff = this.part ? chunkMeta.part - this.part.index : -1;
19380
- const progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ? void 0 : lastFrag.stats.chunkCount);
19380
+ const progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ? undefined : lastFrag.stats.chunkCount);
19381
19381
  const contiguous = !trackSwitch && (snDiff === 1 || snDiff === 0 && (partDiff === 1 || progressive && partDiff <= 0));
19382
19382
  const now = self.performance.now();
19383
19383
  if (trackSwitch || snDiff || frag.stats.parsing.start === 0) {
@@ -19386,7 +19386,7 @@ class TransmuxerInterface {
19386
19386
  if (part && (partDiff || !contiguous)) {
19387
19387
  part.stats.parsing.start = now;
19388
19388
  }
19389
- const initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ? void 0 : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) == null ? void 0 : _lastFrag$initSegment.url));
19389
+ const initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) == null ? undefined : _lastFrag$initSegment.url));
19390
19390
  const state = new TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange);
19391
19391
  if (!contiguous || discontinuity || initSegmentChange) {
19392
19392
  this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${frag.type} sn: ${chunkMeta.sn}${chunkMeta.part > -1 ? ' part: ' + chunkMeta.part : ''} ${this.id === PlaylistLevelType.MAIN ? 'level' : 'track'}: ${chunkMeta.level} id: ${chunkMeta.id}
@@ -19514,12 +19514,12 @@ function isSupported() {
19514
19514
  return false;
19515
19515
  }
19516
19516
  const mediaSource = getMediaSource();
19517
- return typeof (mediaSource == null ? void 0 : mediaSource.isTypeSupported) === 'function' && (['avc1.42E01E,mp4a.40.2', 'av01.0.01M.08', 'vp09.00.50.08'].some(codecsForVideoContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecsForVideoContainer, 'video'))) || ['mp4a.40.2', 'fLaC'].some(codecForAudioContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecForAudioContainer, 'audio'))));
19517
+ return typeof (mediaSource == null ? undefined : mediaSource.isTypeSupported) === 'function' && (['avc1.42E01E,mp4a.40.2', 'av01.0.01M.08', 'vp09.00.50.08'].some(codecsForVideoContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecsForVideoContainer, 'video'))) || ['mp4a.40.2', 'fLaC'].some(codecForAudioContainer => mediaSource.isTypeSupported(mimeTypeForCodec(codecForAudioContainer, 'audio'))));
19518
19518
  }
19519
19519
  function changeTypeSupported() {
19520
19520
  var _sourceBuffer$prototy;
19521
19521
  const sourceBuffer = getSourceBuffer();
19522
- return typeof (sourceBuffer == null ? void 0 : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? void 0 : _sourceBuffer$prototy.changeType) === 'function';
19522
+ return typeof (sourceBuffer == null ? undefined : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? undefined : _sourceBuffer$prototy.changeType) === 'function';
19523
19523
  }
19524
19524
 
19525
19525
  const TICK_INTERVAL = 100; // how often to tick in ms
@@ -19657,8 +19657,8 @@ class StreamController extends BaseStreamController {
19657
19657
  levels,
19658
19658
  level
19659
19659
  } = this;
19660
- const currentLevel = levels == null ? void 0 : levels[level];
19661
- const details = currentLevel == null ? void 0 : currentLevel.details;
19660
+ const currentLevel = levels == null ? undefined : levels[level];
19661
+ const details = currentLevel == null ? undefined : currentLevel.details;
19662
19662
  if (details && (!details.live || this.levelLastLoaded === currentLevel && !this.waitForLive(currentLevel))) {
19663
19663
  if (this.waitForCdnTuneIn(details)) {
19664
19664
  break;
@@ -19682,7 +19682,7 @@ class StreamController extends BaseStreamController {
19682
19682
  levels,
19683
19683
  level
19684
19684
  } = this;
19685
- const currentLevel = levels == null ? void 0 : levels[level];
19685
+ const currentLevel = levels == null ? undefined : levels[level];
19686
19686
  this.resetStartWhenNotLoaded(currentLevel || null);
19687
19687
  this.state = State.IDLE;
19688
19688
  }
@@ -19963,7 +19963,7 @@ class StreamController extends BaseStreamController {
19963
19963
  if (gapController.ended) {
19964
19964
  return;
19965
19965
  }
19966
- gapController.ended = ((_this$media2 = this.media) == null ? void 0 : _this$media2.currentTime) || 1;
19966
+ gapController.ended = ((_this$media2 = this.media) == null ? undefined : _this$media2.currentTime) || 1;
19967
19967
  }
19968
19968
  this.hls.trigger(Events.MEDIA_ENDED, {
19969
19969
  stalled: false
@@ -20038,7 +20038,7 @@ class StreamController extends BaseStreamController {
20038
20038
  if (newDetails.deltaUpdateFailed) {
20039
20039
  return;
20040
20040
  }
20041
- sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details);
20041
+ sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
20042
20042
  }
20043
20043
  // override level info
20044
20044
  curLevel.details = newDetails;
@@ -20124,7 +20124,7 @@ class StreamController extends BaseStreamController {
20124
20124
 
20125
20125
  // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
20126
20126
  const accurateTimeOffset = details.PTSKnown || !details.live;
20127
- const initSegmentData = (_frag$initSegment = frag.initSegment) == null ? void 0 : _frag$initSegment.data;
20127
+ const initSegmentData = (_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.data;
20128
20128
  const audioCodec = this._getAudioCodec(currentLevel);
20129
20129
 
20130
20130
  // transmux the MPEG-TS data to ISO-BMFF segments
@@ -20168,7 +20168,7 @@ class StreamController extends BaseStreamController {
20168
20168
  this.fragmentTracker.removeAllFragments();
20169
20169
  hls.once(Events.BUFFER_FLUSHED, () => {
20170
20170
  var _this$hls;
20171
- (_this$hls = this.hls) == null ? void 0 : _this$hls.trigger(Events.AUDIO_TRACK_SWITCHED, data);
20171
+ (_this$hls = this.hls) == null ? undefined : _this$hls.trigger(Events.AUDIO_TRACK_SWITCHED, data);
20172
20172
  });
20173
20173
  hls.trigger(Events.BUFFER_FLUSHING, {
20174
20174
  startOffset: 0,
@@ -20281,7 +20281,7 @@ class StreamController extends BaseStreamController {
20281
20281
  case ErrorDetails.LEVEL_LOAD_TIMEOUT:
20282
20282
  case ErrorDetails.LEVEL_PARSING_ERROR:
20283
20283
  // in case of non fatal error while loading level, if level controller is not retrying to load level, switch back to IDLE
20284
- if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ? void 0 : _data$context.type) === PlaylistContextType.LEVEL) {
20284
+ if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ? undefined : _data$context.type) === PlaylistContextType.LEVEL) {
20285
20285
  this.state = State.IDLE;
20286
20286
  }
20287
20287
  break;
@@ -20379,13 +20379,13 @@ class StreamController extends BaseStreamController {
20379
20379
  const details = this.getLevelDetails();
20380
20380
  const configuredTimelineOffset = this.config.timelineOffset;
20381
20381
  if (configuredTimelineOffset && startPosition) {
20382
- startPosition += (details == null ? void 0 : details.appliedTimelineOffset) || configuredTimelineOffset;
20382
+ startPosition += (details == null ? undefined : details.appliedTimelineOffset) || configuredTimelineOffset;
20383
20383
  }
20384
20384
  const buffered = BufferHelper.getBuffered(media);
20385
20385
  const bufferStart = buffered.length ? buffered.start(0) : 0;
20386
20386
  const delta = bufferStart - startPosition;
20387
20387
  const skipTolerance = Math.max(this.config.maxBufferHole, this.config.maxFragLookUpTolerance);
20388
- if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ? void 0 : details.partTarget) || 0))) {
20388
+ if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ? undefined : details.partTarget) || 0))) {
20389
20389
  this.log(`adjusting start position by ${delta} to match buffer start`);
20390
20390
  startPosition += delta;
20391
20391
  this.startPosition = startPosition;
@@ -20414,7 +20414,7 @@ class StreamController extends BaseStreamController {
20414
20414
  const {
20415
20415
  hls
20416
20416
  } = this;
20417
- const frag = data == null ? void 0 : data.frag;
20417
+ const frag = data == null ? undefined : data.frag;
20418
20418
  if (!frag || this.fragContextChanged(frag)) {
20419
20419
  return;
20420
20420
  }
@@ -20648,7 +20648,7 @@ class StreamController extends BaseStreamController {
20648
20648
  video.levelCodec = currentLevel.videoCodec;
20649
20649
  video.id = 'main';
20650
20650
  const parsedVideoCodec = video.codec;
20651
- if ((parsedVideoCodec == null ? void 0 : parsedVideoCodec.length) === 4) {
20651
+ if ((parsedVideoCodec == null ? undefined : parsedVideoCodec.length) === 4) {
20652
20652
  // Make up for passthrough-remuxer not being able to parse full codec
20653
20653
  // (logger warning "Unhandled video codec...")
20654
20654
  switch (parsedVideoCodec) {
@@ -20706,7 +20706,7 @@ class StreamController extends BaseStreamController {
20706
20706
  levels,
20707
20707
  level
20708
20708
  } = this;
20709
- const levelInfo = levels == null ? void 0 : levels[level];
20709
+ const levelInfo = levels == null ? undefined : levels[level];
20710
20710
  if (!levelInfo) {
20711
20711
  return this.config.maxBufferLength;
20712
20712
  }
@@ -20775,7 +20775,7 @@ class StreamController extends BaseStreamController {
20775
20775
  if (this.fragPlaying) {
20776
20776
  return this.fragPlaying;
20777
20777
  }
20778
- const currentTime = ((_this$media3 = this.media) == null ? void 0 : _this$media3.currentTime) || this.lastCurrentTime;
20778
+ const currentTime = ((_this$media3 = this.media) == null ? undefined : _this$media3.currentTime) || this.lastCurrentTime;
20779
20779
  if (isFiniteNumber(currentTime)) {
20780
20780
  return this.getAppendedFrag(currentTime);
20781
20781
  }
@@ -20783,7 +20783,7 @@ class StreamController extends BaseStreamController {
20783
20783
  }
20784
20784
  get currentProgramDateTime() {
20785
20785
  var _this$media4;
20786
- const currentTime = ((_this$media4 = this.media) == null ? void 0 : _this$media4.currentTime) || this.lastCurrentTime;
20786
+ const currentTime = ((_this$media4 = this.media) == null ? undefined : _this$media4.currentTime) || this.lastCurrentTime;
20787
20787
  if (isFiniteNumber(currentTime)) {
20788
20788
  const details = this.getLevelDetails();
20789
20789
  const frag = this.currentFrag || (details ? findFragmentByPTS(null, details.fragments, currentTime) : null);
@@ -20818,7 +20818,7 @@ class StreamController extends BaseStreamController {
20818
20818
 
20819
20819
  class KeyLoader {
20820
20820
  constructor(config) {
20821
- this.config = void 0;
20821
+ this.config = undefined;
20822
20822
  this.keyUriToKeyInfo = {};
20823
20823
  this.emeController = null;
20824
20824
  this.config = config;
@@ -20828,7 +20828,7 @@ class KeyLoader {
20828
20828
  const loader = this.keyUriToKeyInfo[uri].loader;
20829
20829
  if (loader) {
20830
20830
  var _loader$context;
20831
- if (type && type !== ((_loader$context = loader.context) == null ? void 0 : _loader$context.frag.type)) {
20831
+ if (type && type !== ((_loader$context = loader.context) == null ? undefined : _loader$context.frag.type)) {
20832
20832
  return;
20833
20833
  }
20834
20834
  loader.abort();
@@ -20917,7 +20917,7 @@ class KeyLoader {
20917
20917
  // Return key load promise as long as it does not have a mediakey session with an unusable key status
20918
20918
  if ((_keyInfo2 = keyInfo) != null && _keyInfo2.keyLoadPromise) {
20919
20919
  var _keyInfo$mediaKeySess;
20920
- switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ? void 0 : _keyInfo$mediaKeySess.keyStatus) {
20920
+ switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ? undefined : _keyInfo$mediaKeySess.keyStatus) {
20921
20921
  case undefined:
20922
20922
  case 'status-pending':
20923
20923
  case 'usable':
@@ -21086,7 +21086,7 @@ function getResponseUrl(response, context) {
21086
21086
  }
21087
21087
  class PlaylistLoader {
21088
21088
  constructor(hls) {
21089
- this.hls = void 0;
21089
+ this.hls = undefined;
21090
21090
  this.loaders = Object.create(null);
21091
21091
  this.variableList = null;
21092
21092
  this.onManifestLoaded = this.checkAutostartLoad;
@@ -21279,7 +21279,7 @@ class PlaylistLoader {
21279
21279
 
21280
21280
  // Override level/track timeout for LL-HLS requests
21281
21281
  // (the default of 10000ms is counter productive to blocking playlist reload requests)
21282
- if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ? void 0 : _context$deliveryDire.part)) {
21282
+ if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ? undefined : _context$deliveryDire.part)) {
21283
21283
  let levelDetails;
21284
21284
  if (context.type === PlaylistContextType.LEVEL && context.level !== null) {
21285
21285
  levelDetails = this.hls.levels[context.level].details;
@@ -21522,7 +21522,7 @@ class PlaylistLoader {
21522
21522
  stats
21523
21523
  };
21524
21524
  if (response) {
21525
- const url = (networkDetails == null ? void 0 : networkDetails.url) || context.url;
21525
+ const url = (networkDetails == null ? undefined : networkDetails.url) || context.url;
21526
21526
  errorData.response = _objectSpread2({
21527
21527
  url,
21528
21528
  data: undefined
@@ -21671,7 +21671,7 @@ function getMediaDecodingInfoPromise(level, audioTracksByGroup, mediaCapabilitie
21671
21671
  if (!audioGroupId) {
21672
21672
  return;
21673
21673
  }
21674
- (_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ? void 0 : _audioTracksByGroup$g.tracks.forEach(audioTrack => {
21674
+ (_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ? undefined : _audioTracksByGroup$g.tracks.forEach(audioTrack => {
21675
21675
  if (audioTrack.groupId === audioGroupId) {
21676
21676
  const channels = audioTrack.channels || '';
21677
21677
  const channelsNumber = parseFloat(channels);
@@ -21793,35 +21793,35 @@ class Hls {
21793
21793
  /**
21794
21794
  * The runtime configuration used by the player. At instantiation this is combination of `hls.userConfig` merged over `Hls.DefaultConfig`.
21795
21795
  */
21796
- this.config = void 0;
21796
+ this.config = undefined;
21797
21797
  /**
21798
21798
  * The configuration object provided on player instantiation.
21799
21799
  */
21800
- this.userConfig = void 0;
21800
+ this.userConfig = undefined;
21801
21801
  /**
21802
21802
  * The logger functions used by this player instance, configured on player instantiation.
21803
21803
  */
21804
- this.logger = void 0;
21805
- this.coreComponents = void 0;
21806
- this.networkControllers = void 0;
21804
+ this.logger = undefined;
21805
+ this.coreComponents = undefined;
21806
+ this.networkControllers = undefined;
21807
21807
  this._emitter = new EventEmitter();
21808
21808
  this._autoLevelCapping = -1;
21809
21809
  this._maxHdcpLevel = null;
21810
- this.abrController = void 0;
21811
- this.bufferController = void 0;
21812
- this.capLevelController = void 0;
21813
- this.latencyController = void 0;
21814
- this.levelController = void 0;
21815
- this.streamController = void 0;
21816
- this.audioTrackController = void 0;
21817
- this.subtitleTrackController = void 0;
21818
- this.interstitialsController = void 0;
21819
- this.emeController = void 0;
21820
- this.cmcdController = void 0;
21810
+ this.abrController = undefined;
21811
+ this.bufferController = undefined;
21812
+ this.capLevelController = undefined;
21813
+ this.latencyController = undefined;
21814
+ this.levelController = undefined;
21815
+ this.streamController = undefined;
21816
+ this.audioTrackController = undefined;
21817
+ this.subtitleTrackController = undefined;
21818
+ this.interstitialsController = undefined;
21819
+ this.emeController = undefined;
21820
+ this.cmcdController = undefined;
21821
21821
  this._media = null;
21822
21822
  this._url = null;
21823
- this._sessionId = void 0;
21824
- this.triggeringException = void 0;
21823
+ this._sessionId = undefined;
21824
+ this.triggeringException = undefined;
21825
21825
  this.started = false;
21826
21826
  const logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance', userConfig.assetPlayerId);
21827
21827
  const config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -22163,7 +22163,7 @@ class Hls {
22163
22163
  recoverMediaError() {
22164
22164
  this.logger.log('recoverMediaError');
22165
22165
  const media = this._media;
22166
- const time = media == null ? void 0 : media.currentTime;
22166
+ const time = media == null ? undefined : media.currentTime;
22167
22167
  this.detachMedia();
22168
22168
  if (media) {
22169
22169
  this.attachMedia(media);
@@ -22502,7 +22502,7 @@ class Hls {
22502
22502
  */
22503
22503
  setAudioOption(audioOption) {
22504
22504
  var _this$audioTrackContr;
22505
- return ((_this$audioTrackContr = this.audioTrackController) == null ? void 0 : _this$audioTrackContr.setAudioOption(audioOption)) || null;
22505
+ return ((_this$audioTrackContr = this.audioTrackController) == null ? undefined : _this$audioTrackContr.setAudioOption(audioOption)) || null;
22506
22506
  }
22507
22507
  /**
22508
22508
  * Find and select the best matching subtitle track, making a level switch when a Group change is necessary.
@@ -22510,7 +22510,7 @@ class Hls {
22510
22510
  */
22511
22511
  setSubtitleOption(subtitleOption) {
22512
22512
  var _this$subtitleTrackCo;
22513
- return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ? void 0 : _this$subtitleTrackCo.setSubtitleOption(subtitleOption)) || null;
22513
+ return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ? undefined : _this$subtitleTrackCo.setSubtitleOption(subtitleOption)) || null;
22514
22514
  }
22515
22515
 
22516
22516
  /**
@@ -22688,7 +22688,7 @@ class Hls {
22688
22688
  */
22689
22689
  get interstitialsManager() {
22690
22690
  var _this$interstitialsCo;
22691
- return ((_this$interstitialsCo = this.interstitialsController) == null ? void 0 : _this$interstitialsCo.interstitialsManager) || null;
22691
+ return ((_this$interstitialsCo = this.interstitialsController) == null ? undefined : _this$interstitialsCo.interstitialsManager) || null;
22692
22692
  }
22693
22693
 
22694
22694
  /**
@@ -22699,7 +22699,7 @@ class Hls {
22699
22699
  return getMediaDecodingInfoPromise(level, audioTracksByGroup, navigator.mediaCapabilities);
22700
22700
  }
22701
22701
  }
22702
- Hls.defaultConfig = void 0;
22702
+ Hls.defaultConfig = undefined;
22703
22703
 
22704
22704
  var KeySystemFormats = emptyEs.KeySystemFormats;
22705
22705
  var KeySystems = emptyEs.KeySystems;